genie
genie copied to clipboard
WSLg Apps not opening Error: no DISPLAY environment variable specified
Windows version (build number): 22000.376
Linux distribution: Ubuntu Windows Store
Genie version: 1.44
Describe the bug
- Safely within bottle. ➜ ~ firefox Error: no DISPLAY environment variable specified
Confirm that you are running inside the bottle: ➜ ~ genie -b inside
To Reproduce Steps to reproduce the behavior:
- sudo apt-get install firefox
- firefox
- See error
Expected behavior Firefox opens.
I confirm that I have read the ENTIRE supplied readme file and checked for relevant information on the repository wiki before raising this issue, and that if the solution to this issue is found in either location, it will be closed without further comment:
- [x] Yes.
Try sudo systemctl enable wslg-xwayland.socket
Not useful, there're several player in this issue:
- wslg-xwayland.socket / wslg-xwayland.socket: Create a socket at /tmp/.X11-unix
- tmpfiles.d/wslg.conf (check both under /etc and /usr/lib): Link /tmp/.X11-unix to /mnt/wslg/.X11-unix
- systemd's own /usr/lib/tmpfiles.d/x11.conf: Remove all file under /tmp/.X11-unix
- WSL's own bind mounting from /tmp/.X11-unix to /mnt/wslg/.X11-unix
For me, 4 is conflicting with 1 2 3, as wslg-xwayland will overwrite the original socket, wslg.conf will do a symlink, systemd will delete tmp folder, all of these will kill the original X11 socket. There're several working cases:
- Disable 134 & Use 2 only: DISPLAY variable will be set correctly
- Disable 234 & Use 1 only: DISPLAY variable will be empty, but manually setting it to
:0
would still make wslg working - Disable 123 & Use 4 only: the original, non-genie case, OFC working
So I chose to disable 134: I killed 4 by umounting /tmp/.X11-unix before genie, and killed 1 by masking wslg-xwayland*, and make sure there's /etc/tmpfiles.d/wslg.conf
In theory, 1 should not exist alongside 2 on a clean genie installation; 2 was intended as a replacement for one. 2 also shouldn't clash with 3, because systemd-tmpfiles consolidates the various .confs before acting on them.
Not sure about 4. I see a symlink there pre-genie, not a bind mount.