Skip to content

Init /tmp/.X11-unix is overwritten by mounts #43

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

Open
pecigonzalo opened this issue Apr 22, 2021 · 8 comments
Open

Init /tmp/.X11-unix is overwritten by mounts #43

pecigonzalo opened this issue Apr 22, 2021 · 8 comments
Assignees
Labels
bug Something isn't working fixinbound

Comments

@pecigonzalo
Copy link

pecigonzalo commented Apr 22, 2021

The init order seems to process the creation of /tmp/.X11-unix before processing /etc/fstab. This conflicts with an tabs which set /tmp to be a tmpfs (as is fairly common).

More information in: #19 (comment)

Example /etc/fstab:

tmpfs /tmp tmpfs rw,nodev,nosuid,size=2G 0 0
@cerebrate
Copy link

As a side note for anyone using genie (<1.38) or one of the other systemd hacks - systemd-tmpfiles, which is run by default on boot, also wipes out the contents of /tmp/.X11-unix . If you're having that problem and find this issue, it's probably not WSLg's fault.

@eternalphane
Copy link

To make it work with systemd, create /etc/tmpfiles.d/wslg.conf with following content:

#  This file is part of the debianisation of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.

# See tmpfiles.d(5) for details

# Type Path           Mode UID  GID  Age Argument
L+     /tmp/.X11-unix -    -    -    -   /mnt/wslg/.X11-unix

@amirasyraf
Copy link

@eternalphane Brilliant workaround. I'm using the systemd script https://github.com/DamionGans/ubuntu-wsl2-systemd-script and this works perfectly.

@pecigonzalo
Copy link
Author

pecigonzalo commented Apr 24, 2021 via email

@spronovo spronovo added bug Something isn't working fixinbound labels Apr 26, 2021
@cerebrate
Copy link

@pecigonzalo The fix genie (1.39+) is actually using is the one documented by @diddledan here:

https://forum.snapcraft.io/t/wsl-wslg-and-systemd-hacks/24022

That is to say, using systemd-socket-proxy to make the XWayland socket available under .tmp, and using an override for the user-runtime-dir service to mount /mnt/wslg/runtime-dir at /run/usr/$UID. This solution seems to be working pretty well so far.

That said, I do currently have arkane-systems/genie#157 open, which seems to suggest that the latter has some issues when there are user sessions under UIDs other than 1000 involved. Currently being looked at.

@OneBlue
Copy link
Collaborator

OneBlue commented Apr 27, 2021

@pecigonzalo : Thanks for reporting this.

The issue has been fixed in wsl and will make its way to insider builds.

@sonook
Copy link

sonook commented Feb 12, 2022

To make it work with systemd, create /etc/tmpfiles.d/wslg.conf with following content:

#  This file is part of the debianisation of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.

# See tmpfiles.d(5) for details

# Type Path           Mode UID  GID  Age Argument
L+     /tmp/.X11-unix -    -    -    -   /mnt/wslg/.X11-unix

Worked for me...as when i switched systemd my WSLg stopped working.

Thanks

@FingerlessGlov3s
Copy link

Using systemd in Rocky Linux 9, I don't get this problem, but in Fedora 40 I do.

@sonook 's fix works a treat for Fedora 40 to get I working, Added file, terminated WSL and then started it again, starts working no problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixinbound
Projects
None yet
Development

No branches or pull requests

9 participants