Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd_249.11-0ubuntu3.10 seems to break user sessions on WSL2 #10496

Open
1 of 2 tasks
facboy opened this issue Sep 19, 2023 · 8 comments
Open
1 of 2 tasks

systemd_249.11-0ubuntu3.10 seems to break user sessions on WSL2 #10496

facboy opened this issue Sep 19, 2023 · 8 comments

Comments

@facboy
Copy link

facboy commented Sep 19, 2023

Windows Version

Microsoft Windows [Version 10.0.22621.2283]

WSL Version

1.3.11.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.90.2-3

Distro Version

Ubuntu 22.04

Other Software

systemd_249.11-0ubuntu3.10 (https://ubuntu.pkgs.org/22.04/ubuntu-updates-main-amd64/systemd_249.11-0ubuntu3.10_amd64.deb.html) or one of its associated packages seems not to function correctly on WSL2.

Repro Steps

  1. start WSL2
  2. run systemctl --user status

Expected Behavior

Expect command to work.

Actual Behavior

Get an error instead:

Failed to connect to bus: No such file or directory

Diagnostic Logs

/var/log/syslog contains various 'new' error messages:

Sep 19 13:26:18 my_host kernel: [   14.240924] WSL (2) ERROR: WaitForBootProcess:3189: /sbin/init failed to start within 10000
Sep 19 13:26:18 my_host kernel: [   14.240926] ms
Sep 19 13:26:18 my_host kernel: [   14.243359] WSL (2): Creating login session for my_user

and later

Sep 19 13:28:13 my_host systemd[1]: Started User Manager for UID 1000.
Sep 19 13:28:13 my_host systemd[1]: session-c1.scope: Couldn't move process 604 to requested cgroup '/user.slice/user-1000.slice/session-c1.scope': No such process
Sep 19 13:28:13 my_host systemd[1]: session-c1.scope: Failed to add PIDs to scope's control group: No such process
Sep 19 13:28:13 my_host systemd[1]: session-c1.scope: Failed with result 'resources'.
Sep 19 13:28:13 my_host systemd[1]: Failed to start Session c1 of User my_user.
@facboy
Copy link
Author

facboy commented Sep 19, 2023

workaround is to pin systemd to 249.11-0ubuntu3.9 (or downgrade to it, if you can find the deb pkgs to download).

@benhillis
Copy link
Member

/logs

I would also recommend updating to WSL 2.0.0 to see if the issue goes away.

@microsoft-github-policy-service
Copy link
Contributor

Hello! Could you please provide more logs to help us better diagnose your issue?

To collect WSL logs, download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging

Thank you!

@kristof-mattei
Copy link

/logs

I would also recommend updating to WSL 2.0.0 to see if the issue goes away.

WSL 2.0.0 does not help.

@kristof-mattei
Copy link

@benhillis logs contain lots of private info. Can I upload it somewhere safe?

@dan-mba
Copy link

dan-mba commented Sep 20, 2023

I ran into problems after updating systemd.

For me, the fix was:
run systemctl --type=service and look for the service that failed.
It was something like systemd-wait-for-network
Disabling this service fixed all my problems.

@facboy
Copy link
Author

facboy commented Sep 21, 2023

https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2036358

EDIT: seems we shouldn't be running systemd-networkd at all on WSL2 as we have no systemd managed network connections. i just disabled that.

@oldium
Copy link

oldium commented May 5, 2024

https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2036358

EDIT: seems we shouldn't be running systemd-networkd at all on WSL2 as we have no systemd managed network connections. i just disabled that.

Info for others: this means running sudo systemctl disable --now systemd-networkd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants