How to Switch from Wayland to X11 on Ubuntu
Wayland is the default display server in modern Ubuntu (21.04+), but some applications require X11 for compatibility. This guide covers switching between Wayland and X11.
Quick Method: Login Screen Toggle
Step 1: Log Out
- Click the system menu (top-right)
- Click your username
- Select “Log Out”
Step 2: Select X11 at Login Screen
- At the login screen, click your username
- Look for the gear/cog icon (⚙) in the bottom-right
- Select “Ubuntu on Xorg” from the menu
- Enter your password and log in
Success! You are now using X11!
Check Current Display Server
Verify whether you’re on Wayland or X11:
echo $XDG_SESSION_TYPE
Output: wayland or x11
Alternative method:
loginctl show-session $(loginctl | grep $(whoami) | awk '{print $1}') -p Type
Permanent Method: Disable Wayland
Step 1: Edit GDM Config
sudo nano /etc/gdm3/custom.conf
Step 2: Uncomment the X11 Line
Find this line:
#WaylandEnable=false
Uncomment it (remove the #):
WaylandEnable=false
Step 3: Save and Reboot
sudo reboot
Success! X11 is now the permanent default display server.
Alternative: Systemd Override
For custom desktop environments or per-user settings:
sudo systemctl edit gdm3
Add:
[Service]
Environment=XDG_SESSION_TYPE=x11
sudo systemctl daemon-reload && sudo systemctl restart gdm3
Change Back to Wayland
If Using Login Screen Method
- Log out
- At login screen, click the gear icon
- Select “Ubuntu” (or “Ubuntu on Wayland”)
If Using Permanent Method
sudo nano /etc/gdm3/custom.conf
Re-comment the line:
#WaylandEnable=false
sudo reboot
Why Switch to X11?
- Screen recording/sharing works (Zoom, Discord, OBS)
- NVIDIA proprietary driver compatibility
- Remote desktop (TeamViewer, AnyDesk, VNC)
- Legacy application support
- Global hotkeys and key remapping
Troubleshooting
No Gear Icon at Login
Ensure GDM is the display manager:
cat /etc/X11/default-display-manager
Xorg Not Installed
Install X11/Xorg packages:
sudo apt update && sudo apt install -y xorg xserver-xorg
Custom Desktop Environment
Different DEs have different settings:
- GNOME: Edit
/etc/gdm3/custom.conf - KDE Plasma: Edit
/etc/sddm.conf.d/sddm.conf - Budgie: Edit
/etc/gdm3/custom.conf
NVIDIA + Wayland Issues
NVIDIA proprietary drivers may require X11:
sudo apt install -y nvidia-driver-595
WaylandEnable=false
Wayland vs X11
- Wayland – Newer, better security, smoother graphics, but some apps incompatible
- X11 – Legacy, widely compatible, required for screen sharing and NVIDIA
Conclusion
Switching from Wayland to X11 is straightforward:
- Quick: Pick “Ubuntu on Xorg” at login screen
- Permanent: Set
WaylandEnable=falsein/etc/gdm3/custom.conf
Pro Tip: Use Wayland by default for daily work, switch to X11 only when you need screen sharing or NVIDIA compatibility.