2

When launching an app with GUI I have no error message but no window shows up. My display variable is set to 192.168.128.1:0 (don't know if it helps).

Running on a AMD laptop with a Ryzen 5 2500U.

Eliaz
  • 23
  • 1
  • 1
  • 4

2 Answers2

9

I'm going to make an assumption for the moment, but please do edit your question with the additional details that I requested in the comments so that we can make sure that other users in the future can more easily find your question.

My assumption:

  • You were running Windows 10 before
  • At some point you were either using an X server (such as VcXsrv or GWSL) under WSL in Windows 10 or you attempted to.
  • You upgraded the Windows 10 release to Windows 11
  • You have run wsl --update in Windows 11 to update your WSL release to include WSLg.
  • You are now trying to use the WSLg feature in Windows 11 to launch GUI applications.

The $DISPLAY of 192.168.128.1:0 makes me think this, since the default $DISPLAY in a newly installed Windows 11 Ubuntu would simply be :0.

Try:

cd ~
grep -r --exclude-dir=* DISPLAY

If you find any results in startup config files like .bashrc, edit the startup files to remove any custom DISPLAY settings you made in the past.

NotTheDr01ds
  • 28,025
0

I'm having exactly this problem

~$ grep DISPLAY .bashrc
export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0 # in WSL 2

This is with 'Ubuntu on Windows', which was on my machine when I upgraded it to Win11 and which I subsequently upgraded to Jammy Jellyfish 22.04.03.

I also got Ubuntu 22.04.02 from the Windows Store and installed it after the upgrade to Windows 11. It had no problem with GUIs and its DISPLAY was set to ":0"

declare -x DISPLAY=:0

worked great. So this is all as @NotTheDr01ds said, but I can assert that the problem is the .bashrc file and by commenting that line out it'll be resolved -- I don't know where it does get set, but you don't have to explicitly set the DISPLAY to :0

~$ grep -B1 DISPLAY ~/.bashrc
# from https://wiki.ubuntu.com/WSL#Running_Graphical_Applications
# export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0 # in WSL 2