How to migrate from X11 to Wayland?
February 12, 2024
Table of contents
2. You may already be using Wayland
3. Which desktop environments support Wayland
4. Which display managers support Wayland
6. Setting up applications to work with Wayland
6.1 Setting up Firefox to work with Wayland
6.2 Setting up Google Chrome to work with Wayland
6.3 Setting up SMPlayer to work with Wayland
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.
Is Wayland or X11 better?
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.
You may already be using Wayland
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.
Which desktop environments support Wayland
Currently Wayland supports the following desktop environments:
- GNOME
- KDE Plasma
- GNOME Classic
- Cinnamon (experimental support)
That is, you can try Wayland only on Linux with one of the listed desktops.
Which display managers support Wayland
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:
- GDM
- SDDM
- 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.
How to run 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:
- GNOME
- KDE Plasma
- GNOME Classic
- Cinnamon
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:
Setting up applications to work with Wayland
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:
Setting up Firefox to work with Wayland
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.
Setting up Google Chrome to work with Wayland
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.
Setting up SMPlayer to work with Wayland
See also: How to install and configure best video player on Linux (SMPlayer)
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.
Conclusion
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.
Related articles:
- How to change Display manager and login screen in Linux (74.6%)
- How to check if Wayland or X11 is used? (66.8%)
- How to enable automatic login in Linux (GDM, LightDM, SDDM) (64.4%)
- How to prioritize Wi-Fi connections in Linux (59.8%)
- How to disable automatic Wi-Fi connection without deleting settings in Linux (59.8%)
- Where NetworkManager stores settings (SOLVED) (RANDOM - 51.1%)