Linux – Can Xorg-Server and Wayland-Compositor be run simultaneously in Linux

linuxwaylandxorg

At graphical login with lightdm I can set which session type to start and am offered:

  • Gnome
  • Gnome on Xorg
  • Xfce session

The first Gnome is the Gnome DE running with the standard Wayland backend, and as I understand it means Gnome acts as a wayland protocol compositor, i.e talk to the kernel for KMS and evdev (as displayed on Wayland Architecture | freedesktop.org), the second option Gnome on Xorg when chosen creates also a Gnome session, yet there is a process Xorg, i.e. as I can tell an Xorg server running.

I was courious, since both Xorg-Server, as the wayland protocol's compositor might be using similar/same resources (i.e. the graphic adapter) if it is possible to run both at the same time.

I have tested therefore to login, once into a Gnome wayland session and then secondly with another account account in to a Gnome on Xorg session.
The result has been that this seemingly works, yet there are processes named /usr/bin/Xwayland running, and I am unsure if the displayed Xorg session, is eventually only "fake", hence displaying via the XWayland "Xorg" server.

Being confused I wanted to pose the question here, whether "Xorg-Server and Wayland-Compositor [can] be run simultanously in Linux?"

Best Answer

They run simultaneously, but they don't control the display simultaneously. Typically, the login screen ends up on the first VT, and your desktop on the second; you can try switching back and forth with CtrlAltF1 and CtrlAltF2. You'll find hand-off messages in the logs; for example, in ~/.local/share/xorg/Xorg.1.log, I see

AIGLX: Suspending AIGLX clients for VT switch
systemd-logind: got pause for ...

when switching away from the VT running that X server, and

systemd-logind: got resume for ...
AIGLX: Resuming AIGLX clients after VT switch

when switching to the VT.

Related Question