-
Notifications
You must be signed in to change notification settings - Fork 304
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 run Linux GUI apps in windows: Error: cannot open display: :0 #880
Comments
Check this troubleshooting: https://github.com/microsoft/wslg/wiki/Diagnosing-%22cannot-open-display%22-type-issues-with-WSLg |
That's how I wound up here. 😁 I will say that /tmp/.X11-unix appears to be a hard link and not a soft link. It does not contain X0 either. If I am running Win-KeX, it will show X1.
|
So #844 appears to be an issue with running multiple distros and systemd. I am running systemd, but only one distro. Plus, it is said to be resolved by a WSL update. I am running the latest version of WSL. #853 suggests disabling my display device which I am not going to attempt. Do you happen to know how to install a second instance of Kali? It looks like I need a tar ball, but I don't see one offered by Kali. |
Ok. I disabled systemd and that was the problem. The lastest WSL did not resolve that issue for me. |
To install another instance you need to |
I upgraded to Windows 11 today and when I activated systemd in wsl ubuntu 20.04 it broke wslg giving an error of cant connect to display:0 and when I disabled it again in my /etc/wsl.conf it worked again. It's been a long day of testing all this as I come from a Linux background and haven't looked at windows in years. I will post my setup details in the morning. Thanks to all the many posts I patiently trawled to come to my conclusion 11 hours into my upgrade lol. |
@jimthedj65 test with this version: https://github.com/microsoft/WSL/releases/tag/0.70.8 |
thanks for the response, I ran the install for 0.70.8 and activated systemd and a slight improvement. Nvidia-smi is recognised error when running a X session WSL version: 0.70.8.0 cat /mnt/wslg/versions.txt echo $DISPLAY ls -la /tmp/.X11-unix Again when I disable systemd in wsl.conf it works again Ubuntu 22.04 hope it helps |
result after deactivating systemd isan X sessions starts again. |
I noticed that inxi -G was showing that I had no renderer installed and decided to rebuild my 21.04 and its now running chrome with hardware acceleration and no longer broken. Looks like a few rabbit holes with X breaking here and there. OpenGL: renderer: D3D12 (NVIDIA GeForce RTX 3080 Ti) v: 3.3 Mesa 21.2.6 Happy Days |
What did you rebuild? The kernel? mesa? |
No improvement for me with 0.70.8. |
Hi crramirez, I scrubbed everything and went into the Microsoft store and downloaded the Ubuntu 20.04 (removing all other versions) and then carefully looked at all the communication out there between Nvidia, Ubuntu, Microsoft and realised there are a number of conflicts. I think previously I had installed the Nvidia drivers as I wasn't getting the nvidia-smi, then realised on the rebuild that nvidia-smi lived in /usr/lib/wsl/lib etc The only issue I now have is google-chrome build is inconsistently picking up hardware acceleration and then defaulting back to software acceleration through chrome://gpu . I think this is a misreport leading to a false - positive and it is actually running (I do get an error output on the screen WARNING: lavapipe is not a conformant vulkan implementation, testing use only.) as my renderer reports ok and glxgears runs fine as well as other apps like audio and 4k youtube playback. I am trying to figure out now if I can get vurtualgl to run and force hardware rendering on glxgears though vglrun glxgears etc. hope it helps, I think most of the issues with X and wslg are misunderstandings on what to build and in what sequence. Does virtualgl run under WSL ? |
I have this very predictable now, systemd in wsl.conf definitely breaks wslg and when turning off, allows the renderer to come back again and allows the the X0 to be created. Also thankfully I have google-chrome more stable, most of it was solved by installing from the store and using windows terminal instead of powershell, powershell breaks very easily with paths and so on. I hope it helps someone to know that it is definitely bleeding edge all of this, so much conflicting information about the sequence of events of what to install and how, very easy to break stuff. I still have issues runner docker ML and cuda samples but in general its all working for apps and X11 apps. I have upgraded to latest Nvidia drivers 526.86 Inxi -G reports
Chrome://gpu reports |
On the subject of Cuda when running latest ubuntu 22.04 and followng the standard nvidia instructions [https://docs.nvidia.com/cuda/wsl-user-guide/index.html] Dockerd runs as in the background (daemon) NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled. Error: only 0 Devices available, 1 requested. Exiting. Dameon reports when sunning hashcat docker hashcat -b Benchmarking uses hand-optimized kernel code by default. cuInit(): no CUDA-capable device is detected clGetPlatformIDs(): CL_PLATFORM_NOT_FOUND_KHR ATTENTION! No OpenCL, HIP or CUDA compatible platform found. You are probably missing the OpenCL, CUDA or HIP runtime installation.
Started: Sun Nov 13 22:45:02 2022 nvidia-smi runs fine root@eb5bc0c0d375:~# nvidia-smi +-----------------------------------------------------------------------------+ deviceQuery from the samples runs fine ./deviceQuery Starting... CUDA Device Query (Runtime API) version (CUDART static linking) Detected 1 CUDA Capable device(s) Device 0: "NVIDIA GeForce RTX 3080 Ti" deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 12.0, CUDA Runtime Version = 11.8, NumDevs = 1 |
Currently we are investigating X socket doesn't present when systemd is enabled, it is not happening every environment, such as specific distro, but we do observe in various situation, so as workaround, please try workaround mentioneed at microsoft/WSL#9158, or disable systemd if possible. If you are experiencing this issue without systemd enabled (and make sure on the latest WSL 1.0.0.0), please let us know, thanks! |
I updated to WSL 1.0. Enabled systemd. Ran the following commands:
This has not resolved my issue. I cannot open Firefox or Wireshark. However, I can open mousepad and mate-calc. |
Thanks, I can open xeyes and other apps, but can't open Firefox installed via snap, but can open Firefox downloaded from AppImage looks like I can't open any app installed with snap |
If you are seeing X11 socket connection issue on Ubuntu, with systemd enabled, please check if gdm service is installed and running by |
@hideyukn88 this means that it should or should not be installed and running? |
@crramirez, gdm.service is automatically installed when certain GNOME software is installed, and currently we are thinking this is conflicting with WSLg. Thus, if the service is running, please disable it by |
Fixed my X0 problem! Thank you. Sent from my iPhoneOn Nov 18, 2022, at 11:56 AM, Hideyuki Nagase ***@***.***> wrote:
@crramirez, gdm.service is automatically installed when certain GNOME software is installed, and currently we are thinking this is conflicting with WSLg. Thus, if the service is running, please disable it by sudo systemctl disable gdm.service, then restart WSL. This should restore X connection by WSLg, thanks!
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Just a note that this worked for me. |
Im having similar problem when i do |
Problem has been resolved with the latest WSL upgrade. I have enabled systemd and all appears to be functioning. WSL version: 1.0.3.0 |
I also solved it the same way |
Windows build number:
Microsoft Windows [Version 10.0.22621.674]
Your Distribution version:
Kali Release: 2022.3
Your WSL versions:
WSL version: 0.70.4.0
Kernel version: 5.15.68.1
WSLg version: 1.0.45
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.674
Steps to reproduce:
Attempt to run a GUI app from WSL.
WSL logs:
pulseaudio.log
stderr.log
weston.log
WSL dumps:
No response
Expected behavior:
I expected GUI apps to open in Windows.
Actual behavior:
It didn't open. Received:
Error: cannot open display: :0
The text was updated successfully, but these errors were encountered: