Skip to content
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

X11 display socket gone ("Error: Can't open display: :0") #342

Open
dindon-sournois opened this issue Jan 10, 2024 · 4 comments
Open

X11 display socket gone ("Error: Can't open display: :0") #342

dindon-sournois opened this issue Jan 10, 2024 · 4 comments

Comments

@dindon-sournois
Copy link

dindon-sournois commented Jan 10, 2024

Describe the issue
No X11 display socket

To Reproduce
Boot the vm, start xeyes

Expected behavior
xeyes opens

Screenshots

$ xeyes
Error: Can't open display: :0
$ ls -la /tmp/.X11-unix
total 0
drwxrwxrwt 2 root root  40 Jan 10 15:34 .
drwxrwxrwt 8 root root 160 Jan 10 15:34 ..
$ sudo rm -r /tmp/.X11-unix
[sudo] password for dindon:
rm: remove directory '/tmp/.X11-unix'? y
$ ln -s /mnt/wslg/.X11-unix /tmp/.X11-unix

image

Enviroment:

  • Windows build number: 10.0.19045.3803
  • WSL version 1/2: 2
  • ArchWSL version 22.10.16.0
  • ArchWSL Installer type zip
  • Launcher version 22020900

Additional context
Somehow the X11 display broke recently without me figuring out exactly when/how. I could reproduce from a clean ArchWSL (zip) installation followed by a pacman update. Looking at wslg troubleshot page I can see it's a X11 display socket issue. I was able to fix this issue, and make it persistent with a config file in /etc/tmpfiles.d.
Any idea if there are better solutions or why this is necessary in the first place?

@jiaqi228
Copy link

I was able to fix this issue, and make it persistent with a microsoft/wslg#43 (comment).

I am faced this problem too, and after researching, I think it is the best resolution at present.

@yslib
Copy link

yslib commented Jan 20, 2024

I have the same problem. It helps me a lot. Thanks. But without this solution, it acts more weird in my WSL. This will cause SDL_Init stucked and never return, and some programs stucks when they run, including glxinfo and glxgears. But some apps like gedit don't.

@eduardo-hyodo
Copy link

I was getting a similiar problem. I tried to start firefox.

and got the following error:
image

not so easy to search for the error, the firefox worked on a ubuntu image. So I assume the problem is only on the Arch image. I don't know if some new update on Arch broke the use of wslg.

I tried the fix comment by @jiaqi228 and it worked for now.

@mx
Copy link

mx commented Mar 9, 2024

Some Arch update must have broken this; same issue here, same solution (create the symlink, or have systemd create the symlink with tmpfiles.d, or have systemd proxy the socket...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants