Check for WSL GUI Service

This guide is for the wslg feature of windows 11.
Check for display:

1
2
$ echo $DISPLAY
:0

if not, change it with:

1
$ export DISPLAY=:0

check for X11 display socket

1
2
$ ls -la /tmp/.X11-unix
lrwxrwxrwx 1 spronovo spronovo 19 Apr 21 15:28 /tmp/.X11-unix -> /mnt/wslg/.X11-unix

This is setup during WSL’s INIT.
If doesn’t exist, re-create it to try things out:

1
2
$ sudo rm -r /tmp/.X11-unix
$ ln -s /mnt/wslg/.X11-unix /tmp/.X11-unix

Check whether X11 server is running:

1
2
$ ls /tmp/.X11-unix
X0