Xorg, X11, Wayland? Linux Display Servers And Protocols Explained

Have you ever wondered what X server, Xorg, X11, Wayland, and stuff like that do? Wayland vs. Xorg. This guide is for you!

You always stumble upon those terms and know they have to do with the graphics, but you’d like to learn more.

What is a Display Server in Linux?

A display server  is a program whose primary task is to coordinate the input and output of its clients to and from the rest of the operating system, the hardware, and each other. The display server communicates with its clients over the display server protocol.

The display server is crucial in any graphical user interface, specifically the windowing system. The basic component of the Graphical User Interface (GUI) sits between the graphical interface and the kernel.

So, thanks to a display server, you can use your computer with GUI. Without it, you would only be restricted to a command-line interface.

It is vital not to confuse the display server with a desktop environment. The desktop environments (Gnome, KDE, Xfce, MATE, etc.) use display servers.

The display server communicates with its clients over the display server protocol. There are three display server protocols available in Linux. X11 and Wayland are two of them. The third, Mir, is beyond the scope of this tutorial.

X Window System, Xorg, X11, Explained

X Window System

X Window System, often referred to merely as X, is old. First originating in 1984, it was the default windowing system for most UNIX-like operating systems, including Linux.

X.Org

X.Org server is the free and open-source implementation of the X Window System display server stewarded by the X.Org Foundation. It is an application that interacts with client applications via the X11 protocol to draw things on display and to send input events like mouse movements, clicks, and keystrokes.

Typically, one would start an X server which will wait for client’s applications to connect to it. However, Xorg is based on a client/server model and thus allows clients to run either locally or remotely on a different machine.

If it’s not obvious, it’s implicit in the design of X11 that the application and the display don’t have to be on the same computer. When X was developed, it was widespread that the X server would run on a workstation, and the users would run applications on a remote computer with more processing power.

X11

X11 is a network protocol. It describes how messages are exchanged between a client (application) and the display (server). These messages typically carry primitive drawing commands like “draw a box,” “write these characters at this position,” “the left mouse button has been clicked,” etc.

But X11 is old, and it was still a pile of hacks sitting on top of a protocol not overhauled for over 30 years. Most of the X Server protocol’s features were not used anymore.

All of the work that X11 did was redelegated to the individual applications and the window manager. And yet all of those old features are still there, weighing down on all of these applications, hurting performance and security.

Wayland, the Next-generation Display Server

Wayland was begun by Kristian Hogsberg, an X.Org developer, as a personal project in 2008. It is a communication protocol that specifies the communication between a display server and its clients.

Wayland is developed as a free and open-source community-driven project to replace the X Window System (also known as X11 or Xorg ) with a modern, secure, and more straightforward windowing system.

In Wayland, the compositor is the display server. The compositor is a window manager that provides applications with an off-screen buffer for each window. The window manager composites the window buffers into an image representing the screen and writes the result into the display memory.

The Wayland protocol lets the compositor send the input events directly to the clients and enables the client to send the damage event directly to the compositor.

As in the X case, when the client receives the event, it updates the user interface (UI). But in the Wayland rendering happens in the client, so the client sends a request to the compositor to indicate the region that was updated.

Wayland’s main advantage over X is that it starts from scratch. One of the main reasons for X’s complexity is that, over the years, its role has changed. As a result, today, X11 acts largely as “a really terrible” communications protocol between the client and the window manager.

Wayland is also superior when it comes to security. With X11, it’s possible to do something known as “keylogging” by allowing any program to exist in the background and read what’s happening with other windows open in the X11 area.

This simply won’t happen with Wayland, as each program works independently.

Conclusion

However, the X Window System still has many advantages over Wayland. Even though Wayland eliminates most of the design flaws of the Xorg, it has its issues. Even though the Wayland project has been up for more than ten years, things are not 100% stable.

As of 2022, most video games and graphics-intensive applications for Linux are still written for X11. Also, many closed-source graphics drivers, such as those for NVIDIA GPUs, do not yet offer complete support for Wayland.

X cannot last and Wayland, in many ways, is an improvement. But for now, the vast majority of native applications were written for Xorg. Until those apps are all ported, Xorg needs to be maintained. Wayland is not very stable yet, compared to Xorg.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Think You're an Ubuntu Expert? Let's Find Out!

Put your knowledge to the test in our lightning-fast Ubuntu quiz!
Ten questions to challenge yourself to see if you're a Linux legend or just a penguin in the making.

1 / 10

Ubuntu is an ancient African word that means:

2 / 10

Who is the Ubuntu's founder?

3 / 10

What year was the first official Ubuntu release?

4 / 10

What does the Ubuntu logo symbolize?

5 / 10

What package format does Ubuntu use for installing software?

6 / 10

When are Ubuntu's LTS versions released?

7 / 10

What is Unity?

8 / 10

What are Ubuntu versions named after?

9 / 10

What's Ubuntu Core?

10 / 10

Which Ubuntu version is Snap introduced?

The average score is 68%

14 Comments

  1. Fascinating, but how does one use it? Maybe you can point to as tutorial. I’m trying to get my x-client to display on my x-server running wayland.

  2. But X is available under Wayland as XWayland. That makes it not a big deal to run under Wayland and let X applications run with xwayland ???

    • In my experience, Wayland should be abandoned. It doesn’t do half of what X does, and at this point (after more than 10 years of development) probably never will. I just wasted an entire day trying to get Wayland to do fundamentally simple things that X has done for many years (such as display at higher than 1024×768). With my three monitors, Wayland displays content on one monitor but requires interacting with that content on a completely different monitor. Imagine an OK button on screen 0, but having to try to click on that button on screen 2 (or any combination of monitors that is not the correct one).

      And that’s just the start. Wayland told me that it is incapable of determining monitor resolutions, so “I’m going to use 1024×768, and **** you!”

      Okay, so that wasn’t a direct quote, but it may as well have been. After hours of trying to get Wayland to do anything even remotely related to being a display manager, I gave up and returned the sentiment. I had to reinstall an older version of Kubuntu that still used X11 (20.04). I will stay with it until the end of time if necessary.

      If anything is going to drive hardened Linux veterans like me (I’ve been using Linux desktops for 30 years now) back to Windows, it will be Wayland. It f****ng sucks!

  3. I think X is on top of Wayland as a compatibility layer.
    Once people start writing apps to Wayland, XWayland (X over Wayland) will see less and less use.
    It it not?

  4. Came across this article after suddenly seeing errors on my CentOS 8 server when I tried to give a remote support tech access to troubleshoot an issue with backup software. We were trying to use Team Viewer which worked fine before I migrated from CentOS 8 to CentOS 8 Stream. Now I get an error when trying to launch a connection “Wayland detected, incoming connection will fail” or something to that effect. Now I need to search for an alternative remote support program or find a workaround. Anyone know if Wayland can be temporarily disabled? Since it seems to be a new feature of CentOS 8 Stream I don’t want to try to completely uninstall it.

  5. The ability to insert a network connection between the application and the display server is IMMENSELY important. It allows me to run a full linux desktop remotely through SSH from tiny machines that usually bog down with running a full desktop as well as their industrial or scientific applications. X11 allows all that rendering power to be done remotely on a desktop, at the resolution of the desktop! relegating all that to a tiny machine running a VNC application on top of the machines main applications will ruin their usability and performance!!!! I sincerely hope that Wayland becomes only an alternative for some users and lazy developers, and that X11 will ALWAYS be available in the future.

    • Most usecases do not see users SSHing to external graphical sessions. In fact, I would argue that the most common usecase today is local machine processing and rendering. This makes Wayland a more sensible choice over Xorg. And even then, suppose that you do need to connect to a remote graphical environment – Wayland is still able to do so, just in a less elegant way compared to Xorg which has the feature integrated by design. This is perfectly fine as most users will not see much use out of it.

      • I agree with Joe that the remote X11 capability is important as there are some of us old time Unix/Linux users that still use that functionality. I realize most linux users probably don’t even know it exists but it’s sure handy to ssh -X to a server and launch any X app using your local display. I’ve been using this feature since about 1989 and hate to see it go away.

      • “This is perfectly fine as most users will not see much use out of it.” No, it is NOT perfectly fine, it is a COMPROMISE made based on some power users with the right idea, being a minority. I am exaggerating the specific example’s significance to make a point, note!
        IF one defines ‘good’ and ‘bad’ (including in design decisions) by what is popular, it is a dangerous logic. Also quite anti-FOSS or Linux principles.
        Eventually, people’s perception is what gets manipulated to PERCEIVE the software as better, instead of the actual code and design BEING made actually better.
        See how popular software bloat is for obvious example. Just because most people think it is “perfectly fine” to have to get a new PC every three years or whatever due to bloat making their old one slow down.
        Or how most people hate their own privacy, in effect. They think it is “perfectly fine” to be spied upon even if it rigs elections and leads to Government tyranny. It can’t be their fault, with their insane positivity bias. But that is a long psychological story…
        Sometimes, the minority are right or at least respectable in how they want to do things. Also, not always, but often, when software is made efficient enough for the power users, on slow hardware, it is extra-efficient from a less demanding users’ perspective, too. Win/Win.
        BUT – it typically does require front-loading the curve of the graph for investment of time and resources into the software’s development. Then continuing that investment until quality is achieved. Or simply approaching the design with intelligence and lean efficient code. Although with FOSS it can be forked, so the effort isn’t wasted, of course! But better to get it done right first time and set a standard if possible. Not make poor excuses and compromises. Again, takes lots of resources and time which not many people have. But where there is a will, there is a way.
        Just because bloat is popular (including human physical obesity come to think of it) does not mean that it isn’t worth the effort avoiding it where possible.

  6. Yeah… Wayland isn’t exactly ready. Forget about games, graphics-intensive applications, and TeamViewer… Gnome Shell itself seems not to be fully compatible. One of my Gnome extensions (I have no idea each one as systemctl -xef only tells me it’s a problem with gnome-shell) is bringing the Gnome Shell default top panel to its knees (it doesn’t even appear, so logging off requires some hocus pocus) when Wayland is used, even though in X11 it’s perfectly (for various values of “perfectly”) fine. Some would say Gnome itself isn’t ready these days too… They wouldn’t necessarily be wrong…

  7. Isn’t this a good thing? Getting x11 to split into wayland and xlite(hypothetically). For x can get back to it roots. For you don’t have to choose. You just use the best tool.

  8. I lever liked Gnome and never will. Plasma works allright with wayland. I want a small efficient desktop with wayland. I allways liked Enlightenment and I have tried Lxqt. IF both can deal with wayland well I am happy. I think wlroots should be more supported in distros. X11 has been debated for allmost 40 years it is time for wayland now.

  9. I currently use Wayland on Oracle Linux because it’s the default option. It works fine but I don’t know about games as I haven’t tried it out that much in that way.
    I think it’s one of the most controversial things ever in the Linux community. How it’s forced onto people is disgusting. There’s nothing wrong with X11! Whatever happened to FREE and open source, but where is the outrage? People bash open source like no tomorrow. They won’t criticize Steam and now there’s Wayland and people just blindly accept it. X11 doesn’t have to go. It’s the attitudes that have to go. Linux has too many computer enthusiasts as users.

Leave a Reply

Your email address will not be published. Required fields are marked *