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.
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.
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:
wsl --update in Windows 11 to update your WSL release to include WSLg.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.
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