DamionGans / ubuntu-wsl2-systemd-script

[Does not work anymore!] Script to enable systemd support on current Ubuntu WSL2 images
1.56k stars 383 forks source link

Cannot login after installation Windows 11 + WSL2 + Ubuntu 22.04 #95

Open totszwai opened 1 year ago

totszwai commented 1 year ago

Am I doing this right...?

image

I tried to install it, didn't work, then I uninstall it, and reinstall it. Then tried it again using --force...

Then when I try to login as a regular user, it just hang there and never got in.

sanbuphy commented 1 year ago

I meet the same error. I can try it in Ubuntu20.04 , but when i try it in 22.04,i can't open 22.04 from now on

totszwai commented 1 year ago

I ended up deleting the whole WSL and restart from scratch. I've also tried to get the systemd to work again and failed, so far, I'm not able to get the systemd in WSL2. :(

sanbuphy commented 1 year ago

@totszwai totszwai

It work well in Ubuntu 20.04 WSL2 ,you can have a try.

codekuu commented 1 year ago

Had the same issue and I just reverted everything the script did.

  1. Open up powershell and write wsl -d DISTRONAME -u root
  2. Delete /usr/sbin/start-systemd-namespace and /usr/sbin/enter-systemd-namespace (rm -rf XXX)
  3. Edit the file /etc/bash.bashrc using your favorite text editor and comment out source /usr/sbin/start-systemd-namespace It should look something like:
    # Start or enter a PID namespace in WSL2
    # source /usr/sbin/start-systemd-namespace

Tada you should now be able to start the WSL again! You can remove those two lines as well if you want.