Closed c4artisan closed 1 year ago
See responses to #8888.
i did most of that and it didn't fix the problem haven't done the thing that's on the last response tho
did it and it seems to have killed the gnome apps (the only ones that worked)
See responses to #8888.
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
the gnome apps (the only ones that worked)
...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.)
the gnome apps (the only ones that worked)
...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.)
reverted the mount bind thing and nautilus revived, so that's a good sign.
output of the first command was:
total 12 drwxrwxrwt 2 root root 40 Sep 27 12:12 . drwxrwxrwt 34 root root 12288 Sep 27 12:13 ..
second command gave:
SHELL=/bin/bash WSL2_GUI_APPS_ENABLED=1 WSL_DISTRO_NAME=Ubuntu-22.04 WT_SESSION=c76654f6-5a27-4749-9f3e-5b9b0740eb10 NAME=DESKTOP-80AE24M PWD=/home/omegapc LOGNAME=omegapc PNPM_HOME=/home/omegapc/.local/share/pnpm HOME=/home/omegapc LANG=en_US.UTF-8 WSL_INTEROP=/run/WSL/879_interop LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36: WAYLAND_DISPLAY=wayland-0 LESSCLOSE=/usr/bin/lesspipe %s %s TERM=xterm-256color LESSOPEN=| /usr/bin/lesspipe %s USER=omegapc DISPLAY=:0 SHLVL=1 XDG_RUNTIME_DIR=/run/user/1000/ WSLENV=WT_SESSION::WT_PROFILE_ID XDG_DATA_DIRS=/usr/share/gnome:/home/omegapc/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop PATH=/home/omegapc/.local/share/pnpm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files (x86)/VMware/VMware Workstation/bin/:/mnt/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/bin:/mnt/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/libnvvp:/mnt/c/Program Files/Common Files/Oracle/Java/javapath:/mnt/c/Program Files/Microsoft/jdk-11.0.12.7-hotspot/bin:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/nodejs/:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/NVIDIA Corporation/Nsight Compute 2022.2.0/:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/FFmpeg:/mnt/c/Program Files/Microsoft SQL Server/130/Tools/Binn/:/mnt/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit/:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/qemu/:/mnt/c/Program Files (x86)/Windows Live/Shared:/mnt/c/Program Files/Wiimm/WIT:/mnt/c/Program Files/Wiimm/SZS:/mnt/c/Program Files/CMake/bin:/mnt/c/HaxeToolkit/haxe:/mnt/c/HaxeToolkit/neko:/mnt/c/Python310/Scripts/:/mnt/c/Python310/:/mnt/c/Users/omegapc/.cargo/bin:/mnt/c/Users/omegapc/AppData/Local/Programs/Python/Python310/Scripts/:/mnt/c/Users/omegapc/AppData/Local/Programs/Python/Python310/:/mnt/c/Users/omegapc/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/omegapc/AppData/Roaming/npm:/mnt/c/Users/omegapc/.dotnet/tools:/snap/bin DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus HOSTTYPE=x86_64 PULSE_SERVER=/mnt/wslg/PulseServer WT_PROFILE_ID={f9ceaf27-504c-58d7-927c-d1d6a7ac7d3c} _=/usr/bin/env
output of the last one was:
total 0 drwx------ 13 omegapc omegapc 400 Sep 27 12:12 . drwxrwxrwt 7 root root 280 Sep 27 12:12 .. drwx------ 2 omegapc omegapc 60 Sep 27 12:12 at-spi srw-rw-rw- 1 omegapc omegapc 0 Sep 27 12:12 bus drwx------ 3 omegapc omegapc 60 Sep 27 12:12 dbus-1 drwx------ 2 omegapc omegapc 60 Sep 27 12:12 dconf dr-x------ 2 omegapc omegapc 0 Dec 31 1969 doc drwx------ 2 omegapc omegapc 140 Sep 27 12:12 gnupg dr-x------ 2 omegapc omegapc 0 Sep 27 12:12 gvfs drwx------ 2 omegapc omegapc 40 Sep 27 12:12 gvfs-burn drwx------ 2 omegapc omegapc 40 Sep 27 12:12 gvfsd drwx------ 2 omegapc omegapc 60 Sep 27 12:12 keyring srw-rw-rw- 1 omegapc omegapc 0 Sep 27 12:12 pipewire-0 -rw-rw---- 1 omegapc omegapc 0 Sep 27 12:12 pipewire-0.lock srw-rw-rw- 1 omegapc omegapc 0 Sep 27 12:12 pk-debconf-socket drwx------ 2 omegapc omegapc 80 Sep 27 12:12 pulse srw-rw-rw- 1 omegapc omegapc 0 Sep 27 12:12 snapd-session-agent.socket drwxr-xr-x 5 omegapc omegapc 140 Sep 27 12:12 systemd srwxrwxrwx 1 omegapc omegapc 0 Sep 27 12:12 wayland-0 -rw-rw---- 1 omegapc omegapc 0 Sep 27 12:12 wayland-0.lock
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 (/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)
total 0
srwxrwxrwx 1 avatar avatar 0 Sep 26 13:32 X0=
Does it?
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)total 0 srwxrwxrwx 1 avatar avatar 0 Sep 26 13:32 X0=
Does it?
not exactly, this popped up
total 0 drwxrwxrwt 2 root root 40 Sep 27 14:43 . drwxrwxrwt 7 root root 240 Sep 27 14:43 ..
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.
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...
well now gnome apps seem to have died as well? idk how, but this is their output:
Gdk-CRITICAL **: 17:59:46.290: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed
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 DISPLAY
envvar, I am still able to use Emacs GUI 🤔
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 systemctl --user show-environment
has DISPLAY and can pass it on to the emacs service.
..except it's not 🧐
❯ systemctl --user show-environment
HOME=/home/mangkoran
LANG=en_US.UTF-8
LOGNAME=mangkoran
MAIL=/var/spool/mail/mangkoran
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
SHELL=/usr/bin/fish
SYSTEMD_EXEC_PID=89
USER=mangkoran
XDG_RUNTIME_DIR=/run/user/1000
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
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 I am using Arch Linux for my WSL
/tmp/.X11-unix
does not exist on my system.
The socket gets created in /mnt/wslg/.X11-unix
tho
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:
wsl --system kill -1 11
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:
eval $(dbus-launch --sh-syntax)
otherwise some gnome apps might stall at startup.
For a quick sanity check,
Can you find these lines somewhere in the output after running dmesg | grep "WSL (1): systemd"
?
$ 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 /tmp/.X11-unix
is being cleaned.
not exactly, this popped up
total 0 drwxrwxrwt 2 root root 40 Sep 27 14:43 . drwxrwxrwt 7 root root 240 Sep 27 14:43 ..
@c4artisan maybe then we need to check if Xwayland is even running or not.
1) Shutdown wsl with wsl --shutdown
1) From powershell run wsl -d <distro> --system
(where <distro>
is your problematic linux distro name) to boot into system distro
2) Run ps x
and check if Xwayland (/usr/bin/Xwayland) is 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 /tmp/.X11-unix
has any X0.
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
not exactly, this popped up
total 0 drwxrwxrwt 2 root root 40 Sep 27 14:43 . drwxrwxrwt 7 root root 240 Sep 27 14:43 ..
@c4artisan maybe then we need to check if Xwayland is even running or not.
- Shutdown wsl with
wsl --shutdown
- From powershell run
wsl -d <distro> --system
(where<distro>
is your problematic linux distro name) to boot into system distro- Run
ps x
and check if Xwayland (/usr/bin/Xwayland) is 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
/tmp/.X11-unix
has any X0.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
PID TTY STAT TIME COMMAND 11 ? Sl 0:00 /usr/bin/weston --backend=rdp-backend.so --modules=wslgd-notify.so --xwayland --log=/mnt/wslg 13 ? Ss 0:00 /usr/libexec/weston-rdprail-shell 15 ? Ssl 0:00 /usr/bin/Xwayland :0 -rootless -core -listen 38 -wm 39 -terminate -nolisten local -ac 22 pts/0 Ss 0:00 -bash 43 pts/0 R+ 0:00 ps x
total 0 drwxrwxrwx 2 root root 60 Sep 28 12:30 . drwxrwxrwt 1 root root 80 Sep 28 12:30 .. srwxrwxrwx 1 wslg wslg 0 Sep 28 12:30 X0
OK NOW WHAT ALL OF A DAMN SUDDEN THE GNOME APPS DECIDE TO COME BACK
OK NOW WHAT ALL OF A DAMN SUDDEN THE GNOME APPS DECIDE TO COME BACK
xeyes works ? If yes then that's great.
OK NOW WHAT ALL OF A DAMN SUDDEN THE GNOME APPS DECIDE TO COME BACK
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?
Can you try with 0.68.2 and see if this still is an issue?
yep, gnome apps seem to have died as well firefox keeps throwing the same issue "can't open display"
Can you try with 0.68.2 and see if this still is an issue?
yep, gnome apps seem to have died as well firefox keeps throwing the same issue "can't open display"
btw, if you're confused about what i mean with "gnome apps dying" they don't seem to work anymore and keep throwing a "GDK_IS_SEAT failed" error or something
hello?
look at microsoft/wslg#496.
look at microsoft/wslg#496.
does not relate at all. the file does not exist in my users folder and the wsl directory in programdata/microsoft doesn't exist at all
disabling systemd seems to get rid of it too
hello? any other solutions i could try out?
oh well, at this point i give up. i'll just wait until this is confirmed solved by the team or anybody else on the repo. bye
i take it back
I have some more changes that I hope will resolve this.
Does this fix also takes care of https://github.com/microsoft/WSL/issues/8896 or is this something unrelated?
unrelated but in case you uh want to know the latest version didn't do anything (it did fix the gtk errors tho)
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.
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.
which, the gtk issues or the display problem
nevermind the file exists
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:
wsl --system kill -1 11
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:
eval $(dbus-launch --sh-syntax)
otherwise some gnome apps might stall at startup.
I had a working wsl2 for a while and now with some updates (not sure if the october windows update OR some update inside Ubuntu) caused the error.
after wsl --system kill -1 11
the socket appeared and things started working again even without eval $(dbus-launch --sh-syntax)
. so Kudos for this comment.
I kinda like wsl but this fiddling around a bit tiresome...
Ubuntu (Preview)
. I personally prefer that this is an issue strongly related to Ubuntu
distributions, as I can only reproduce this issue locally on Ubuntu 22.04
. Ubuntu 22.10
is performing very normally. I think this issue can already be closed.yeah i'm on 22.04
I'm on Kali-Linux and it has the same problem
I'm on Kali-Linux and it has the same problem
Ubuntu (Preview)
and Ubuntu
does not show this problem of old versions.i have been waiting for the supposed fix for 1 month so unless that this is just specific to 22.04 i guess i'll just move to a newer version (oh and btw the same thing happened with the preview distro but i don't know if that's a thing now)
You guys can also try this
restart_wsl_x11() {
sudo rm -r /tmp/.X11-unix
ln -s /mnt/wslg/.X11-unix /tmp/.X11-unix
}
I found this solution after browsing through the issues. Sometimes when I launch WSL I can't open the display, but this fixes it for me. WSL runs a Wayland server and mounts the socket in a different directory than normal Ubuntu. Worth a shot.
the gdk issues came back after updating ah well if google chrome is still dead then i'm going to cry
yep i'm probably going to do a fresh start on the preview distro and get rid of my 22.04 one because atp this is a lost cause
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