Glitches in GUI applications
Windows build number:
10.0.22631.0
Your Distribution version:
22.04
Your WSL versions:
WSL version: 2.0.9.0 Kernel version: 5.15.133.1-1 WSLg version: 1.0.59 MSRDC version: 1.2.4677 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22631.2715
Steps to reproduce:
- activate wsl on windows
- install ubuntu distro either from MS store or from terminal by wsl --install or wsl --install ubuntu
- update ubuntu distro sudo apt update && upgrade
- install emacs, vlc or nautilus
- launch one of those, I get this behavior as described in the screenshots
WSL logs:
stderr.log weston.log pulseaudio.log
WSL dumps:
No response
Expected behavior:
WSL should run gui applications without the glitches.
Actual behavior:
I had wsl working just fine until yesterday! Everything I am about to eplain about was working fine yesterday.
Yesterday I have installed another ubuntu version on my wsl, alongside fully working wsl version(was testing out different emacs versions). So I had 2x ubuntu versions + the default docker wsl's.
This strange gui glitch started to happen when I launch emacs gui application. If I launch it in the terminal - all is good.
emacs gui with glitches:
emacs over terminal:
When I move the emacs gui screen - the glitch dissapears. When I stop moving it - it reappears.
I thought okay I can not work like this, I need to start fresh. I then unregistered both ubuntu distros and went to "add remove programs" to uninstall those ubuntu versions.
I installed ubuntu from terminal by wls --install ubuntu or wsl --install or from ms store, restarts...- same problem.
I then disabled WSL feature. Restarts... installed wsl again, did wsl --set-default-version 2 - same problem.
I then tried to install another GUI application - nautilus and VLC - same probelm with those:
I then thought thanks god its not related with emacs, its a gui bug in general with all linux applications over wsl. Nothing similar happens on my windows apps.
That helped me to narrow the problem down. Insead of googling "emacs gui glitches in wsl", I started to google for "wsl gui glitches".
I then found out about wslg and that it is responsible for launching gui applications over wsl.
I then installed mobaxterm since I guess it does not use wslg, but uses xserver. I then tried to launch emacs with it:
x server off - emacs launched in terminal mode:
x server on - emacs launched in gui mode:
Finally emacs has no glitches!!!
I dont really want to reset my windows to make wsl not glitch anymore, can you help me find a way what to update/remove/reinstall to make these glitches go away?
Thank you!
p.s. this is everything I have installed right now that I know regarding wsl, hope that helps:
Addition with some videos:
Sometimes it works:
https://github.com/microsoft/wslg/assets/78803192/98f11bb5-a0d6-4760-8f49-4840dca11719
Sometimes it does not work:
https://github.com/microsoft/wslg/assets/78803192/729bae6c-db4b-4771-8698-3743e79ce57a
I have exactly the same problem.
This is gedit:
Downgrading to 2.0.4 seems to be an option:
https://github.com/microsoft/wslg/issues/1130
Downgrading to 2.0.4 seems to be an option:
#1130
Amazing @vielhuber, that sounds promsing. good detective work!
How would one go about with downgrading wsl? Did you succeed? Is the glitching gone for you?
I tried:
- Updated nvidia drivers (via "GeForce Experience")
-
sudo apt update -
sudo apt upgrade -
wsl --shutdownvia PowerShell (Admin)
Then it worked until a restart.
Identified that after boot I manually once always need to run wsl --shutdown, then reopen wsl and it works from then on until the next restart.
I can't downgrade at the moment and am waiting for an official fix (see https://github.com/microsoft/wslg/issues/1130).
Will wait for an official fix then also.
Untl then I will run my wsl gui applications over https://mobaxterm.mobatek.net/ . Give it a try, it's cool!
The exact issue here. @arvydasg could you try the downgrading suggestion?
Surprisingly the issue does not repeat anymore. Will try it if it happens again.
Same issue here. Windows 11 with following WSL info
WSL version: 2.0.9.0 Kernel version: 5.15.133.1-1 WSLg version: 1.0.59 MSRDC version: 1.2.4677 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22631.2715
I did an update in Intel Drivers update and Windows Update simultaneously so not sure what broke it. However, I tried the following:
-In .wslgconfig I added
[system-distro-env] ;disable GPU in system-distro LIBGL_ALWAYS_SOFTWARE=1
-Restarted wsl. Worked. -Restarted laptop, the fix still works.
Maybe other people try this and post their feedback.
¡Worked for me!
Same issue here. Windows 11 with following WSL issue
WSL version: 2.0.9.0 Kernel version: 5.15.133.1-1 WSLg version: 1.0.59 MSRDC version: 1.2.4677 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22631.2715
I did an update in Intel Drivers update and Windows Update simultaneously so not sure what broke it. However, I tried the following:
-In .wslgconfig I added
[system-distro-env] ;disable GPU in system-distro LIBGL_ALWAYS_SOFTWARE=1
-Restarted wsl. Worked. -Restarted laptop, the fix still works.
Maybe other people try this and post their feedback.
Worked For Me! Thanks!
Same issue unfortunatelly with latest installation in wsl 2 (Ubuntu)
And it's still not fixed..
I had a similar problem. I installed Kali in WSL then I installed x11-apps just for a simple test.
When I launched xeyes and xcalc it was glitching out. All I had to do to fix it was restart Windows 11.
PS C:\Users\benargee>wsl -v
WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.2715
I had a similar problem. I installed Kali in WSL then I installed x11-apps just for a simple test.
When I launched xeyes and xcalc it was glitching out. All I had to do to fix it was restart Windows 11.PS C:\Users\benargee>wsl -v WSL version: 2.0.9.0 Kernel version: 5.15.133.1-1 WSLg version: 1.0.59 MSRDC version: 1.2.4677 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22631.2715
Well that didn't helped me... Probably it's an bug in the code since I'm not the only person who have these issues so I hope that WSLg developers will look into this case and at least try to fix it from their side.
-In .wslgconfig I added [system-distro-env] ;disable GPU in system-distro LIBGL_ALWAYS_SOFTWARE=1 -Restarted wsl. Worked. -Restarted laptop, the fix still works.
This does not work for me after pc restart.
Is the path in %USERPROFILE%/.wslgconfig (not %USERPROFILE%/.wslconfig)?
-In .wslgconfig I added [system-distro-env] ;disable GPU in system-distro LIBGL_ALWAYS_SOFTWARE=1 -Restarted wsl. Worked. -Restarted laptop, the fix still works.
This does not work for me after pc restart. Is the path in
%USERPROFILE%/.wslgconfig(not%USERPROFILE%/.wslconfig)?
It is .wslgconfig
[system-distro-env] ;disable GPU in system-distro LIBGL_ALWAYS_SOFTWARE=1
Thanks it worked on windows 11 pro 22H2 with Ubuntu. For the one wondering you can create the file .wslgconfig directly in you home folder on windows and copy bluejoyq solution (type %USERPROFILE% as a path in explorer if you dont know where it is). Strangely the solution did not work for my OpenSUSE environment (15.5)
FYI I had to put the .wslgconfig file in C:\ProgramData\Microsoft\WSL. The WSL folder didn't exist so I had to create it manually.
So I was having this problem as well, nothing above worked so, identifying the problem in wslg, I disabled it by adding in C:\Users\youruser\ .wslconfig
[wsl2]
guiApplications=false
as suggested in https://github.com/microsoft/wslg/discussions/523 and restarted.
Then I used MobaXterm as X server, exported its display destination in the $DISPLAY variable and all solved.
Same problem. It is intermittent. I have updated NVIDIA and Intel drivers, but that had no effect. The problem still arises, seemingly at random.
Same problem. After windows launch stopping wsl and restarting it helps for the day
When I installed xfce4, I encountered this issue. There was no problem before this.
The same happened to me today. Used wsl --shutdown and it worked for now.
I just ran into this as well on a fresh install of WSL2. wsl --v output:
WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.2715
Running on a Vega 56 GPU, and didn't experience it on the older version of WSL2 I had installed previously. Updating the AMD drivers didn't resolve it. Following the suggestion in the thread to add the LIBGL_ALWAYS_SOFTWARE=1 to .wslgconfig seems to fix it for me.
What are the implications of setting the LIBGL_ALWAYS_SOFTWARE variable? Just want to make a note if it can (or should) be removed from the configuration if a fix is released.
I just ran into this as well on a fresh install of WSL2.
wsl --voutput:WSL version: 2.0.9.0 Kernel version: 5.15.133.1-1 WSLg version: 1.0.59 MSRDC version: 1.2.4677 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22631.2715Running on a Vega 56 GPU, and didn't experience it on the older version of WSL2 I had installed previously. Updating the AMD drivers didn't resolve it. Following the suggestion in the thread to add the
LIBGL_ALWAYS_SOFTWARE=1to.wslgconfigseems to fix it for me.What are the implications of setting the
LIBGL_ALWAYS_SOFTWAREvariable? Just want to make a note if it can (or should) be removed from the configuration if a fix is released.
Well, GPU acceleration in WSLg has been a bit questionable. You can read this:
https://github.com/microsoft/wslg/issues/469
However, there are apps that may expect the GPU acceleration to be on so in case something crashes, you may have to turn it on. From my side, since I do mostly development in WSLg, having it on or off, doesn't bother me. I had it on for a couple of apps that were 'nice-to-use/have', but since this bug, I turned it off. I may turn it on if they fix the bug, but leaving it off won't hurt my daily programming life in WSLg.
Unlike seemingly everyone else here ... I don't have this issue when wsl starts up. But if I shut wsl down and restart it only then do I start seeing the issue, until I reboot my computer. I figure I must be doing something wrong when I shut it down and restart it.
Have same issue
PS C:\Users\*****> wsl --version
WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.2715
Same issue here with latest WSL
Version WSL : 2.0.14.0
Version du noyau : 5.15.133.1-1
Version WSLg : 1.0.59
Version MSRDC : 1.2.4677
Version direct3D : 1.611.1-81528511
Version de DXCore : 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Version de Windows : 10.0.19045.3758
Same issue running the Quartus installer
My versions for everything are the same as above, except for windows version which is slightly updated
WSL version: 2.0.14.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22635.2850
I've noticed that if I drag and move the window around, it briefly returns the normal expected screen. Not sure how much that helps. If I can be of any other help please let me know.
This reddit post solved it for me.
- In the Windows directory
C:\Users\<username>(also accessible by pasting%USERPROFILE%in the address bar in Explorer), create a file named.wslconfig - Open the file and paste the following:
[wsl2] guiApplications = true - Restart WSL.
I can now run GUI apps without any glitches. Not sure if the issue will reoccur, though