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

Applications run but don't create window #90

Closed
Thepenguin9 opened this issue Apr 24, 2021 · 20 comments
Closed

Applications run but don't create window #90

Thepenguin9 opened this issue Apr 24, 2021 · 20 comments
Labels
bug Something isn't working

Comments

@Thepenguin9
Copy link

Environment

Windows build number:  Win32NT             10.0.21364.0 Microsoft Windows NT 10.0.21364.0
Your Distribution version: Release:        20.04
Your WSLg version: 1.0.17.1

Steps to reproduce

  1. Launch a wsl instance in Windows Terminal
  2. Launch a graphical application (gedit in this example)

WSL logs:

  • Attach WSLg logs from /mnt/wslg

You can access the wslg logs using explorer at: \\wsl$\<Distro-Name>\mnt\wslg (e.g.: \\wsl$\Ubuntu-20.04\mnt\wslg)

Expected behavior

gedit will open and present a blank file with all UI elements

Actual behavior

The application runs, does not create a window, and prints these errors

pengu@ARCTICA:~$ gedit

(gedit:22): Gdk-CRITICAL **: 19:34:15.273: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.364: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.364: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.539: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.539: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.539: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.539: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.539: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.539: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.539: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.539: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.540: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.540: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.540: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.540: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.540: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.540: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.540: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.541: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.541: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.541: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.541: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.541: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.541: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.541: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.541: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.541: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.616: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.681: gdk_seat_get_pointer: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.681: gdk_device_get_window_at_position_double: assertion 'GDK_IS_DEVICE (device)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.681: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.681: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.681: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.681: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed

(gedit:22): Gdk-CRITICAL **: 19:34:15.681: gdk_seat_get_keyboard: assertion 'GDK_IS_SEAT (seat)' failed
@Thepenguin9 Thepenguin9 added the bug Something isn't working label Apr 24, 2021
@Thepenguin9
Copy link
Author

https://aka.ms/AAc1v26

@hideyukn88
Copy link
Member

@Thepenguin9 , would you please provide output of dmesg ?

It looks WSLg failed to start RDP client software (mstsc.exe) in Windows side, the provided weston.log does not show the connection to Windows.

[19:34:15.666] CreateWndow(): rdp_peer is not initalized

And virtiofs is also not properly configured in your system, this could be separate issue, but can be same root case.

[19:34:09.983] WSL2_SHARED_MEMORY_MOUNT_POINT is not set.

@Thepenguin9
Copy link
Author

Thepenguin9 commented Apr 24, 2021

@Thepenguin9 , would you please provide output of dmesg ?

Interestingly that reveals another piece of the puzzle. I've been having mount errors for an unrelated experiment on a hard drive, so I didn't think to check it now.

@Thepenguin9
Copy link
Author

I followed the guide in the root readme; updating wsl via powershell; restarting the instance; restarting my computer for good measure.

I can't recall any other actions I could've taken to affect WSLg

@Thepenguin9
Copy link
Author

It looks WSLg failed to start RDP client software (mstsc.exe) in Windows side, the provided weston.log does not show the connection to Windows.

mstsc.exe works fine launching from start, not sure what I can do there

And virtiofs is also not properly configured in your system, this could be separate issue, but can be same root case.

And this I have to admit I have no knowledge of, nor encountered this when setting up wsl

@onomatopellan
Copy link
Contributor

onomatopellan commented Apr 25, 2021

Linux, 4.19.84-microsoft-standard+

Are you running a custom kernel? Make sure you are running latest kernel from Windows Update with wsl.exe --update and comment out the kernel entry in .wslconfig.

@Thepenguin9
Copy link
Author

Are you running a custom kernel? Make sure you are running latest kernel from Windows Update with wsl.exe --update and comment out the kernel entry in .wslconfig.

I was running a self-build of Microsoft's own kernel. No edits, just locally compiled.
Commenting out the self-built kernel and restarting wsl has fixed the issue I had.

I will try and rebuild the kernel and see if it still works, though for now this issue can be considered solved!

spronovo pushed a commit that referenced this issue Apr 26, 2021
* Use custom wayland for system distro

* Add missing \

* Fixed copy paste typo on Dockerfile

* Fix typo
@c4artisan
Copy link

