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

cannot use WSLg and another X server *at the same time* with *different* DISPLAYs #927

Open
esumii opened this issue Dec 13, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@esumii
Copy link

esumii commented Dec 13, 2022

Windows build number:

Microsoft Windows [Version 10.0.19045.2311]

Your Distribution version:

Debian 10.13

Your WSL versions:

>wsl --version
WSL バージョン: 1.0.3.0
カーネル バージョン: 5.15.79.1
WSLg バージョン: 1.0.47
MSRDC バージョン: 1.2.3575
Direct3D バージョン: 1.606.4
DXCore バージョン: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windowsバージョン: 10.0.19045.2311

Steps to reproduce:

  1. Start Ubuntu or Debian on WSL2
  2. Start any X server proxy (such as https://github.com/nbdd0121/wsld , just for example) on a different DISPLAY such as :10 (not :0)

WSL logs:

pulseaudio.log
weston.log
stderr.log

WSL dumps:

None

Expected behavior:

The X server proxy should start with no error.

Actual behavior:

$ wsld
Failed to listen: Read-only file system (os error 30)
$ cat .wsld.toml
[x11]
display = 10
force = true
$ ls -al /tmp/.X11-unix/
total 12
drwxrwxrwx   2 root  root     60 Dec 13 15:23 .
drwxrwxrwt 189 root  root  12288 Dec 13 15:25 ..
srwxrwxrwx   1 sumii sumii     0 Dec 13 15:23 X0
$ touch /tmp/.X11-unix/X10
touch: cannot touch '/tmp/.X11-unix/X10': Read-only file system

This is because WSLg hijacks the entire directory /tmp/.X11-unix/ and does not allow to create a different socket like /tmp/.X11-unix/X10 .

A possible fix would be a symlink from only /tmp/.X11-unix/X0 to /mnt/wslg/.X11-unix/X0 instead of "hijacking" the entire directory.

@esumii esumii added the bug Something isn't working label Dec 13, 2022
@esumii esumii changed the title cannot use WSLg and another X server *at the same time* with *different* DISPLAY screens cannot use WSLg and another X server *at the same time* with *different* DISPLAYs Dec 13, 2022
@elsaco
Copy link

elsaco commented Dec 13, 2022

@esumii if you remount /tmp/.X11-unix with rw option then it works. This issue is being tracked by microsoft/WSL#9303

@esumii
Copy link
Author

esumii commented Dec 13, 2022

Thanks, but hijacking such a common directory is in general a bad idea. Symlink would be better.

sudo umount /tmp/.X11-unix
ln -sf /mnt/wslg/.X11-unix/X0 /tmp/.X11-unix/

@hideyukn88
Copy link
Member

@esumii, we have previously implemented as symlink, but to support systemd, it settled the way it is, including make it read-only from non-system distro. The best solution for using non-WSLg X server, at this point, is to disable WSLg. But we keep looking for possible solution further, thanks!

@esumii
Copy link
Author

esumii commented Dec 16, 2022

Thanks but at least I need to use multiple X servers at the same time (for my class at the university, where students use various X servers).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants