after installing wsl-setup WSLG GUI apps stopped working

Bug #1987970 reported by Fiz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
wsl-setup (Ubuntu)
New
Undecided
Unassigned

Bug Description

Installed this in a fresh instance of Windows 11 WSL2, systemd is working, but the GUI apps are not working and produces "Error: Can't open display: :0"

Here is the versions

C:\WINDOWS\system32>wsl -v
WSL version: 0.66.2.0
Kernel version: 5.15.57.1
WSLg version: 1.0.42
MSRDC version: 1.2.3401
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22000.708

Fiz (fm663)
summary: - after installing this, WSLG stopped working
+ after installing wsl-setup WSLG GUI apps stopped working
Revision history for this message
Carlos Nihelton (cnihelton) wrote :

That bug is most likely unrelated to Ubuntu or wsl-setup itself. Current version of WSL/WSLg creates incremental named symlinks to the X11 socket inside `/tmp/.X11-unix/` (X0, X1, X2...) as one launches different distros, thus the DISPLAY environment variable (always set to `:0`) doesn't match the socket. See the following issue in MS repo: https://github.com/microsoft/wslg/issues/818 .

You can confirm that by running `ls -l /tmp/.X11-unix/` across different distros.

One workaround would be setting the DISPLAY environment variable according to the socket name found. See https://github.com/microsoft/wslg/issues/818#issuecomment-1227756256

 # set X server display
 export DISPLAY=:$(ls /tmp/.X11-unix/ | cut -d "X" -f2)

I'd appreciate you confirming the case so I can properly close this bug report.

Revision history for this message
Carlos Nihelton (cnihelton) wrote :

Also, if my assumption is correct, the latest version of WSL contains the fix for that. Could you please check that out?

https://github.com/microsoft/WSL/releases/tag/0.67.6

Revision history for this message
Fiz (fm663) wrote :

How to get that version installed via Microsoft Store apps?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.