Skip to content

Instantly share code, notes, and snippets.

@schtobia
Created July 26, 2024 11:50
Show Gist options
  • Save schtobia/a8e560da6c4abc219ce5e55516ad6606 to your computer and use it in GitHub Desktop.
Save schtobia/a8e560da6c4abc219ce5e55516ad6606 to your computer and use it in GitHub Desktop.
systemd service for bind mounting the WSL X11 socket to /tmp/.X11-unix
# SPDX-License-Identifier: LGPL-2.1-or-later
#
[Install]
WantedBy=multi-user.target
[Unit]
Description=Mount WSL X11 socket
ConditionPathExists=/tmp/.X11-unix
ConditionPathExists=/mnt/wslg/.X11-unix
After=mnt-wslg.mount
Requires=mnt-wslg.mount
[Service]
Type=simple
ExecStart=mount --bind /mnt/wslg/.X11-unix /tmp/.X11-unix
ExecStop=umount /tmp/.X11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment