Screen recording tools often fail to capture video correctly when running under Wayland, resulting in dark or blank output. Switching to the X11 (Xorg) display server restores proper screen recording functionality and resolves compatibility issues with certain legacy applications.

Switching Display Servers from the Login Screen

Step 1: Log out of your current Ubuntu session. You can do this by clicking the system menu in the top-right corner, selecting Power Off/Log Out, and then choosing Log Out. This action returns you to the login screen, where you can select your session type.

Step 2: On the login screen, click your username to proceed to the password prompt. Before entering your password, look for a gear or cog icon (typically located near the "Sign In" button or password field). This icon allows you to select which display server to use for the session.

Step 3: Click the gear icon. You will see options such as Ubuntu (Wayland) and Ubuntu on Xorg (X11/Xorg). Select your preferred option. For broader compatibility and better support for remote desktop tools or screen recorders, choose Ubuntu on Xorg.

Step 4: Enter your password and sign in. Your session will now use the selected display server.

Step 5: To confirm which display server is active, open a terminal and run:

echo $XDG_SESSION_TYPE

If you see x11, you are running on Xorg. If you see wayland, you are on Wayland.


Disabling Automatic Login to Enable Session Selection

Automatic login prevents the display server selection menu from appearing at the login screen. Disabling this feature is necessary to switch between X11 and Wayland.

Step 1: Open Settings from the application launcher.

Step 2: Scroll down the left sidebar and select Users. Click Unlock in the top-right corner and enter your password to authenticate.

Step 3: Toggle off Automatic Login. This change will ensure the login screen appears after a reboot or log out, allowing you to choose your session type using the gear icon.


Editing GDM Configuration for Persistent Changes

For systems where the session selection menu does not appear or for users who want to permanently use X11 or Wayland, editing the GNOME Display Manager (GDM) configuration file is effective. This method is also useful if you need to enforce a particular display server for all users.

Step 1: Open a terminal window using Ctrl + Alt + T.

Step 2: Edit the GDM configuration file with root privileges. Depending on your distribution, this is typically /etc/gdm3/custom.conf or /etc/gdm3/daemon.conf. Run:

sudo nano /etc/gdm3/custom.conf

Step 3: Locate the line containing #WaylandEnable=false. To disable Wayland and force X11, uncomment this line (remove the #) and ensure it reads:

WaylandEnable=false

To enable Wayland, set the line to:

WaylandEnable=true

Step 4: Save your changes (Ctrl + O), then exit the editor (Ctrl + X).

Step 5: Restart your system or the GDM service to apply changes. To reboot, use:

sudo reboot

Alternatively, to restart GDM without a full reboot, use:

sudo systemctl restart gdm3

Caution: Incorrect changes to the GDM config file can prevent the display manager from starting. If you encounter a black screen or cannot log in, use the recovery option from the GRUB menu, access a root shell, and revert your changes.


Checking Your Current Display Server

Knowing which display server is active helps with troubleshooting and configuration. After logging in, open a terminal and run:

echo $XDG_SESSION_TYPE

The output will be either x11 (Xorg/X11) or wayland (Wayland).

Alternatively, in Ubuntu’s Settings app, go to About and check the Windowing System entry for the current session type.


Common Reasons to Switch Between X11 and Wayland

  • Some graphics-intensive applications and legacy tools require X11 for full compatibility.
  • Remote desktop tools like AnyDesk, VNC, or X forwarding function reliably only under X11.
  • Wayland provides stronger application isolation and security, and can deliver smoother performance on supported hardware.
  • Users may need to switch temporarily for specific tasks, or permanently if their workflow relies on software not fully supported by Wayland.

Switching between X11 and Wayland in Ubuntu is straightforward once you know where to look. Whether you need better compatibility or want to try the latest display server features, these methods let you tailor your desktop experience to your needs.