Maximum PC

Wayland strikes back

Ubuntu 21.04 attempts to reintroduc­e Wayland as the default desktop server. Will it succeed second time around?

-

THE HEADLINE NEW FEATURE in Ubuntu 21.04 is that Wayland has been restored as the default windowing system. After one previous failed attempt to replace the aging, if trusty, Xorg server back in Ubuntu 17.10, the folk at Canonical hope that second time’s a charm and have given themselves a year to make this attempt stick before the next LTS is released.

So, what exactly does a display server do? It provides your PC with the means to run graphical environmen­ts powered by desktops like GNOME, enabling you to point and click rather than spend all your life at the command line. Think of it as a connecting layer that sits between the kernel and your chosen desktop environmen­t.

For decades, Linux has relied on the X Windows display server, which since 2004 has existed in opensource form via the Xorg fork. It has been constantly evolving since the 1990s but is finally creaking under the twin burdens of increasing­ly unwieldy code and the demands of new graphic technologi­es.

In 2008, Wayland was born as a replacemen­t to X. It aims to provide a simpler, slimmer, and more secure alternativ­e, so what’s not to like? It simplifies things by unifying the various elements involved in rendering graphical displays, including compositor, display server, and window manager, in a single protocol.

It’s slimmer because it drops the client-server architectu­re of X, which enables you to connect to a server from a client machine via a desktop environmen­t as opposed to simple SSH. Wayland’s reasoning is that most users don’t need this overhead—and if you do, it’s not a problem, as the box (left) on XWayland reveals.

It’s also designed to be future-proof. X struggles with supporting high-resolution displays and multi-GPU setups, two things (among others) that Wayland can actually handle. And finally, Wayland is more secure. Xorg enables applicatio­ns to read output from and send input to any other applicatio­n, which can be easily exploited by keyloggers and other forms of malware. Wayland forbids this behavior.

ACCESSING WAYLAND

With Ubuntu 21.04’s release, Wayland is once again the default desktop server. You shouldn’t notice any difference—GNOME is still the desktop, and the only difference is that it’s running on top of Wayland rather than X. You can verify this by navigating to the About page under Settings and examining what’s listed next to Windowing System.

If you see Xorg listed as the windowing system, we’d bet on the fact your PC sports Nvidia graphics running off a proprietar­y Nvidia driver rather than the opensource, less powerful Nouveau driver.

Nvidia has long dithered on improving its support for Wayland, but it seems the fact its drivers are blocked from using Wayland—largely because they don’t support hardware accelerati­on of X programs under XWayland—has finally stung the graphics card manufactur­er into action, having sat on the issue since it was first reported back in April 2019.

To cut a long story short, the next major driver release (the v470 series) will contain two patches that finally support hardware-accelerate­d OpenGL rendering and Vulkan rendering with XWayland. However, this suggests that it won’t be until Ubuntu 21.10 when full Nvidia support for Wayland will be implemente­d.

In the meantime, if you want to switch to Wayland now, you have two choices. You can open Software & Updates settings and switch back to Nouveau via the Additional Drivers tab. Alternativ­ely, you can remove the blocks put in place to prevent Wayland from running

under Nvidia drivers by tweaking several system files. Our step-by-step guide (below) reveals how to achieve this. Note, however, that you’re likely to encounter performanc­e and compatibil­ity issues—we noticed stuttering in YouTube videos in Firefox, for example— and so we’d suggest sticking with X or switching to the Nouveau driver.

THE TROUBLE WITH WAYLAND

While things have undoubtedl­y improved (yay, screengrab­s!– Ed) since Ubuntu’s last abandoned attempt to make the switch to Wayland, there are still some outstandin­g issues to consider. If you like Ubuntu but don’t like GNOME, then be wary of switching to another desktop without first checking whether it’s Wayland-compatible. KDE Plasma 5 and Enlightenm­ent e20 are compatible, for example, but the popular Cinnamon desktop still only works with X.

While XWayland enables programs that are built around X to continue working, on the whole, Wayland’s security architectu­re does create problems elsewhere. For example, screen sharing and remote desktop applicatio­ns that rely on X won’t work in XWayland without specific fixes. Developers should look into technologi­es such as PipeWire and xdg-desktoppor­tal-wlr, that can resolve such issues.

End users shouldn’t worry too much: solutions to key problems have already been integrated into Ubuntu 21.04. For example, GNOME’s built-in Remote Desktop tool supports the popular VNC remote desktop protocol out of the box. To make your PC accessible to others, simply navigate to Settings>Sharing, flick the big switch on and then click Screen Sharing to set it up, all without installing any other programs.

Looking for a live-streaming or screen-recording tool that works in Wayland? OBS Studio 27.0 sees the efforts of one diligent developer to integrate native Wayland support (you can read about his “long road” at http://bit.ly/lxf277obs). If version 27 isn’t available to install via snap by the time you read this, try the current flatpak release instead, which incorporat­es the plugin required to stream or record Wayland windows.

FIXES AHOY

Elsewhere, developers are keen to incorporat­e native Wayland support into their tools. In many cases, the fixes are upstream via the APIs and other elements used to build their applicatio­ns, so they may be forced to wait on these. For example, the versions of Firefox and LibreOffic­e that ship with Ubuntu 21.04 both natively support Wayland, but Thunderbir­d still requires XWayland. Blender 2.90 recently launched with initial Wayland support (you need to build it with the WITH_ GHOST_WAYLAND option), while Wine’s developers are working to implement native Wayland support, with several unreleased patches demonstrat­ing future Wayland functional­ity, such as copy and paste, drag and drop, and the ability to change the display mode.

Canonical has given itself a year to iron out any issues with Wayland before the next LTS release. Our bet is that come Ubuntu 22.04 LTS’s release next year, Wayland will be the default windowing system on all PCs, including those running Nvidia graphics.

If this sounds like an unnecessar­y faff, or your favorite programs refuse to work with Wayland, then log out of your current session, click your username, and then click the

Settings button to switch to GNOME with Xorg.

 ?? ?? OBS Studio supports Wayland natively. The simplest way to get it is to install through Flatpak.
OBS Studio supports Wayland natively. The simplest way to get it is to install through Flatpak.

Newspapers in English

Newspapers from United States