-
Notifications
You must be signed in to change notification settings - Fork 823
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
/tmp/.X11-unix is being mounted read-only #9303
Comments
See here for a comment on how and why this was broken. Overwriting and overriding the system is not a very good approach. A more standard approach to running guest distributions in a virtualized or containerized environment may result in much less maintenance, fewer compatibility issues, and fewer regressions. |
Can be reproduced by installing the This should produce a VNC session to the virtualized Kali distro, but it fails to create the connection, as the |
@Mischala to get
After this sockets can be added, sample output:
Notice there are two sockets in
|
Similar to @elsaco's advice above, I worked around this issue by adding:
To the systemd service unit for the secondary X server I am launching. |
Thank you for reporting this @AndASM. Unfortunately with this kind of issue it's pretty much impossible to have a 100% perfect solution. This directory is mounted read-only by default to prevent systemd-units (like gdm for instance) from deleting the 'X0' socket, which would break wslg. Given that a secondary X server is an advanced scenario, the officially recommended way of doing this would be what you suggested: remounting |
Hijacking such a common directory in its entirety is not a good idea - how about a symlink?
|
@OneBlue, this issue seems to effect a number of users and not be resolved. Would you please re-open it for discussion and evaluation?
So, is WSL an environment or a distribution? Isn't this problem caused by the hybrid approach? The systemd units are breaking it, because WSL is overwriting system files and settings in a more malware-like way. It is monkey-patching the system. It would be easier to use the built-in extension points instead of monkey-patching system files and configuration! Plus it would be more secure. It's hard to use any kind of system file protection or validation with WSL2, when at any time a patch could be released where WSL will monkey-patch the guest system in arbitrary and non-standard ways! Since WSL2 can, to a degree, control the host system, isn't that creating a large surface area for security problems?? By changing how standard system extension points like the Instead, would it not be better for WSL2 to provide documented interfaces, services, and/or drivers? Similar to guest tools and packages like are provided for other virualizers? It is after all a set of extensions and wrapper tools for Hyper-V. If we had services and extension points, we could create normal system packages for each distribution. These could properly configure the distributions, instead of applying arbitrary non-standard monkey-patches. That approach would also allow non-FHS distributions (like NixOS) to more easily integrate, since the folders and mount points WSL2 is using may not exist. So arbitrarily assuming and writing to them would at best not work, and in worse cases possibly do damage. In my own Ubuntu install, I have been having better luck writing packages that first remove and clean up all changes made by WSL's invasive init system, then re-applying them through the standard interfaces. Suddenly everything just works, the first time.. until some new monkey-patch is added that has to be undone, like making a standard read-write system folder read-only. |
Good idea! You could also bind-mount a file like a socket, which might be more robust against other changes like /mnt/WSL being moved, unavailable, or unmounted. Using one of those approaches, one could make an ugly workaround. A simple daemon could be made that monitors |
Another case against this: For an example of a tool that that uses remote or containerized development, see Microsoft's Visual Studio Code. It doesn't use the X protocol. But plugins and add-on tools might use it to display graphical elements from within the development containers. See Microsoft's Development Containers open specification and Microsoft's cli reference implementation. |
@elsaco Thanks, it works |
i tryed that but i receive the massage " -o: command not found" |
I have to write the command all the time i use kex |
@elsaco thx so much it really helped out, just ran the commands and kex --win -s worked perfectly |
Also helped me with the missing Xwayland X1 socket (it wasn't created anywhere) when starting Xwayland :1 for Gnome desktop. With this setup you can run Gnome desktop 40.4 in Rocky Linux 9 instance in WSL 2: |
Version
WSL version: 1.0.3.0
WSL Version
Kernel Version
5.15.79.1-microsoft-standard-WSL2
Distro Version
Ubuntu 22.10
Other Software
systemd 251 (251.4-1ubuntu7)
Repro Steps
Run any kind of secondary X11 server. You get an error that
/tmp/.X11-unix
is a read-only filesystem.Expected Behavior
Secondary X servers should work.
/tmp/.X11-unix
should not be read-only.Actual Behavior
E bind(5, {AF=1 "/tmp/.X11-unix/X1"}, 19): Read-only file system
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: