I hope you know what a display server is. It is the underlying technology thanks to which, you can use your computer graphically.
Xorg (or X display server) is the legacy display server whereas Wayland is relatively newer. In 2017, Ubuntu made it the default with version 17.10. The experiment didn’t go well and they reverted to Xorg with Ubuntu 18.04. Now, Wayland becomes default again in version 21.04.
On the surface, you won’t notice any change in the display. But since Wayland is newer, many applications may not work properly with it. For example, there is not a single Linux screen recorder that works flawlessly with Wayland.
Whichever display server may be the default, the other one also remains accessible to you, and you may switch to it. I am going to show you how to switch between Xorg and Wayland display servers on Ubuntu.
Switch to Xorg from Wayland
Remember that I said Wayland is the default display server in Ubuntu. It also means that there are more than one display server available. And you can simply switch between them. No need to install anything new.
Restart your Ubuntu system. At the login screen, under the password field, you’ll see a gear icon. Just click on it and you’ll see two options here.
The default Ubuntu means it will be using Wayland while Ubuntu on Xorg obviously means it will use Xorg. You can select Ubuntu on Xorg to use Xorg here.
Similarly, you can switch back to Wayland when you feel like it.
How to know if I am using Wayland or Xorg
Since we are talking about Wayland, Xorg etc, let’s also see how to know which display server is being used. To find that out, open a terminal and use the following command:
echo $XDG_SESSION_TYPE
And then if you see X11, it’s Xorg. If you see Wayland, quite obviously, the display server in use is Wayland.
Quick Tip: Few programs that require root privileges have troubles with Wayland. For example, GParted didn’t run at all in Ubuntu with Wayland. If you don’t want to switch to Xorg, there is still a way to use these applications with sudo.
Use the command below
xhost +si:localuser:root
and then run the troublesome program with sudo like this:
sudo gparted
This tip was suggested by It’s FOSS reader Sean and was found here.
I hope this quick tip helped you to switch between Xorg and Wayland in Ubuntu. Stay tuned for more Ubuntu tips and tricks.