this seems to be happening to me as well (no i don't have a custom kernel nor any self-built thingy like thepenguin9 so yeah help please)

@hideyukn88
Copy link
Member

@c4artisan, would you please share /mnt/wslg/weston.log? thanks!

@c4artisan
Copy link

weston.log

@hideyukn88
Copy link
Member

hideyukn88 commented Dec 2, 2022

@c4artisan, it looks msrdc.exe on Windows side is not connecting to Linux side, I wonder you might be hitting the similar group policy issue reported at #841, and there is another kind of policy totally blocks RDP connection, would you please share output from reg QUERY "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /S on Windows's command prompt?

@c4artisan
Copy link

c4artisan commented Dec 2, 2022

reg QUERY "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /S

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\Client
fEnableUsbBlockDeviceBySetupClass REG_DWORD 0x1
fEnableUsbNoAckIsochWriteToDevice REG_DWORD 0x50
fEnableUsbSelectDeviceByInterface REG_DWORD 0x1

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\Client\UsbBlockDeviceBySetupClasses
1000 REG_SZ {3376f4ce-ff8d-40a2-a80f-bb4359d1415c}

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\Client\UsbSelectDeviceByInterfaces
1000 REG_SZ {6bdd1fc6-810f-11d0-bec7-08002be2092f}

@OfekShilon
Copy link

@hideyukn88
The same started happening to me today, immediately after enabling systemd per the instructions here. After disabling systemd (just removed wsl.conf) I'm able to see windows again.

I also updated wsl today, so it might be an issue in the latest version.

PS> wsl --version
WSL version: 1.0.3.0
Kernel version: 5.15.79.1
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22623.1020

Here's my own /mnt/wslg/weston.log, seems similar to the one above:
weston.log

Unfortunately disabling systemd is not an acceptable workaround for me, as I'm running apps that depend on it.

@c4artisan
Copy link

anything new on my end?

@c4artisan
Copy link

@hideyukn88

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 8, 2022

@OfekShilon: I wonder if you have a sysyemd unit that kills the X11 socket.

Can you share the output of sudo systemctl -t service and dmesg ?

@OfekShilon
Copy link

~$ sudo systemctl -t service
  UNIT                                 LOAD   ACTIVE SUB     DESCRIPTION
  accounts-daemon.service              loaded active running Accounts Service
  apport.service                       loaded active exited  LSB: automatic crash report generation
● atd.service                          loaded failed failed  Deferred execution scheduler
  avahi-daemon.service                 loaded active running Avahi mDNS/DNS-SD Stack
  blk-availability.service             loaded active exited  Availability of block devices
  console-getty.service                loaded active running Console Getty
  console-setup.service                loaded active exited  Set console font and keymap
  cron.service                         loaded active running Regular background program processing daemon
  dbus.service                         loaded active running D-Bus System Message Bus
  finalrd.service                      loaded active exited  Create final runtime dir for shutdown pivot root
  gdm.service                          loaded active running GNOME Display Manager
  keyboard-setup.service               loaded active exited  Set the console keyboard layout
  ModemManager.service                 loaded active running Modem Manager
  networkd-dispatcher.service          loaded active running Dispatcher daemon for systemd-networkd
  NetworkManager-wait-online.service   loaded active exited  Network Manager Wait Online
  NetworkManager.service               loaded active running Network Manager
  polkit.service                       loaded active running Authorization Manager
  rsyslog.service                      loaded active running System Logging Service
  rtkit-daemon.service                 loaded active running RealtimeKit Scheduling Policy Service
  setvtrgb.service                     loaded active exited  Set console scheme
  snapd.seeded.service                 loaded active exited  Wait until snapd is fully seeded
  snapd.service                        loaded active running Snap Daemon
● ssh.service                          loaded failed failed  OpenBSD Secure Shell server
  switcheroo-control.service           loaded active running Switcheroo Control Proxy service
  systemd-binfmt.service               loaded active exited  Set Up Additional Binary Formats
  systemd-hostnamed.service            loaded active running Hostname Service
  systemd-journal-flush.service        loaded active exited  Flush Journal to Persistent Storage
  systemd-journald.service             loaded active running Journal Service
  systemd-logind.service               loaded active running Login Service
  systemd-networkd-wait-online.service loaded active exited  Wait for Network to be Configured
  systemd-networkd.service             loaded active running Network Service
● systemd-remount-fs.service           loaded failed failed  Remount Root and Kernel File Systems
  systemd-resolved.service             loaded active running Network Name Resolution
  systemd-sysctl.service               loaded active exited  Apply Kernel Variables
  systemd-sysusers.service             loaded active exited  Create System Users
  systemd-timedated.service            loaded active running Time & Date Service
  systemd-tmpfiles-setup-dev.service   loaded active exited  Create Static Device Nodes in /dev
  systemd-tmpfiles-setup.service       loaded active exited  Create Volatile Files and Directories
  systemd-udev-settle.service          loaded active exited  udev Wait for Complete Device Initialization
  systemd-udev-trigger.service         loaded active exited  udev Coldplug all Devices
  systemd-udevd.service                loaded active running udev Kernel Device Manager
  systemd-update-utmp.service          loaded active exited  Update UTMP about System Boot/Shutdown
  systemd-user-sessions.service        loaded active exited  Permit User Sessions
  udisks2.service                      loaded active running Disk Manager
  ufw.service                          loaded active exited  Uncomplicated firewall
  unattended-upgrades.service          loaded active running Unattended Upgrades Shutdown
  user-runtime-dir@1000.service        loaded active exited  User Runtime Directory /run/user/1000
  user-runtime-dir@122.service         loaded active exited  User Runtime Directory /run/user/122
  user@1000.service                    loaded active running User Manager for UID 1000
  user@122.service                     loaded active running User Manager for UID 122
  wpa_supplicant.service               loaded active running WPA supplicant

dmesg output:
dmesg.txt

Thanks.

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 9, 2022

Thank you @OfekShilon.

I don't see anything that jumps out, but let's gather some debugging information to see if we can root cause this. Can you share:

  • Which distribution you're using
  • The output of ls -la /tmp/.X11-unix/
  • The output of sudo mount
  • The output of sudo systemctl -u wslg-mount.service
  • If running sudo systemctl restart wslg-mount.service solves the issue
  • If running systemctl disable gdm.service, and wsl.exe --shutdown solves the issue ? (after restarting the distro)

@OfekShilon
Copy link

  • Which distribution you're using

Ubuntu 20.04

  • The output of ls -la /tmp/.X11-unix/
ofek@ofek-lap:~$ ls -la /tmp/.X11-unix/
total 4
drwxrwxrwx 2 root root   60 Dec 10 12:58 .
drwxrwxrwt 9 root root 4096 Dec 10 12:58 ..
srwxrwxrwx 1 ofek ofek    0 Dec 10 12:58 X0
  • The output of sudo mount
none on /mnt/wsl type tmpfs (rw,relatime)
drivers on /usr/lib/wsl/drivers type 9p (ro,nosuid,nodev,noatime,dirsync,aname=drivers;fmask=222;dmask=222,mmap,access=client,msize=65536,trans=fd,rfd=7,wfd=7)
none on /usr/lib/wsl/lib type overlay (rw,relatime,lowerdir=/gpu_lib_packaged:/gpu_lib_inbox,upperdir=/gpu_lib/rw/upper,workdir=/gpu_lib/rw/work)
/dev/sdd on / type ext4 (rw,relatime,discard,errors=remount-ro,data=ordered)
none on /mnt/wslg type tmpfs (rw,relatime)
/dev/sdd on /mnt/wslg/distro type ext4 (ro,relatime,discard,errors=remount-ro,data=ordered)
rootfs on /init type rootfs (rw,size=6122908k,nr_inodes=1530727)
none on /dev type devtmpfs (rw,nosuid,relatime,size=6122936k,nr_inodes=1530734,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,gid=5,mode=620,ptmxmode=000)
none on /run type tmpfs (rw,nosuid,nodev,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,noatime)
none on /run/shm type tmpfs (rw,nosuid,nodev,noatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,noatime,mode=755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
cgroup on /sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_prio)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/misc type cgroup (rw,nosuid,nodev,noexec,relatime,misc)
none on /mnt/wslg/versions.txt type overlay (rw,relatime,lowerdir=/systemvhd,upperdir=/system/rw/upper,workdir=/system/rw/work)
none on /mnt/wslg/doc type overlay (rw,relatime,lowerdir=/systemvhd,upperdir=/system/rw/upper,workdir=/system/rw/work)
none on /tmp/.X11-unix type tmpfs (ro,relatime)
drvfs on /mnt/c type 9p (rw,noatime,dirsync,aname=drvfs;path=C:\;uid=1000;gid=1000;symlinkroot=/mnt/,mmap,access=client,msize=262144,trans=virtio)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
/dev/sdd on /snap type ext4 (rw,relatime,discard,errors=remount-ro,data=ordered)
snapfuse on /snap/core20/1738 type fuse.snapfuse (ro,nodev,relatime,user_id=0,group_id=0,allow_other)
snapfuse on /snap/lxd/22753 type fuse.snapfuse (ro,nodev,relatime,user_id=0,group_id=0,allow_other)
snapfuse on /snap/core20/1611 type fuse.snapfuse (ro,nodev,relatime,user_id=0,group_id=0,allow_other)
snapfuse on /snap/lxd/24061 type fuse.snapfuse (ro,nodev,relatime,user_id=0,group_id=0,allow_other)
snapfuse on /snap/snapd/17883 type fuse.snapfuse (ro,nodev,relatime,user_id=0,group_id=0,allow_other)
none on /run/snapd/ns type tmpfs (rw,nosuid,nodev,mode=755)
nsfs on /run/snapd/ns/lxd.mnt type nsfs (rw)
none on /run/user/1000 type tmpfs (rw,relatime)
  • The output of sudo systemctl -u wslg-mount.service

-u is an unknown option. Without it I get:

Unknown operation wslg-mount.service.
  • If running sudo systemctl restart wslg-mount.service solves the issue
  • If running systemctl disable gdm.service, and wsl.exe --shutdown solves the issue ? (after restarting the distro)

Neither helps.

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 12, 2022

Thank you @OfekShilon.

Sorry about the typo on wslg-mount.service (what I meant was systemctl status wslg-mount.service), but I can see that /tmp/.X11-unix/X0 exists on your machine, so this is not the same as this issue as I suspected.

Let's keep digging on #917

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

6 participants