Extra QEMU arguments to enable headless virgl/hardware accelerated rendering:
-device vhost-vsock-pci,guest-cid=3 -display egl-headless,gl=onOn client:
rm -f /tmp/socket-local; waypipe -s /tmp/socket-local client # TCP
waypipe --vsock -s 2:5000 client # VSockOn remote (change -p 8022 and pojntfx@localhost to match your system):
ssh -p 8022 -R /tmp/socket-remote:/tmp/socket-local -t pojntfx@localhost waypipe --display=0 --unlink-socket -s /tmp/socket-remote server -- bash # TCP
ssh -p 8022 -t pojntfx@localhost waypipe --display=0 --vsock -s 5000 server -- bash # VSockNow, in any future SSH sessions to your server, you can start graphical Wayland applications like so:
export XDG_SESSION_TYPE=wayland
export WAYLAND_DISPLAY=0
weston-terminalAnd they will be rendered on your local system. If you want portals to work too, use:
systemctl --user set-environment WAYLAND_DISPLAY=0
systemctl --user set-environment XDG_SESSION_TYPE=wayland
systemctl --user import-environment WAYLAND_DISPLAY XDG_SESSION_TYPE
# Restart the portal services
systemctl --user restart xdg-desktop-portal.service
systemctl --user restart xdg-desktop-portal-gtk.serviceElectron-based apps, e.g. those installed via Flatpak, might need some additional flags, e.g.:
flatpak run com.vscodium.codium --enable-features=UseOzonePlatform --ozone-platform=waylandFor D-Bus services, e.g. a prompter to unlock the system keyring, you also need to export the WAYLAND_DISPLAY etc. variables:
cat > ~/.config/environment.d/wayland.conf << 'EOF'
XDG_SESSION_TYPE=wayland
WAYLAND_DISPLAY=wayland-0
EOF
systemctl --user daemon-reload
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_SESSION_TYPE