How to Switch Between X11 and Wayland on Debian

Debian GNU/Linux supports both the traditional X11 (Xorg) windowing system and the modern Wayland display server protocol across various desktop environments. Desktop users can easily choose between an X11 and a Wayland session directly from the graphical login screen without needing to modify complex system configuration files. This guide outlines the exact steps to switch your session type and verify which display server is currently active.

Switching Sessions from the Login Screen

Most modern Debian desktop environments (such as GNOME and KDE Plasma) allow you to select your session type directly through the display manager (GDM3, SDDM, or LightDM).

  1. Log Out of Your Current Session: Save all open work and log out of your desktop to return to the graphical login screen.
  2. Select Your User Account: Click on your username so the password prompt appears.
  3. Locate the Session Menu: Before typing your password, look for a small gear icon or a session drop-down menu.
    • In GDM3 (GNOME), the gear icon is typically in the bottom-right corner of the screen.
    • In SDDM (KDE Plasma), the session selection is usually a drop-down menu in the bottom-left or top-left corner.
  4. Choose Your Display Server:
    • For Wayland: Select GNOME (on modern Debian releases, standard GNOME defaults to Wayland) or Plasma (Wayland).
    • For X11: Select GNOME on Xorg or Plasma (X11).
  5. Log In: Enter your user password and press Enter. Your desktop will now load using the chosen display server protocol. Debian will remember this preference for subsequent logins.

How to Verify Your Active Session

To confirm whether your current session is running under X11 or Wayland, open a terminal window and run the following command:

echo $XDG_SESSION_TYPE
  • If the output is wayland, you are running a Wayland session.
  • If the output is x11, you are running an X11 session.

Setting X11 as the Permanent Default (GNOME)

If you use GNOME with GDM3 and wish to permanently disable Wayland system-wide, you can configure the display manager directly:

  1. Open the GDM3 configuration file with administrative privileges:

    sudo nano /etc/gdm3/daemon.conf
  2. Locate the line under the [daemon] section that reads:

    #WaylandEnable=false
  3. Remove the # symbol to uncomment the line:

    WaylandEnable=false
  4. Save the file and restart your computer or restart GDM3 (sudo systemctl restart gdm3). The system will now exclusively use X11.