How to migrate from X11 to Wayland?
February 12, 2024
Table of contents
X11 and Wayland are collectively called Windowing System, Display Server, and Graphics Platform. X11 and Wayland are required on Linux to run (display) graphical applications. At the same time, X11 and Wayland are mutually exclusive alternatives. Wayland is a successor to X11 and is designed to address the shortcomings of the display server.
Your experience using Wayland may differ from other users. Wayland is not a program. This is a protocol, that is, a description of how other programs should work.
Various Wayland components are implemented at the desktop environment level (GNOME, KDE Plasma, Cinnamon), as well as in video card drivers (NVIDIA, AMD).
Thus, the Wayland experience for Linux OS users with GNOME and KDE Plasma is not identical.
Likewise, the experience with Wayland for owners of NVIDIA and AMD video cards, even on the same Linux distributions, may also vary.
Add to this that not all applications can use Wayland. Some of them work in xWayland, that is, an X11 emulator running on Wayland. As you might guess, this does not have any special advantages.
The general experience of using Wayland is usually that Linux on Wayland generally works better, but there are some problems.
I started with Wayland in the Cinnamon desktop environment. Wayland support in Cinnamon is currently experimental. It's not even a beta, it's more of an alpha version. At the time of writing, Cinnamon on Wayland does not have any keyboard layouts other than English, and graphical applications (all of them at once) crash from time to time when performing normal actions or for no apparent reason at all.
And yet, Wayland already in this form pleasantly surprised me. Ultra-high resolution (4K, 8K) and high bitrate video playback on my slightly outdated hardware became much, MUCH smoother. Now they are much more pleasant to watch. This applies to both playing local video files and YouTube videos in Google Chrome.
As soon as they fix the keyboard layouts in Cinnamon on Wayland, I will finally switch to Wayland.
That is, at the very least you should try Wayland. You might like it.
In other desktop environments such as GNOME and KDE Plasma, Wayland is much more stable and mature.
Wayland's first release dates back to 2008, which means it has been with us for almost two decades.
GNOME currently uses Wayland by default (if the requirements are met). That is, if you are an Ubuntu user, then it is quite possible that your Linux is already running on Wayland. There are some other distributions that have switched to Wayland and use it by default.
See note: How to check if Wayland or X11 is used?
If your distribution does not use Wayland, you still have the option of running a session in Wayland. To do this, you must have one of the desktop environments that supports Wayland.
There is usually no need to install any additional packages.
Currently Wayland supports the following desktop environments:
- KDE Plasma
- GNOME Classic
- Cinnamon (experimental support)
That is, you can try Wayland only on Linux with one of the listed desktops.
The display manager (OS login screen) may or may not itself work on Wayland. Regardless, it can run Linux with Wayland or X11.
For example, LightDM currently cannot run on Wayland and runs on X11. But at the same time, LightDM is able to launch a session on Wayland.
There are also several display managers that are themselves capable of running on Wayland. These include:
- greetd (when using Wayland greeter, which may be packaged as wlgreet or greetd-wlgreet on various distributions)
If you want “purely Wayland” on both the login screen and the Linux OS, then choose GDM or SDDM.
If you don't care what the login screen uses but want Linux OS on Wayland, then choose from GDM, SDDM and LightDM.
For information on how to check which display manager your distribution is using, as well as how to switch between display managers, see the article: How to change Display manager and login screen in Linux
The GDM display manager does NOT allow you to select a session with Wayland. Instead, it checks to see if your computer's hardware and software meet certain requirements, and if it does, it automatically starts a session with Wayland. I was never able to get Wayland running on my test computers when using GDM.
SDDM and LightDM display managers allow you to easily select sessions from Wayland.
So, to summarize, for Wayland to work, your Linux distribution must use SDDM, LightDM, or GDM as its display manager. Moreover, I recommend choosing one of the first two.
Your desktop environment should be one of the following:
- KDE Plasma
- GNOME Classic
At the login screen, don't rush to press Enter after entering your password. Please note the list of available sessions. If you don't know how to open it, then see the following links:
- Interface and tips for using GDM
- Interface and tips for using SDDM
- Interface and tips for using LightDM
This is the LightDM interface and you can see that there are two sessions available on Wayland:
- Cinnamon on Wayland
- GNOME on Wayland
This is again a screenshot of LightDM, but on a different distribution; there are three Wayland sessions available to choose from:
- GNOME Classic on Wayland
- GNOME on Wayland
- Plasma (Wayland)
And this is a screenshot of part of the SDDM login screen:
Let's make sure that Wayland is actually used. Checking the use of Wayland on the command line:
See also: How to check if Wayland or X11 is used?
Checking for Wayland usage in Linux distribution information:
Firefox automatically detects the presence of Wayland and uses it by default. No additional configuration is required.
You can check the settings by entering “about:support” into the address bar of your web browser.
In Chrome, go to “chrome://flags/” and look for the “Preferred Ozone platform” option. Instead of default (which means use X11), select one of the following options:
- “Auto” means choose Wayland if possible, otherwise X11 will be used
- “Wayland” means use only Wayland. If you can't use Wayland, you may have problems launching your web browser.
You can check the settings by entering “chrome://gpu/” into the address bar of your web browser.
To enable Wayland compatibility in SMPlayer, from the application menu, go to Options → Preferences → General → Video.
And check the box next to the “Wayland support” option.
If you have your own impressions of working with Wayland, its pros and cons, then write them in the comments.
If any other application requires configuration to work with Wayland, then also write in the comments.
- How to change Display manager and login screen in Linux (76.1%)
- How to check if Wayland or X11 is used? (67.9%)
- How to enable automatic login in Linux (GDM, LightDM, SDDM) (65.1%)
- How to set up automatic login in Linux with SDDM (56.9%)
- How to set up automatic login in Linux with LightDM (56.9%)
- How to determine the number of colors (bits per pixel) in X11 (RANDOM - 50%)