-
Notifications
You must be signed in to change notification settings - Fork 821
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
Can't open display: :0 after enabling systemd #8899
Comments
See responses to #8888. |
i did most of that and it didn't fix the problem |
did it and it seems to have killed the gnome apps (the only ones that worked) |
please read the above, i've tried multiple solutions, using external software (like bottle-imp), and nothing worked. i'm using a new version of ubuntu (specifically the preview one/kinetic kudu) and the same seems to happen |
...this would have been good to know right at the start, because if any X apps worked at all, such as the Gnome ones, then we've been trying to solve the wrong problem all along (if the X socket were missing, Gnome apps should also fail with "can't open display"), and the #8888 solutions don't apply. So the first step in figuring this out would be to undo all the things done in attempting to solve that problem, so we can get a good look at this one. (Starting with the outputs of |
reverted the mount bind thing and nautilus revived, so that's a good sign. output of the first command was:
second command gave: output of the last one was: so, anything wrong in here? |
Okay, well that tells me a few things. First up, it looks like your Gnome apps are using Wayland, 'cause the X11 config is definitely broken ( Let's check if the WSLg X socket is being properly created. If you
Does it? |
not exactly, this popped up |
Huh. Well, that's very strange and unfortunately nothing I've seen before. WSLg should be creating the X socket in that location automatically. There's not a lot I can do to diagnose this one further, but I suggest you open an issue over at the WSLg repository: https://github.com/microsoft/wslg ...because it's probably their issue. I see there are a couple of similar ones (like microsoft/wslg#838 and microsoft/wslg#844 ) there already, so hopefully it's already on their radar. |
just did, however... the issues that have been submitted don't really fix my problem |
Apologize for jumping in (and could not help :)). Interestingly enough, while I also encounter blank However, chromium and firefox cannot be opened, same as this thread. @cerebrate could you confirm this behaviour too? |
@mangkoran You're using emacs-daemon via a user systemd service though, right? In which case it should work fine as long as |
..except it's not 🧐
|
What version of Emacs are you running? It's at least possible - if it's very recent - that it's running as a pure Wayland app. |
28.1 (+pgtk +nativecomp) which is indeed native Wayland. I guess I am mistook this issue since the beginning 😅 |
aaanyways any possible fixes to the gnome gdk thing? |
Hi I am experiencing a similar issue when using WSL 0.67.6.0, while I can use GUI apps perfectly fine on 0.66
total 0
drwxrwxrwx 2 root root 60 Sep 28 13:30 .
drwxrwxrwt 7 root root 280 Sep 28 13:30 ..
srwxrwxrwx 1 rstaudacher rstaudacher 0 Sep 28 13:30 X0 |
I ran into issues with the /tmp/.X11-unix directory being cleaned as systemd started - since wslg creates the socket and it's mapped to the distros, if the distro starts and deletes the socket, then the only way to recreate it is to run wsl --system, and send a hup signal to the weston process, which in my experience is usually 11, so in a elevated powershell window:
Then the X0 socket should show up in the distro. Note, sometimes it's not X0, it could be X1, or X2, so set your DISPLAY variable accordingly. Also, you might need to run:
otherwise some gnome apps might stall at startup. |
For a quick sanity check, $ dmesg | grep "WSL (1): systemd"
[ 142.347132] WSL (1): systemd: /usr/lib/tmpfiles.d/tmp.conf is disabled
[ 142.347148] WSL (1): systemd: /usr/lib/tmpfiles.d/x11.conf is disabled If not then probably that is why |
@c4artisan maybe then we need to check if Xwayland is even running or not.
wslg [ /mnt/c/Users/tushar ]$ ps x
PID TTY STAT TIME COMMAND
10 ? Sl 0:00 /usr/bin/weston --backend=rdp-backend.so --modules=wslgd-notify.so --xwayland --log=/mnt/w
13 ? Ss 0:00 /usr/libexec/weston-rdprail-shell
15 ? Ss 0:00 /usr/bin/Xwayland :0 -rootless -core -listen 38 -wm 39 -terminate -nolisten local -ac
25 pts/0 Ss 0:00 -bash
68 ? S 0:00 /init /mnt/c/Users/tushar/AppData/Local/Microsoft/WindowsApps/MicrosoftCorporationII.Windo
70 ? Sl 0:00 /usr/bin/pulseaudio --log-target=file:/mnt/wslg/pulseaudio.log --load=module-rdp-sink sink
74 ? Ss 0:00 /usr/bin/dbus-daemon --syslog --fork --print-pid 12 --print-address 15 --session
101 pts/0 R+ 0:00 ps x Also within the system distro check if wslg [ /mnt/c/Users/tushar ]$ ls -al /tmp/.X11-unix
total 0
drwxrwxrwx 2 root root 60 Sep 28 20:42 .
drwxrwxrwt 1 root root 80 Sep 28 20:42 ..
srwxrwxrwx 1 wslg wslg 0 Sep 28 20:42 X0 |
|
OK NOW WHAT |
xeyes works ? If yes then that's great. |
no, for some reason the display variable died but the wayland apps (gnome) came back |
Can you try with 0.68.2 and see if this still is an issue? |
so far the preview one has been great so i think it's time to finally close this |
well rebooting the distro killed it |
|
okay fine |
I'm on Ubuntu 20.04.5 LTS. Same issue. |
|
Thanks. I'll try it later. |
On both Ubuntu-Preview and Kali-Linux, x11-apps worked fine until a desktop environment was installed. |
that's probably it because i installed gnome |
|
so far avoiding the x11 packages provided by gnome have made a fresh new preview distro run great
please open an issue related to this so maybe this emtire thing can be fixed |
trying to avoid anything related to wayland or x11 |
However, my experience wirh Wslg, is its premature stage. Nautilus and Gdebi behave strange when click back and fort in files choosing dialog. Sometimes the dialog occupies multiple screens, and becomes uncontrollable. |
|
22.04 had a miracle |
however audio is dead with systemd on but that isn't a priority as of now |
after upgrading my packages now nautilus is using x11? |
installing wayland-protocols magically fixed it? i have no idea of what is going on right now |
gdk issues are back |
The issue is back with wsl 1.0.1 on my machine. :( |
|
THANKS! I'm using windows10 and updated wsl to the store version recently. when enabling the This works for me. I've saw the original |
issue is gone with the latest update |
Version
10.0.22622.601
WSL Version
Kernel Version
5.15.62.1
Distro Version
Ubuntu 22.04 (jammy)
Other Software
Google Chrome
Firefox Browser
X11-Apps
Repro Steps
enable systemd on the distro, try to run an x11 app (example: the x11-apps, google chrome, firefox, etc)
Expected Behavior
the app opens with no problem
Actual Behavior
the terminal outputs "Error: Can't open display: :0"
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: