Summary
I can no longer open GUI applications from WSL. The only thing that changed recently was a new Windows update.
System Info
I am on Windows 11 Home version 23H2, build 22631.3737 Windows Feature Experience Pack 1000.22700.1009.0 using WSL 2
I have the following in my ~/.bashrc
file:
# allow X11 to work
export DISPLAY="$(grep nameserver /etc/resolv.conf | sed 's/nameserver //'):0.0"
export LIBGL_ALWAYS_INDIRECT=1
And my DISPLAY
variable looks like this:
$ echo $DISPLAY
10.255.255.254:0.0
I run XLaunch with these settings:
<?xml version="1.0" encoding="UTF-8"?>
<XLaunch
WindowMode="MultiWindow"
ClientMode="NoClient"
LocalClient="False"
Display="-1"
LocalProgram="xcalc"
RemoteProgram="xterm"
RemotePassword=""
PrivateKey=""
RemoteHost=""
RemoteUser=""
XDMCPHost=""
XDMCPBroadcast="False"
XDMCPIndirect="False"
Clipboard="True"
ClipboardPrimary="True"
ExtraParams=""
Wgl="True"
DisableAC="True"
XDMCPTerminate="False"
/>
Description
This setup has been working for years. I updated my PC over the weekend and turned it on this morning to find the message "Error: Can't open display: 10.255.255.254:0.0
" every time I try to launch a GUI program.
Any ideas on what went wrong? I'd like to be able to run GUI applications from WSL again.
export DISPLAY=…
in your bashrc is overriding whatever WSLg sets?DISPLAY
as just:0
then WSLg takes over. Thanks! I will edit the answer accordingly.