yuk7 / ArchWSL

ArchLinux based WSL Distribution. Supports multiple install.

Home Page:https://git.io/archwsl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

dindon-sournois opened this issue · comments

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?

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.

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.

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.

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...).