-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Description
Windows Version
Microsoft Windows [Version 10.0.22621.1778]
WSL Version
1.3.10.0
Are you using WSL 1 or WSL 2?
- WSL 2
- WSL 1
Kernel Version
5.15.90.2-microsoft-standard-WSL2
Distro Version
Ubuntu 22.04
Other Software
No response
Repro Steps
Make sure guiApplications=true in wslconfig.
- Open WSL from Windows Terminal.
- Run
systemctl --user status - Or Run
ls /run/user/1000
Expected Behavior
Excepts systemd user session to be present and systemctl --user to be able connect to it.
This kinda relates to #8842 , but not the same issue. This not the race condition issue, rather WSL login is nuking bus and other sockets in /run/user/1000 directory. Check the attached video demonstration.
If we follow the Following steps:
- In Powershell, wsl --shutdown few times to be sure.
wsl -u root -e /bin/bashthis makes wsl login to root. So wsl doesn't touch 1000 user (named gittu). this user has linger enabled, so systemd naturally creates the user session.- Here logged in via root,
ls /run/user/1000shows proper bus, systemd etc.. sockets created. - Now open wsl to user gittu (which is default user) by opening a new tab in Windows Terminal.
- Observe that
[ 29.574698] WSL (2): Creating login session for gittuline appears in dmesg output, confirming that WSL indeed created a user session for gittu, nuking previously good user session created by systemd. - Now output of
ls /run/user/1000/doesn't have bus, systemd etc.. sockets.
Now If I disable wslg, so guiApplications=false. The issue is solved, wsl doesn't nuke contents of /run/user/1000. So from this observation my conclusion is wslg is nuking the contents of /run/user/1000, and only manually putting wslg's files there.
Screenshot.2023-06-16.00.24.23.mp4
Actual Behavior
↪ ~ ➤ systemctl --user status
Failed to connect to bus: No such file or directory
↪ ~ ➤ ls /run/user/1000 -l
total 0
drwx------ 3 gittu gittu 60 Jun 16 00:24 dbus-1
drwx------ 2 gittu gittu 80 Jun 16 00:24 pulse
lrwxrwxrwx 1 root root 31 Jun 16 00:25 wayland-0 -> /mnt/wslg/runtime-dir/wayland-0
-rw-rw---- 1 gittu gittu 0 Jun 16 00:24 wayland-0.lock
Diagnostic Logs
No response
viceice, worming004, fktpp2022, chrism-cdata, Sarisan and 12 moreW1M0Remliunix, rzyns and 1nv0k32