You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't open display: :0 after enabling systemd #8899
...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 ls -la /tmp/.X11-unix, env, and ls -la /mnt/wslg/runtime-dir, I think.)
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 (/tmp/.X11-unix is empty). DISPLAY environment variable is there, though, so that's okay.
Let's check if the WSLg X socket is being properly created. If you ls -la /mnt/wslg/.X11-unix, it should come back to you with (your date and username will vary)
...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.
mangkoran (@mangkoran) You're using emacs-daemon via a user systemd service though, right? In which case it should work fine as long as systemctl --user show-environment has DISPLAY and can pass it on to the emacs service.
On both Ubuntu-Preview and Kali-Linux, x11-apps worked fine until a desktop environment was installed.
WSL version: 1.0.0.0
Installing the standard gnome desktop environment on a WSL distribution with systemd built in is a separate issue, which is very different from the process of installing a GUI application via snapcraft.io after opening systemd.
You should bring the reproduction steps to open the new issue.
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.
The issue is back with wsl 1.0.1 on my machine. :(
Can you open a new issue showing as complete steps to reproduce as possible? The steps to reproduce the current issue seem to include many versions, but my Ubuntu WSL 22.04 works fine with WSL 1.0.1.
Hello all, I was having this issue too. I was able to fix it after making a new file called /usr/lib/binfmt.d/WSLInterop.conf and writing the contents: :WSLInterop:M::MZ::/init:PF.
This may or may not solve your problem, if the file already exists it won't fix your issue. Worth a try.
THANKS! I'm using windows10 and updated wsl to the store version recently. when enabling the systemd (edit boot section of /etc/wsl.conf), the GUI apps disappears. My /tmp/.X11-unix and env DISPLAY and any more things are all correct.
This works for me.
I've saw the original /usr/lib/binfmt.d/WSLInterop.conf file with content :WSLInterop:M::MZ::/init:F, and when change it with .../init:PF and restart the wsl, then it bring my Emacs back!
Activity
cerebrate commentedon Sep 27, 2022
See responses to #8888.
cerebrate commentedon Sep 27, 2022
...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
ls -la /tmp/.X11-unix,env, andls -la /mnt/wslg/runtime-dir, I think.)cerebrate commentedon Sep 27, 2022
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 (
/tmp/.X11-unixis empty). DISPLAY environment variable is there, though, so that's okay.Let's check if the WSLg X socket is being properly created. If you
ls -la /mnt/wslg/.X11-unix, it should come back to you with (your date and username will vary)Does it?
cerebrate commentedon Sep 27, 2022
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.
mangkoran commentedon Sep 28, 2022
Apologize for jumping in (and could not help :)).
Interestingly enough, while I also encounter blank
DISPLAYenvvar, I am still able to use Emacs GUI 🤔However, chromium and firefox cannot be opened, same as this thread.
Alistair Young (@cerebrate) could you confirm this behaviour too?
cerebrate commentedon Sep 28, 2022
mangkoran (@mangkoran) You're using emacs-daemon via a user systemd service though, right? In which case it should work fine as long as
systemctl --user show-environmenthas DISPLAY and can pass it on to the emacs service.mangkoran commentedon Sep 28, 2022
..except it's not 🧐
cerebrate commentedon Sep 28, 2022
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.
mangkoran commentedon Sep 28, 2022
28.1 (+pgtk +nativecomp) which is indeed native Wayland. I guess I am mistook this issue since the beginning 😅
50 remaining items
haritha99ch commentedon Nov 16, 2022
On both Ubuntu-Preview and Kali-Linux, x11-apps worked fine until a desktop environment was installed.
WSL version: 1.0.0.0
linghengqian commentedon Nov 16, 2022
Installing the standard gnome desktop environment on a WSL distribution with systemd built in is a separate issue, which is very different from the process of installing a GUI application via snapcraft.io after opening systemd.
You should bring the reproduction steps to open the new issue.
linghengqian commentedon Nov 18, 2022
PhyX-Meow commentedon Nov 25, 2022
The issue is back with wsl 1.0.1 on my machine. :(
linghengqian commentedon Nov 25, 2022
lisp-the-great commentedon Dec 27, 2022
THANKS! I'm using windows10 and updated wsl to the store version recently. when enabling the
systemd(editbootsection of/etc/wsl.conf), the GUI apps disappears. My/tmp/.X11-unixandenv DISPLAYand any more things are all correct.This works for me.
I've saw the original
/usr/lib/binfmt.d/WSLInterop.conffile with content:WSLInterop:M::MZ::/init:F, and when change it with.../init:PFand restart the wsl, then it bring my Emacs back!