Quantcast
Channel: Active questions tagged windows-subsystem-for-linux - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2827

WSL for Windows 10 closes immediatly after entering password

$
0
0

I am using the WSL for Windows. I have tried multiple Ubuntu Versions, but every version shuts down right after I enter my password. If I restart my PC, it's fine at first. But if want to open another WSL-Window the problem reoccurs. It's really frustrating.

I have alrady set Ubuntu as my default

If I try to start via PowerShell using wsl.exe, it tells me

Errormessage, if I try to start Ubuntu via Windows Terminal

I added this piece of code to /etc/profile.d/00-wsl2-systemd.sh:

SYSTEMD_PID=$(ps -efw | grep '/lib/systemd/systemd --system-unit=basic.target$' | grep -v unshare | awk '{print $2}')if [ -z "$SYSTEMD_PID" ]; then   sudo /usr/bin/daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target   SYSTEMD_PID=$(ps -efw | grep '/lib/systemd/systemd --system-unit=basic.target$' | grep -v unshare | awk '{print $2}')fiif [ -n "$SYSTEMD_PID" ] && [ "$SYSTEMD_PID" != "1" ]; then    exec sudo /usr/bin/nsenter -t $SYSTEMD_PID -a su - $LOGNAMEfi

Viewing all articles
Browse latest Browse all 2827

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>