For a long time, most Linux distros have slowly been transitioning their users away from Xorg and into Wayland. In most cases, this is a good thing. Wayland is more secure, performs much better than X, and overcomes many of the hurdles of the older protocol. The bad news is that your applications may not function perfectly if they expect to be running in X11.
Luckily, most Linux distros come with both Wayland and Xorg installed, and you can easily switch between both. Here we’ll look at how you can switch to Xorg from Wayland.
Tip: If you are using Nvidia graphics card, here is how you can get Wayland to plays well with Nvidia.
Switch from Wayland to Xorg
The procedure for switching from Wayland to Xorg depends entirely on what kind of display manager you’re using. If you can’t find your display manager listed here, the process is similar enough for most of them that you might just be able to wing it with any of these instructions.
If you don’t know which display manager you use, it’s often tied to the desktop environment that your distro shipped with. GNOME uses GDM, KDE Plasma uses SDDM, and several other desktop environments (like LXQt, LXDE, and XFCE) use LightDM.
For the examples below, we’ll be using Ubuntu as our distro, but the instructions will be the same regardless of what you use.
If you use Ubuntu, Fedora, or any other distro that ships with GNOME as the default desktop environment, you’re almost 100% guaranteed to be using GDM.
The login screen is very simplified, and it’s easy to miss the icon that lets you choose your display protocol. Here’s how to make sure you find it:
- Select your username as you normally would from your login screen.
- Before typing your password, look for the settings cog at the bottom right of your screen.
- Click on the cog and choose the Xorg version of your preferred desktop environment.
Once that’s done, go ahead and finish your login. You should now be on Xorg!
If your distro shipped with KDE Plasma, you may be using SDDM. Because of the insane amount of customization that SDDM allows, one interface can look wildly different from another. The only guarantee is that you will have somewhere to select your desktop environment. The drop-down menu’s location depends entirely on what customization the distro provided.
Using the default SDDM configuration, you can select Xorg or Wayland by simply looking at the top left of your screen.
That’s all you have to do! If your SDDM login screen doesn’t look like this one, the drop-down is probably directly above or below your user name.
If you’re not using KDE Plasma or GNOME, you’re likely using LightDM as your display manager. It’s a popular choice for distros that ship lightweight or alternative desktop environments.
In LightDM, you’ll see an icon next to your user name.
Click on it and you’ll be able to select your display protocol.
Just pick what you need to, and log in!
How to Check if You Are Running Xorg or Wayland
If you want to find out which display server you are currently running, you can use the following command to do so in any terminal:
If you see
x11, then you are running Xorg. Similarly, if you see
wayland, then you are running Wayland.
Frequently Asked Questions
Can I just force applications to work in Wayland?
If your applications are glitching in Wayland, they may not know that they’re supposed to use Wayland protocol. It all depends on what APIs they’re using to generate their windows. Some Qt apps will glitch unless you add
QT_QPA_PLATFORMTHEME="wayland;xcb" to your “/etc/environment” file.
If your app is using Electron, try launching it with the
--enable-features=UseOzonePlatform --ozone-platform=wayland flags in launch options.
In Chromium-based browsers (Brave, Chrome, Opera, Microsoft Edge, etc.), navigate to chrome://flags in your URL bar and choose
Wayland under “Preferred Ozone platform.”
Why can't I run applications with sudo in Wayland?
Older implementations of Linux environments in Wayland would sometimes make it impossible to run applications as root. If you’re experiencing this issue, make sure you’re running the most up-to-date packages! This happens because environmental variables like
WAYLAND_DISPLAY failed to pass into the root shell.
If you still have this issue, use sudo -E instead of simple
sudo to run the application. This will preserve your environmental variables and fix the issue.
Is Xorg going to be replaced?
As Wayland continues to get over some of its own hurdles, X will look less appealing as time passes and application developers might just give up supporting it. In the meantime, Xorg is a useful alternative that can serve as a “backup” display server for hardware and software that’s not quite yet fully supported by the newer display protocol.
Image credit: Featured image by author.
Our latest tutorials delivered straight to your inbox