Wayland - hpaluch/hpaluch.github.io GitHub Wiki

Wayland

Here are my notes on Wayland (mostly issues).

My stance on Wayland:

  • I'm fine with Wayland as alternative Desktop Environment (DE) - Sway is most close to Compositor I like.

  • I'm NOT fine with Wayland as only DE - there are still too many regressions and missing features when compared to X11 with Xorg servers:

Later is serious issue - forceful dropping of Xorg (and even X11) - as pushed by unholy trinity - RedHat, SUSE, Canonical - is not the way how to make Wayland better or more popular. Instead these corporations (and also Linux Foundation) should seriously fix long list of Wayland regressions and finally implement important missing features when compared to X11.

Weston

Weston is reference Wayland compositor primarily for developers. Weston has following features:

  • lot of demos (for example weston-simple-egl)
  • supports many backends (KMS/DRM, X11, other Wayland, headless)
  • supports fully headless remote access (much better than GNOME, KDE and others that require working GPU for each user session).

Limitations: only 1 remote session per running Weston server is supported.

To install Weston in Fedora try:

dnf install weston-session weston-demo weston

If you have working KMS, X11 or Wayland session you can simply run weston and it will show default Desktop shell (on left-top there is icon to run new terminal).

Running Headless VNC session (following man weston-vnc)

# weston requires certificates to operate VNC: from weston-vnc(7)

# run on any machine - client or server:
openssl genrsa -out tls.key 2048
# when asked for: 'Common Name (e.g. server FQDN or YOUR name' enter exactly
# your SERVER FQDN (that you will use for connection to server)
# on all other questions just press ENTER
openssl req -new -key tls.key -out tls.csr
openssl x509 -req -days 365 -signkey tls.key -in tls.csr -out tls.crt

# now copy certs you neeed:
# on server: tls.crt tls.key
# on client: tls.crt

# on server run:
weston -Bvnc --port 9999 --vnc-tls-cert tls.crt --vnc-tls-key tls.key --width 1440 --height 900

# on client run:
vncviewer -X509CA tls.crt YOUR_SERVER_ADDRESS::9999
# use login and password of user that runs 'weston' on server

Notes on vncviewer:

  • replace YOUR_SERVER_ADDRESS with your server IP or FQDN - must match what you specified when creating certificates
  • to use "TCP port name" (in our case 9999) you have to specify double colon (::)
  • to use "VNC Display name" (starts with :0) you have to use single colon (:)

Click on left-top Terminal icon to run terminal. In terminal you can try many Weston demos, for example weston-simple-shm (basic animated bitmap example using shared memory). You can use several bitmaps under /usr/share/weston to test weston-image, for example:

weston-image /usr/share/weston/wayland.png

Note: use man weston-bindings to get list of Weston hot keys. Unfortunately Weston uses Ctrl-Alt-Backspace to terminate which is also use to terminate X11 server - so don't use that hotkey on X11 parent environment. Also note that default mod key is Win but it does not work through vncviewer (it somehow does not capture it).

WARNING! weston-debug is broken (or Weston is broken). It will just report:

$ weston-debug -l

The Wayland server does not support weston_debug_v1 interface.

Tip: use WAYLAND_DEBUG=1 to get detailed info about protocol exchange:

WAYLAND_DEBUG=1 weston-simple-dmabuf-egl

Misc tips

How to get list of available Wayland sessions (tested under Fedora 42):

$ grep '^Name=' /usr/share/wayland-sessions/*.desktop | \
    sed 's@.*/@@;s/:Name=/:/' | column -t -s ':' -N File,Name

File                           Name
gnome-classic.desktop          GNOME Classic
gnome-classic-wayland.desktop  GNOME Classic on Wayland
gnome.desktop                  GNOME
gnome-wayland.desktop          GNOME on Wayland
hyprland.desktop               Hyprland

Wayland KVM problems

virtio-gl acceleration problems

Under KVM we have 3 options for graphics acceleration of Guest (VM):

  • QXL - works best (2D+Video streaming acceleration), therefore RedHat dropped it from RHEL 9: https://bugzilla.redhat.com/show_bug.cgi?id=2030592 There is real risk that other distributions will follow them...
  • Virtio without GL (OpenGL acceleration): OpenGL terminal alacritty is terribly slow (after ENTER it takes 1 second before it will scroll with command results). However other applications (Firefox, LibreOffice) work good enough
  • Virtio with GL support (also knownn as virgl):
    • alacritty terminal is fast. But other applications (non OpenGL) - Firefox, etc. are terribly slow (like 1 fps)
    • additionally mouse is completely screwed - very sluggish and at wrong position (click will target different position than mouse cursor)

There already exists honest and sad story regarding these issues on YouTube:

Found workaround for VirGL + 3D:

  • GTK4 applications (ptyxis, etc.) shows many rendering artifacts
  • here is workaround that works for me (tested under Fedora 42 Beta + GNOME):
    # GDK_DEBUG is optional - the fix is in GDK_GL_DISABLE
    GDK_DEBUG=opengl GDK_GL_DISABLE=base-instance ptyxis
    

virt-viewer does not release mouse

Hit with that on Fedora 41 GNOME (Wayland) + virt-viewer (VM running on remote Proxmox VE host)

  • Ctrl-Alt-R will release keyboard focus but still holds mouse (pointer not visible)
  • only way to escape that trap is to press Alt-Tab (right after keyboard release) and kill virt-viewer from other terminal (!)

Related reports: