-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot launch gui apps with 2.0.12 #1156
Comments
Have had a similar problem with GUI applications after updating to WSL 2.0.12.0:
Fixed by running the following commands:
and GUI applications were working again. Not sure if this survives a WSL virtual machine reboot. This solution was found here: #558 (comment) |
Unfortunately, that didn't work. :-( |
I confirm also here same behaviour. |
Ok, I see. The "does not survive reboot" did not click when I first tried this. Thanks |
Disabling systemd in /etc/wsl.conf is a permanent workaround, but not an option for me |
This issue was moved over from WSL but I'm wonder if that was appropriate. If I'm not mistaken, the WSLg version has not changed since March so it looks like this issue was introduced in WSL not WSLg. I'm wondering if microsoft/WSL#10818 is the cause as that looks related. |
Does your system have a |
I'm using Arch Linux and have the same issue. I created a fix for this that runs those commands as a systemd service (iirc Fedora comes with systemd as well, but regardless of your distro, as long as it uses systemd, it should work). This means that the service will run those commands on boot. This is under the assumption that running those commands does not lead to any unforeseen side effects (I haven't seen any so far, from my understanding, those commands are fine to run...). 1. Creating the systemd service fileStart by creating a systemd service file at the following location, sudo nano /etc/systemd/system/x11-symlink.service Note: 2. Write the scripts for the serviceTo preface this part, I personally never had anything mounted on In the service file, add the following contents to it:
If you do not need to run the Now you can save and exit the file. 3. Enable the serviceTo enable the service, we first need to reload systemd to recognize the new service:
Then we can enable the service on boot:
Note: the name of the service would be the name of the file you created earlier, make sure this matches. At this point, you can restart WSL and verify if the service worked by running:
If you want to manually start the service without having to restart WSL, you can run the following directly:
To verify that it did work, run Hope this helps, lmk if you need extra clarification. |
Yes, it does. Interestingly, the file has a note:
I'm still running 2.0.9 so I don't know if it's still there in later versions. @rahu, I've thought about doing something similar though I hadn't considered doing it with systemd. What's interesting is that it seems that the solution to the problem is to do exactly what /run/tmpfiles.d/x11.conf is preventing (sort of, anyway). 😕 |
It seems that with 2.0.15, /run/tmpfiles.d/x11.conf is not created. Maybe that's the root cause of this problem? |
It definitely feels like the issue you referenced, microsoft/WSL#10818, is related. The fix for that issue, which should disable the above mentioned override file (and possibly further logic) for guiApplications=false actually disabled it unconditionally. It's a shame that wsl part doesn't appear to be open source, so we're forced to poke the Devs through GitHub issues. And if this type of problem goes unnoticed, I get the feeling there's not much automated integration testing involved in the release process. Does the issue go away on 2.0.15 if you create an empty /etc/tmpfiles.d/x11.conf ? (Which would simply add the override manually instead of thorough wsl) |
Unfortunately, the issue doesn't go away after adding an empty /etc/tmpfiles.d/x11.conf. Maybe this issue would get more attention if it were in wsl/issues where I originally opened it. As I mentioned previously, the only changes when this issue appeared were to wsl not wslg. |
Pretty sure this issue is related to WSL 2.0.12.0 release, maybe it's a regression of the fix of microsoft/WSL#10818, could you please move the issue back to microsoft/WSL? @OneBlue |
Not fixed in 2.1.1.0 + 1.0.60.
|
same here |
I did try to raise the visibility of this issue by reporting it again in the WSL repo (microsoft/WSL#11064) but the ticket got closed because it didn't have "steps to reproduce" even though I pointed to this ticket. :-( |
Still there with 2.1.3.0 |
Is there a specific reason that wslg doesn't seem to honor the Specifically, |
Same here. |
It's not obviously distro-related as I am using Fedora. |
I'm going to repeat what I said earlier, this issue should be moved back to WSL where I originally created it, given that the problem was introduced with a WSL release that did not include any WSLg changes. |
I just updated another computer from 2.0.9 to 2.1.3, with Ubuntu 22.04... and it works without any workaround! I agree with your last post. I had the same behaviour starting from a specific WSL release that did not include WSLg changes, so it must be something in wsl, or a default configuration changed |
Obviously those are 'virtual' file; both path are mounted: I will compare this with the other non-working installation, with Arch |
Still there with 2.1.4.0 |
It seems that this problem has not been fixed in the latest version, but the systemctl method is very effective, thank you🙏 |
same issue on my side
|
Still there wsl.exe version 2.1.5.0 |
I had the same issue whenever i open any application, but i found a fix and wanted to share it. If like me you are using Arch Linux (may work on other distros that have the same problem) i found that the wayland socket isn't symlinked automatically, and combined with @rahulshamkuwar's solution, the problem does not occur anymore. $ firefox
[656] Wayland Proxy [0x7feae4075450] Error: CheckWaylandDisplay(): Failed to connect to Wayland display '/run/user/1000//wayland-0' error: No such file or directory
Error: we don't have any display, WAYLAND_DISPLAY='wayland-0' DISPLAY=':0' To fix this, add the following lines to your $ cat ~/.profile
if [[ ! -e "${XDG_RUNTIME_DIR}/wayland-0" ]]; then
ln --symbolic /mnt/wslg/runtime-dir/wayland-0 "${XDG_RUNTIME_DIR}"/wayland-0
ln --symbolic /mnt/wslg/runtime-dir/wayland-0.lock "${XDG_RUNTIME_DIR}"/wayland-0.lock
fi Again, if this does not work, give @rahulshamkuwar's solution a try, that fixed some other GUI programs not opening for me. |
Here's what's going on for at least some of the cases, when you are running
A simple workaround then is to disable the mount of the tmpfs on A nicer solution from the WSL end would be when microsoft/WSL#8908 was what guided me to understanding what was going on and is making a similar if not identical suggestion... |
Totally agree on this one. I really wish the developers could have a closer look at this soon! |
After almost two years, I've pretty much given up any hope that this issue will be resolved. |
yeah, this seems to be the origin of my several recent cases... Since disabling systemd is not favorable for me, the only workaround would be manually creating symlinks for /tmp/.X11-unix. BTW, Ubuntu wsl seems not to have some issues with this, did they have some special tweaks? |
I see this behavior on Ubuntu 24.04, with some gui apps taking 10-20 secs to launch (if ever, sometimes I have to launch a second time). |
@wang1zhen |
Yes, it worked. Yet I think there is |
Normally, yeah, but I think ms wslg image is taking care of it already. |
The workaround that allows keeping |
A better workaround in this comment (configure the existing tmp.mount service rather than creating a new one) |
Oddly I can run firefox but not code-oss or xclock.
Wonder if systemd+wslg will ever work without manual workarounds. |
All my KDE apps are now failing, if systemd is enabled I can get it to work, but I can no longer access btrfs mounted drives through Windows, not an acceptable trade-off. EDIT: I ended up having to use systemd with automount. Automount honors my btrfs drive but WSLg does not honor automount, so a manual |
@jsberg-bnl In my case the wsl creates another Here's my result of
In short, But what gui apps need is Thus applications cannot access display. Of course, regenerating symlink would work in my case. But I figure there might be other things causing the situation besides what you have mentioned. Have you checked the contents of To be clear I'm not a professional on linux but a user that just wants gui apps to work. So I cannot find out exactly why this happened, plz don't blame me for that. |
Windows Version
11
WSL Version
2.0.12
Are you using WSL 1 or WSL 2?
Kernel Version
No response
Distro Version
Fedora
Other Software
No response
Repro Steps
I usually launch GUI apps from the windows start menu but after upgrading to 2.0.12, the apps wouldn't start. wsl --list --running showed the distro running for a few seconds and then it shutdown. I am able to start WSL from the command line but when I try to launch a gui app such as konsole, I get this error:
There were no issues with 2.0.11
Expected Behavior
GUI apps start as usual
Actual Behavior
GUI apps cannot be launched
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: