-
Notifications
You must be signed in to change notification settings - Fork 822
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
WSL 2.0.1: systemd-logind logs session out after few minutes, purges /run/user/{uid} #10552
Comments
I had |
/logs |
I suspect this is also due to #10496. What does If it timed out while waiting (2 minutes is the default), then it's (partially) due to a change with systemd (bug report). You should be able fix it by disabling systemd-networkd (and shutdown & reboot WSL): In order to get it to work without disabling this service you'll need to wait for the proposed fix to roll out (and tweak your systemd-networkd config to tell it to explicitly ignore the built in adapter). |
Thank you very much for the quick and detailed response. Your are exactly right, the systemd-networkd is the cause for this. I attached details about both systemd-networkd and systemd-logind below. Disabling systemd-networkd seems to be a sensible thing to do under WSL anyway, so this works for me. That also means not my update to WSL 2.0.1 but updating the packages inside the VM was the reason this started to happen. I close this issue as it is already tracked in #10496 and also essentially a systemd and not a WSL issue.
|
Windows Version
Microsoft Windows [Version 10.0.22621.2283]
WSL Version
2.0.1.0
Are you using WSL 1 or WSL 2?
Kernel Version
No response
Distro Version
Ubuntu 22.04
Other Software
No response
Repro Steps
With WSL 2.0.1 pre-release:
wsl --shutdown
systemctl status systemd-logind.service
, a new session login should be logged. Also/run/user/1000
should existExpected Behavior
A new user session exists and stays,
/run/user/1000
does exist.Actual Behavior
After around 2 minutes
systemd-logind
reports the session logged out, even though the terminal window is still open and usable. Here is the tail ofjournalctl --unit=systemd-logind.service
Due to this also the
/run/user/{uid}
directory for this user gets purged. This can cause issues with running applications making use of this directory and can prevent applications from starting.For me this behavior is reliably reproducible every time, and every time session log out happens at around 2 minutes after start. I can start applications using
/run/user/{uid}
initially and see that this directory is being filled, but regardless of whether I have applications started or just have the terminal sit idle it gets cleaned up after the 2 minutes.This behavior did not happen with the stable release WSL 1.3
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: