2 Best Ways to Use X Instead of Wayland on Ubuntu 22.04

2 Best Ways to Use X Instead of Wayland on Ubuntu 22.04

Looking to switch from Wayland to Xorg on Ubuntu 22.04? I’ve got you covered.

If you’re encountering issues with Wayland or you just prefer the traditional X11 protocol, switching between them is straightforward. In this step-by-step guide, I’ll walk you through the simple process of making the switch.

Let’s dive in.

What You’ll Need

Before we start the tutorial, ensure you have the following prerequisites:

  • Ubuntu 22.04 installed and operational on your system (see guide)
  • Basic knowledge of the command line interface and Linux commands (see guide)
  • Root access or sudo privileges (see guide)
  • A text editor installed on your system

With these essentials in place, let’s dive into the first method.

How to Use X Instead of Wayland on Ubuntu 22.04: 2 Methods

Step 1: Check the Current Display Server

It’s important to identify which display server your system is currently using before making any changes. This knowledge makes it easier to switch to the other one.

Method 1: Using the Terminal

  1. Open the terminal either from the application grid or quickly by pressing Ctrl+Alt+T.
  2. In the terminal, run this command:
echo $XDG_SESSION_TYPE
Check display server

This command will display your current display server. If the output is wayland, then Wayland is the active display server.

Related: Best Terminal Alternatives For Ubuntu

Method 2: Using the Settings Menu

For those who prefer the graphical user interface (GUI) to check the display server, here’s how you can do it:

  1. Click on the Show Applications button, located in the left sidebar of your screen.
Application grid button on homescreen
  1. In the search bar, type ‘Settings’ and click on the Settings icon when it appears.
Ubuntu Settings
  1. Navigate to the About section within the Settings menu.
About in Settings on Ubuntu
  1. Look for Windowing System from the options. In my example, it indicates Wayland.
Windowing system on Ubunu

Now that you know which windowing system you’re using, let’s learn how to change it from Wayland to X11.

Related: How to Install Stremio on Ubuntu 22.04 LTS

Step 2: Switch to X From Wayland

Method 1: Switch to Xorg by Disabling Wayland

This method involves disabling Wayland in a configuration file to use Xorg instead.

  1. Open your terminal.
  2. Edit the /etc/gdm3/custom.conf file using a text editor. For example, to open it with Nano, use:
sudo nano /etc/gdm3/custom.conf
Editing the GDM configuration file on Ubuntu
  1. In the opened file, find WaylandEnable=true and change it to WaylandEnable=false. If you find #WaylandEnable=false, simply remove the # to uncomment it.
Editing the GDM configuration file on Ubuntu
  1. Save the file with Ctrl+O, then exit with Ctrl+X.
  2. Reboot your system using:
sudo reboot
# OR
sudo shutdown -r now
  1. Verify the current display server with:
echo $XDG_SESSION_TYPE
Check current display server on Ubuntu

The output should now show x11.

Related: How to Log in as Root in Ubuntu GUI 22.10

Method 2: Switch to Xorg via the Login Screen

This method doesn’t involve the terminal. However, you’ll need to reboot or at least log out from the current session to follow it.

  1. Click the menu in the top-right corner of your screen.
Ubuntu top right corner menu
  1. Go to the Power Off / Log Out option.
Ubuntu power off / log out option
  1. Click on Log Out.
Logging out from Ubuntu session
  1. You should see a new window appear notifying you that you’ll be logged out in 60 seconds. If you don’t want to wait, press the Log Out button to immediately log out of the session.
Logging out from Ubuntu session
  1. This should bring you to the login page. First, click on your profile name.
Ubuntu login screen
  1. Notice a cog icon appearing on the bottom-right corner of the screen. Click on that icon.
Settings button on Ubuntu login screen
  1. From the drop-up menu, select Ubuntu on Xorg.
Switching o Xorg on Ubuntu
  1. Log back in by entering your password.
  2. To verify the switch, check the current display server by accessing the Windowing System in the About section of your settings.
Ubuntu windowing system

The windowing system is ‘X11’ which means my switching was successful.

Related: How to Edit Config Files on Ubuntu

How to Switch Back to Wayland from X

Reverting to Wayland from X in Ubuntu 22.04 is a straightforward process. Simply follow these steps at the login screen:

  1. Access the menu in the top-right corner of your screen.
  2. Select Power Off / Log Out and then Log Out.
  3. At the login screen, click on your profile name.
  4. Click the cog icon located in the bottom-right corner.
  5. Select Ubuntu from the options to revert back to Wayland, as it is the default display server.
Switching to Wayland on Ubuntu
  1. To confirm the change, check the ‘Windowing System’ in the ‘About’ section of your settings, or run the following command in the terminal:
echo $XDG_SESSION_TYPE

And that’s how you can switch between Xorg and Wayland in Ubuntu 22.04.

Related: How to Switch Between CLI and GUI in Linux 22.10

Which One Should You Choose: Wayland or Xorg?

When deciding between Wayland and Xorg for your Linux system, it’s helpful to weigh their respective advantages and disadvantages. Wayland is the newer, more modern option, while Xorg has been the standard for many years. 

Below is a table that outlines the key pros and cons of each, providing a clear comparison to guide your choice:

AspectWaylandXorg
Pros✅ Modern with direct app-compositor communication.

✅ Simpler codebase.

✅ Enhanced security for GUI applications.
✅ Wide compatibility with various software.

✅ Large user base due to longer history.
Cons❌ Less compatible with some software, particularly games and graphics-heavy applications. 

❌ More prone to bugs due to its newness.
❌ More complex codebase. 

❌ Lacks GUI-level isolation, leading to security concerns.
ConclusionIdeal for users prioritizing modern features and security.Best suited for users requiring stable compatibility and a vast user base.

This comparison should help you determine which display server aligns best with your specific requirements and preferences.

Conclusion

Well done. You should now be able to use the X display server instead of Wayland on Ubuntu and even come back to Wayland if you feel like it. I’ve also done a quick comparison to show you which one is better for you. That should help you pick one of the two more easily.

If this guide helped you, please share it.

Related Posts