-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
'XOpenDisplay failed' error under WSL2 Ubuntu-22.04 (WSL1 Ubuntu 20.04 works fine) #9373
Comments
Hi @bairog From this link I learned that in the newer version Ubuntu uses Wayland: https://linuxconfig.org/how-to-enable-disable-wayland-on-ubuntu-22-04-desktop We have a PR for supporting this open, see #8352 . Maybe you can try this PR out on your machine? |
Hi @timunie
Do I understand correctly that WSL does not have GUI, so /etc/gdm3/custom.conf doesn't exist, which means that I cannot switch default Wayland back to X11?
I've downloaded that PR but looks like project targets .NET 7.0 RC2. We are prohibited to use prerelease versions of .NET SDKs in our company - so I will try again tomorrow evening when Visual Studio 2022 17.4.0 and .NET 7.0 will be released :) |
Sorry, that's beyond my knowledge. |
Missing X11 display is an issue with WSL (most likely misconfigured) itself, not Avalonia |
@kekekeks and @timunie Other GUI apps work on WSL with Ubuntu 22.04. I filed an issue on microsoft/wsl to report an issue with Git Credential Manager which fails for with this same error. Chrome runs fine. I also reported this issue on Git Credential Manager I just downloaded and tried to run Chronify another Avalonia based app and it fails just like Git Credential Manager. The common thread with this error is that they are both Avalonia based. This was not an issue in WSL 2.1.5 |
@mikelor Avalonia doesn't do anything special, but opens a display connection https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.X11/X11Platform.cs#L57. Something like this should work on properly configured machine. Let's see what WSL response is. |
So, I found the issue. Looks like a change in WSL's networking and DNS Tunneling as described here. export DISPLAY=$(ip route | grep default | awk '{print $3}'):0.0 Thanks for reading. |
@mikelor I'm not using wsl rn, so can't judge on my own. Do you think this change should be on Avalonia side? If so, so may want to provide a PR to help others as well. |
Describe the bug
When I try to run an application create from a template on WSL2 Ubuntu-22.04 it fails with the following error:
WSL1 Ubuntu-20.04 starts correctly.
I have Windows 10 Pro 21H2 and Visual Studio 2022 Pro 17.3.6. My WSL distros:
My launchSettings.json:
I use "commandName": "WSL" not "WSL2" as MS article states that:
I use vcXsrv (an X11 server for Windows) and start it in "Multiple windows" mode and then "no client" mode.
Desktop (please complete the following information):
Additional context
Reproduced only under WSL2, works fine on WSL1 and normal Ubuntu.
The text was updated successfully, but these errors were encountered: