wslg: Can't use WLSg at all, apps freeze or are not responsible

Environment

Windows build number: 10.0.22000.0
Your Distribution version: Ubuntu 21.04
Your WSLg version: Windows Subsystem for Linux WSLg Preview 1.0.26 (is this it?)

Steps to reproduce

Microsoft Edge:

It runs full screen, and everything works, the I try exiting full screen/resizing, and I can’t input anything anymore. It just hangs and I need to close it.

Firefox:

  • sudo apt install firefox
  • firefox (or MOZ_ENABLE_WAYLAND=1 firefox)

It usually works, but it always freezes before I finish my work, it just stops accepting input then the WSL GUI Window can’t be moved or closed. The only way to fix it is wsl --shutdown

Firefox WSL logs:

weston.log pulseaudio.log versions.txt.txt

Others

I also tried to run other GUI apps, they all evetually freeze.

Expected behavior

Not freeze.

Actual behavior

Freezing.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 10
  • Comments: 55 (8 by maintainers)

Most upvoted comments

Same problem with IntelliJ. I am running Windows 11.

This issue has become the biggest blocker for continuing using WSLG for me. How can I contribute to debugging the root cause of this? It happens to me every time I try to resize my windows that are running in almost 4k resolution. I feel like there must be some overflow, race condition or bandwidth issue.

I gave up WSLg and use Kali Linux Win-KeX and it works much better than wslg.

I also have the same problem with GitKraken. Every now and then it doesn’t respond. I notice this because the context menus usually opened by right click no longer open. At that point the GUI stops responding and if I try to close the window it won’t close. Only solution: wsl --shutdown.

I followed the steps described and this is the output shown by the console. Did I do this correctly?

[New LWP 19]
[New LWP 33]
[New LWP 34]
[New LWP 35]
[New LWP 36]
[New LWP 37]
[New LWP 38]
[New LWP 39]
[New LWP 40]
[New LWP 41]
[New LWP 42]
[New LWP 43]
[New LWP 44]
[New LWP 45]
[New LWP 46]
[New LWP 47]
[New LWP 48]
[New LWP 49]
[New LWP 50]
[New LWP 51]
[New LWP 52]
[New LWP 54]
[New LWP 55]
[New LWP 56]
[New LWP 57]
[New LWP 58]
[New LWP 59]
[New LWP 60]
[New LWP 61]
[New LWP 63]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
0x00007fb47af9fb6e in epoll_wait () from /lib/libc.so.6
warning: target file /proc/8/cmdline contained unexpected null characters
Saved corefile core.8
[Inferior 1 (process 8) detached]

🟢 I had the same problem and finally found a brilliant solution:

  • Follow this very easy tutorial to setup an X server on your machine: https://chuckdries.medium.com/installing-gitkraken-in-wsl-2-15bf6459f823 -> I personally skipped the firewall part, it took me 15 minutes max.

  • Open a cmd shell (Win+R), type shell:startup and put the config.xlaunch file that was created previously in the startup folder that opened. This will execute the file automatically on startup, starting your X server👏

  • that’s it, no more pain.

So in the end, in the /home directory of my Ubuntu file system I added 3 lines in the .bashrc: file :

export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0
export GDK_SCALE=1
alias gk='gitkraken' # Cadeau 🎁

The result is actually better than the wslg proposed by Windows, now your Linux apps eg: Gitkraken will use your usual Windows UI and resize/snap perfectly 👌 I did the change one week ago and I had ZERO issues since then while working 9 hours a day. Before that, my Gitkraken would freeze at least once a day and I had to shutdown my WSL. To then painfully restart all my npm commands again.

There’s no reason this solution doesn’t work for you, give it a try, Commenting your results here would be nice 🎯

ℹ️ The X server is typically the provider of graphics resources and keyboard/mouse events to X clients, meaning that the X server is usually running on the computer in front of a human user, while the X client applications run anywhere on the network and communicate with the user’s computer to request the rendering of …

Wslg is unusable on 32GB Dell xps - it kills my machine everything hangs.

Not sure whether it is the same issue. When I use PHPStorm or Goland in wslg, they often stuck on mouse event when I open a new IDE window, but I still can use keyboard to control them. Only fix is wsl --shutdown.

Have the same issue with IntelliJ, only fix is wsl --shutdown unfortunately

I gave up WSLg and use Kali Linux Win-KeX and it works much better than wslg.

@yangli2014 thanks for the tip! I’ve been having tons of issues with WSLg, similar to those described in this issue. I’m spinning up on Win-KeX now. So far, so good.

https://www.kali.org/docs/wsl/win-kex/

My system is Windows 11 Pro with WSL2

└─$ cat /etc/os-release
PRETTY_NAME="Kali GNU/Linux Rolling"
NAME="Kali GNU/Linux"
VERSION_ID="2023.4"
VERSION="2023.4"
VERSION_CODENAME=kali-rolling
ID=kali
ID_LIKE=debian
HOME_URL="https://www.kali.org/"
SUPPORT_URL="https://forums.kali.org/"
BUG_REPORT_URL="https://bugs.kali.org/"
ANSI_COLOR="1;31"
C:\Cmder
wsl -l -v
  NAME                   STATE           VERSION
* kali-linux             Running         2
  docker-desktop-data    Stopped         2
  docker-desktop         Stopped         2

For me, it was not only freezes with PHPStorm but also other issues like menus not staying open and having to keep the mouse pressed down and then move to a submenu item and release it, and some other random issues. I switched back to WSLD+VcXsrv and that has been working perfectly fine.

WSLG is also freezing for me from time to time, mostly using JetBrains’s PhpStorm, but when it freezes, it is all WSLG apps and not only JetBrain (e.g. Files as well). Also gcore [weston pid] hangs with no output.

+1 facing the same issue on Win11 while running Firefox

I’m seeing this in VS Code also. Usually my menus stop working first (top bar menus and right click menus), but eventually things will just completely freeze up.

I am having this same issue with Firefox on WSL on Windows 11