DamionGans / ubuntu-wsl2-systemd-script

[Does not work anymore!] Script to enable systemd support on current Ubuntu WSL2 images

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot login after installation Windows 11 + WSL2 + Ubuntu 22.04

totszwai opened this issue · comments

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.

commented

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

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. :(

commented

@totszwai totszwai

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

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.