Created
September 26, 2022 18:44
-
-
Save cerebrate/5cc6b2d6b9a42812ced020ea3e59b059 to your computer and use it in GitHub Desktop.
Bind mount solution for restoring WSLg under systemd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /lib/systemd/system/tmp-.X11\x2dunix.mount | |
[Unit] | |
Description=WSLg Remount Service | |
DefaultDependencies=no | |
After=systemd-tmpfiles-setup.service | |
Before=sysinit.target | |
ConditionPathExists=/tmp/.X11-unix | |
ConditionPathIsMountPoint=!/tmp/.X11-unix | |
ConditionPathExists=/mnt/wslg/.X11-unix | |
[Mount] | |
What=/mnt/wslg/.X11-unix | |
Where=/tmp/.X11-unix | |
Type=none | |
Options=bind | |
[Install] | |
WantedBy=sysinit.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /lib/tmpfiles.d/wslg.conf | |
# Recreate the mount point for the X11 socket. | |
d /tmp/.X11-unix - - - - - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment