-
Notifications
You must be signed in to change notification settings - Fork 318
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
wslg: Can't open display: :0 + X11 server is not running #558
Comments
Hello @tys203831. It looks like your DISPLAY environment variable is incorrectly set... it should be set to |
@spronovo I have tried reinstalling wslg and also uninstall vcxsrv server of my machine. However, it still have same error "Error: Can't open display: :0". Below is my .bashrc file:
WSL logs:
|
I have a similar issue. It began when I updated the graphics driver on my system as encouraged by https://devblogs.microsoft.com/commandline/wslg-architecture/#hardware-accelerated-opengl. Details as requested on https://github.com/microsoft/wslg/wiki/Diagnosing-%22cannot-open-display%22-type-issues-with-WSLg#still-having-a-problem, starting a fresh launch of the container:
OK, great, we see the socket is present. Now, let's watch
The socket is gone. I see the same "xserver crashing too fast" warning in @tys203831's report above. I see they also have a lower-end CPU -- mine is a Ignoring X for a moment, let's turn to Wayland. Some Wayland applications launch OK, such as weston-flower. But any application that attempts to use GL fails:
Inspecting with GDB, it's crashing inside the Intel graphics driver:
If I force software rendering with I am unsure whether |
Yes, this works around the problem.
I am reliably informed that it is indeed provided by Intel, and is their Windows DirectX driver recompiled for Linux. I wonder if it does some CPU detection on Windows that is not supported on Linux? Perhaps I should be reporting this to Intel, but I don't know where. The WSLg team may have better contacts for this kind of thing. |
Not sure if it helps anyone, but I had similar issue where wayland application (e.g. gedit) works but X11 application (e.g. xclock/xcalc/firefox/gimp) does not work. It turns out that if you used your Linux distro before with VcXserv, even after uninstall it, it left something in your Linux distro's /tmp/.X11-unix folder. The trick is to simply remove this folder, and create a symbolic link to /mnt/wslg/.X11-unix, and everything work now for me.
|
My $Display wasn't set properly after setting up a fresh WSL Ubuntu container and installing some apps / updates. Is WSLg packaged seperately from WSL or something? I can't find evidence of WSLg even existing following https://github.com/microsoft/wslg/wiki/Diagnosing-%22cannot-open-display%22-type-issues-with-WSLg#still-having-a-problem on windows 11, 22000.493 |
I ran into the exact same issue with X11 apps. This resolved it for me. Thanks @yanghao! |
none of this helped. I had this working before until ubuntu reinstall. I get no windowed app displaying. I had chrome launch but wont maximize. Neither will Qemu. I see circular references with no socket in here. This is a fresh install on Windows 11
|
For anyone who stumbled upon this issue and the above comments didn't help, what worked for me is realizing that I was still manually setting |
I also got this error too. However, my use case is by launching VersionWindows version: 10.0.22000.593 WSL Version
Kernel Version5.10.102.1 Distro VersionArchWSL Other SoftwareEmacs 29.0.50 (master branch) Repro StepsExpected BehaviorGUI apps (in my case Actual BehaviorGUI apps cannot open. In my case (
Diagnostic LogsNote:
|
In case any body couldn't find the solution from any of the above (because none did for me)... I had a Edit: Re-reading the title, I wanted to clarify, my solution did not fix the "Can't open display" error in the title. This fixed the error where calling an X app "started" but it went to a hang state and nothing happened. |
This in combination with this article https://bobcares.com/blog/dbus-launch-terminated-abnormally/ solved it for me |
I have exactly the same issue. Just my CPU is N5105.
|
And does |
I have a fresh install of win11 22h2, presumably the guaranteed to work starting point case, and for setup of wslg[ui] apps support i used the currently recommended I then rebooted and opened wslg using the From there i did a Based on some other search hits i also tried running My I thought at this point in the game that a clean install wslg on a fresh repave of win11 21h2 and/or the very soon to be released win11 22h2 would support launching of gui apps with no special investigations and fixes required. Am i overlooking some secret sauce or have i somehow installed a standard issue desktop app or made an OS configuration setting that creates a problem? |
(if docker desktop is running, close that first)
then open windows command prompt and restart WSL |
in my case I saw the issue: Can't open display: :0 PS C:\WINDOWS\system32> wsl --version |
After 2 days of working fine, the /tmp/.X11-unix folder is once again no longer a symlink, instead it's once again a freshly created folder. (docker also uses it, maybe it's race conditions?) Probably has something to do with linux cleaning tmp files on restart as the internet says
|
In my case I was able to fix it by adding |
Share all the steps I follow for working after update with systemd and tempfiles.d |
In my case, I am running 2 separate WSL2 distros. One of them worked fine, and the other was showing the errors mentioned here. It seems the display address for the 2nd WSL distro is actually ":1", not ":0". To know for sure, I used
X1 refers to ":1", so I simply set the DISPLAY variable to that.
And it works fine now! |
...
I am having this (or very similar) issue. WSLg used to work. I can't say if it stopped today or a week ago as I didn't use it for a while, and I did have an update of both Windows and drivers in meantime. I also had a bluescreen from Thing is that if I start WSL and look for socket immediately, it's there. Sometimes I don't have much in this WSL, so I will try to remove it completely and install from scratch, as all other suggestions failed. |
I think I have found the issue with my setup. Well, part of it. I've opted to just not use this app, it was just for fun/test anyway, and if it breaks WSLg then it's on my blacklist. Now, since this same dependancy could'vebeen pulled by any of apps people used in this thread, perhaps it's doable to cross-reference all the apps and dependencies to hunt it down. But I'll leave that to someone more interested in WSLg. Edit: To clarify, I did reinstall again, and kept playing with Ubuntu and WSLg, all fine.. then this app, WSL shutdown, WSL start and - error. |
Worked fine with no issues for me on Ubuntu 22.04.1 LTS, installed the package, closed terminal, opened again and GUI apps still work. Even tried running wsl --shutdown to see if that would cause it and after linux booted back up GUI apps still work |
I had the same issue and fixed it by installing Intel Driver and Support Assistant. It installed an updated graphics driver and all is now working. https://www.intel.com/content/www/us/en/support/intel-driver-support-assistant.html |
Environment
Steps to reproduce
Problem 1: Can't open display: :0
wsl --update
in windows terminal) and before that make sure "Virtual Machine Platform", "Windows Hypervisor Platform" and "Windows Subsystem for Linux" are turned on in Windows Features.sudo apt update && sudo apt upgrade
in wsl terminalwsl xeyes
. (Note: when I runxeyes
on wsl terminal, it just hangs for a long time and not show up any app)Result: Error: Can't open display: :0
Problem 2: X11-server is not running
ls /tmp/.X11-unix
Result: show no results, and thus suspect X11-server not running.
WSL logs:
Attach WSLg logs from
/mnt/wslg
You can access the wslg logs using explorer at:
\\wsl$\<Distro-Name>\mnt\wslg
(e.g.:\\wsl$\Ubuntu-20.04\mnt\wslg
)pulseaudio.log
pulseaudio.log
weston.log
weston.log
versions.txt
versions.txt
Other logs info:
Expected behavior
GUI running without need of other third-party X11-servers such as Vcxsrv.
Actual behavior
Error: Can't open display: :0. Still needs Vcxsrv to open linux gui apps.
The text was updated successfully, but these errors were encountered: