Since I know a lot of folks here use snapd under WSL using either my genie or a different systemd-enabling hack, a word of warning/advice:
- If you’re using genie, make sure you’ve updated to 1.38 for WSLg compatibility
- If you aren’t, here’s what breaks and needs fixing:
- You will need to ensure that the new environment variables are passed through: DISPLAY, WAYLAND_DISPLAY, and PULSE_SERVER .
- By default, systemd runs systemd-tmpfiles when “booting”, which cleans up various directories and temporary files. This includes /tmp/.X11-unix, which wipes out the link to the socket WSLg’s X server is accessed through, thus ensuring that X applications won’t work either inside or outside the systemd namespace. You need to put this link back after systemd initializes to make X work again; genie does this simply by bind-mounting /mnt/wslg/.X11-unix on top of /tmp/.X11-unix after systemd is up.
Hope this is of use.