Learn Linux 101: Graphical desktops
Choose a desktop that works for you
In this tutorial, learn abut Linux desktops and how to access them.
- Popular desktops – KDE, GNOME, and Xfce
- Protocols used to access desktops locally and remotely, including X11, XDMCP, VNC, SPICE, and RDP.
Using and accessing Linux desktop environments
A Linux desktop environment is a collection of applications designed to work well with each other and provide a consistent user experience. A desktop environment is usually paired with a login manager. The login manager, also known as a greeter or display manager is started automatically at system initialization. The login manager is an X Windows (or Wayland) application to help users log in locally or remotely and possibly choose a different desktop environment. The login manager desktop environments typically include one or more panels, an application launcher, a file manager, a settings manager, and a compositing window manager all with a consistent look and feel.
In this tutorial, I focus on KDE, GNOME and Xfce, although several other desktops are available.
You can access your local desktop, a remote desktop, or a desktop in a virtual machine. I will introduce you to some of the protocols used for this, including X11, XDMCP, VNC, SPICE, and RDP.
This tutorial helps you prepare for Objective 106.2 in Topic 106 of the Linux System Administrator (PIC-1) exam 102. The objective has a weight of 1. This tutorial reflects the Version 5.0 objectives as updated October 29, 2018.
To get the most from the tutorials in this series, you need a basic knowledge of Linux and a working Linux system on which you can practice the commands that are covered in this tutorial. You will also need a thorough understanding of the material covered in Learn Linux, 101: Install and configure X11. Sometimes, different versions of a program format output differently, so your results might not always look exactly like the listings and figures that are shown here. The examples in this tutorial come from Fedora 30 with GNOME desktop or Xfce desktop, , Ubuntu 18.04.2 LTS with Gnome desktop, and OpenSUSE Tumbleweed (5.2.5-1 kernel) with KDE Plasma desktop.
GNOME, KDE, and Xfce are popular desktop environments that are available on most distributions. The project home pages describe them as follows:
- GNOME is an easy and elegant way to use your computer. GNOME 3 is designed to put you in control and get things done.
- KDE Plasma is KDE’s flagship product, offering the most customizable desktop environment available. The KDE community has the driving goal of making it simple by default, and powerful when needed.
- Xfce is a lightweight desktop environment for UNIX-like operating systems. It aims to be fast and low on system resources, while still being visually appealing and user friendly.
Most distributions include with a default desktop, such as GNOME for Fedora or KDE for OpenSUSE. Some distributions have spins or flavors available which already have a preconfigured desktop of your choice. For example, Fedora and Ubuntu both have spins with Xfce as the desktop. If you cannot find a spin that you like, you can install another desktop and then install your desired desktop. Or you can perform a custom installation without a desktop and then install your chosen desktop.
Desktops usually include the following features:
- A login manager for a user to log in and potentially choose among several available desktops
- A window manager to allow multiple applications to be run and displayed concurrently
- An ability for each user to customize their own desktops
- A program launcher to launch programs
- Support for multiple displays
- Easy access to settings such as display, keyboard, mouse, accessibility, sound, and other system features
- Convenience widgets to display or change time, network connections, or other things such as audio volume
- Multiple workspaces to help you group programs
The GNOME desktop
Figure 1 shows a GNOME desktop on Fedora 30 with three applications open. The title bar has an application launcher on the left, a date/time display in the center, and settings access on the right. In this example, the settings menu is open and I have expanded the information for the currently logged user to display options such as Log Out. The small icons just below the cursor allow access to settings, screen lock, and power options to restart or shut down the computer.
Figure 1. GNOME desktop on Fedora 30 with three applications open
Click the date/time widget to see additional information such as Figure 2. You may see messages about available software updates, certain errors, or status messages. I have world clocks displaying the time in Darwin Australia, Basel Switzerland, as well as my home time in Raleigh, NC.
Figure 2. GNOME desktop information available from date/time widget
The title bar option on the left gives access to applications. The organization of application access differs widely among desktops as I will show you in other examples. GNOME on recent Fedora releases shows a list of favorites and running applications in the list on the left. The windows of running applications are displayed on the desktop and the right hand side shows an iconized form of the two workspaces that are running. A square 9-dot icon at the bottom of the list of applications is to show additional applications.
Figure 3. Accessing applications on GNOME in Fedora 30
If you click the 9-dot icon, then frequently used applications are shown. Two buttons at the bottom of the screen allow you to switch between frequently used applications and all applications.
Finally, you can use the search box to search for applications by typing some matching characters.
The GNOME desktop on Ubuntu 18.04 differs somewhat from the Fedora 30 one, illustrating a small part of the possible customization. The favorites are displayed as icons on the left of the desktop and mounted drives as well as a trash icon are also shown. There is a 9-dot icon at the lower left to access applications similar to the icon found on many smart phones as well as at the bottom of the Fedora application list. The background and color themes are different. These can usually be changed directly through the desktop settings menu. Some changes might require an additional tool such as the GNOME tweaks package. Figure 4 shows a GNOME desktop from Ubuntu 18.04.
Figure 4. GNOME desktop on Ubuntu
If you click the 9-dot icon to show installed applications, you can see a window such as that shown in Figure 5. The three dots on the right of the screen allow access to additional pages of applications.
Figure 5. Show applications on Ubuntu GNOME desktop
The KDE desktop
the KDE (originally the Kool Desktop Environment) project was announced in 1996. It has long been the default on SUSE systems and is now available in many spins, including Ubuntu and Fedora versions. I use illustrations from the rolling OpenSUSE Tumbleweed, updated on August 2019.
The KDE desktop shows a folder representing mounted drives on my system. In Figure 6, I have opened a terminal window and Konqueror. Both are listed on the task bar at the bottom of the screen. Access to additional applications is through the icon at bottom left which opens a cascading series of menus. In Figure 6 GIMP, which is in the Graphics collection, is highlighted. There is also a search box to help you find applications and provide ready access to system functions, such as logging out or restarting the computer.
Figure 6. KDE desktop on OpenSUSE
At the right hand end of the KDE task bar are a number of small icons for quick access to items such as date and time, volume control, clipboard contents, and status notifications. Figure 7 shows an example of the Status and Notifications pane.
Figure 7. Other KDE desktop features
The Xfce desktop
Xfce is is a lightweight desktop environment that is available in spins for Fedora and Ubuntu (as Xubuntu) among others. Packages can also be installed on distributions that do not have a prebuilt spin for Xfce.
Figure 8 shows an Xfce desktop with three open windows. There is a task bar at the top and a pane at the bottom. Like KDE, favorites and a trash bin have icons on the desktop. All available drives are also shown as icons, with mounted drives distinguished by a different color. In my case, the mounted drives are white and the unmounted drives are gray.
Figure 8. Xfce desktop on Fedora 30
Also similar to KDE, the application launcher at the left of the task bar opens a cascading menu and running applications have a quick access icon on the task bar. The task bar also allows quick access to the four active workspaces and the small icons for each give an idea of what might be running in them. Located at the right end of the task bar and similar to other desktops, there is also a clock and quick access to network settings, and logout/power options.
Figure 9. Xfce application launcher
You can quickly add items to the quick launch pane at the bottom of the screen. Among other default options, this is where you find the application search function in the form of a magnifying glass. Figure 10 shows my search looking for “tweak” to find tweak tools. Note the partially transparent hover help.
Figure 10. Searching for applications in Xfce
Logging in and changing desktops
In the early days of the X Window System, it was not uncommon to log in to a text screen and then use a command such as
startx to start X. Desktop environments are usually paired with a login manager (or desktop manager) that starts X when the system starts and then provides a graphical login capability. Although a login manager such as GNOME Display Manager (GDM) is usually associated with a particular desktop environment (GNOME in this case), a user may want to use a different desktop environment. So the login manager will usually have a way to select from installed desktops. Figure 11 shows the GDM login manager for the Fedora 30 system I have been using in this tutorial. There is a small gear icon next to the password entry field. Click it to see the available desktops and select one. .
Other desktops expose this selection capability in other ways. For example, Open SUSE Tumbleweed with the KDM login manager has a drop-down selection box near the bottom left of the login screen on my system.
Figure 11. Selecting a desktop using the GDM display manager
If you are already logged in and want to know what other desktops are installed, you can view the list in /usr/share/xsessions as shown in Listing 1.
Listing 1. Installed desktops
ian@attic4-f30 ~]$ ls /usr/share/xsessions/ enlightenment.desktop gnome.desktop i3-with-shmlog.desktop fvwm.desktop gnome-xorg.desktop openbox.desktop gnome-classic.desktop i3.desktop xfce.desktop
Installing additional desktops is beyond the scope of this tutorial, but if you want to install a particular desktop be aware that you might need to install a package group rather than just one individual package. You can get more information using the appropriate package management tools for your distribution using ideas and commands similar to those shown in Listing 2.
Listing 2. Searching for desktop package groups and displaying information about KDE
[ian@attic4-f30 ~]$ dnf group list "*[dD]esktop*" Last metadata expiration check: 0:03:12 ago on Fri 16 Aug 2019 07:11:36 PM EDT. Available Environment Groups: KDE Plasma Workspaces LXDE Desktop LXQt Desktop Cinnamon Desktop MATE Desktop Sugar Desktop Environment Deepin Desktop Basic Desktop Installed Environment Groups: Xfce Desktop
Listing 3 shows the information available on Fedora 30 for the KDE Plasma Workspaces group.
Listing 3. Displaying information about the KDE package group
[ian@attic4-f30 ~]$ dnf group info "KDE Plasma Workspaces" Last metadata expiration check: 0:03:25 ago on Fri 16 Aug 2019 07:11:36 PM EDT. Environment Group: KDE Plasma Workspaces Description: The KDE Plasma Workspaces, a highly-configurable graphical user interface which includes a panel, desktop, system icons and desktop widgets, and many powerful KDE applications. Mandatory Groups: Administration Tools Common NetworkManager Submodules Core Dial-up Networking Support Fonts Guest Desktop Agents Hardware Support Input Methods KDE Multimedia Printing Support Standard base-x Optional Groups: 3D Printing Cloud Management Tools Firefox Web Browser KDE Applications KDE Educational applications KDE Multimedia support KDE Office KDE Telepathy
Protocols for remote desktop access
In Learn Linux, 101: Install and configure X11 I showed you how to access a remote X application using several methods. In the remainder of this tutorial I will briefly discuss the protocols that are available to help you remotely access the whole desktop rather than a single application. These protocols are for systems running X11. Wayland is designed to address many of the security exposures in X11 and many of these are left open by the remote protocols. At the time of writing (August 2019) it is easier to access a target system’s desktop remotely using X11, but you also need to consider security. In general, you should try to tunnel your X session or desktop over a Secure Shell (SSH) session, if possible. Doing this means that you need to open fewer ports and leave fewer exposures into your system.
X and XDMCP
Systems with the X Window System usually have a
startx script that is often started automatically as part of system initialization. Alternatively, a system can be started without X (in runlevel 3) and then a console user can run
startx. When run at initialization,
startx usually presents a login manager such as GDM. If a user logs into a console in runlevel 3 and then runs
startx, it will typically open the user’s default or last used desktop environment, although any window manager or even an X application could be started. The display used will be a local display attached to the computer where the command is run. So how do we get remote access?
Prior to the advent of low-cost personal computers, X terminals were an advanced terminal incorporating an X server, but lacking general computing capabilities. They supplanted older terminals that provided a character-only interface – commonly 24 or 26 lines with 80 characters per line. The X Display Manager Control Protocol (XDMCP) is an X.org standard with the stated goal to “provide a uniform mechanism for an autonomous display to request login service from a remote host. By autonomous, we mean the display consists of hardware and processes that are independent of any particular host where login service is desired. (For example, the server cannot simply be started by a fork/exec sequence on the host.) An X terminal (screen, keyboard, mouse, processor, network interface) is a prime example of an autonomous display“.
So early X terminals used XDMCP to communicate with a host and provide X services to a user.
Two clients, Xnest and Xephyr were often used to provide a nested X server capability, allowing a user to connect from an active X Window System desktop and run a remote desktop over XDMCP in a window.
Today, X tunneling is a more secure way to transport X between network connected systems.
Another graphical desktop sharing system is Virtual Network Computing (VNC). It uses the the Remote Framebuffer (RFB) protocol to interact with another computer. VNC is platform independent and there are many client and server implementations for different operating systems. TigerVNC is currently popular on many Linux systems.
VNC can be used by a help desk for remote trouble shooting and by a user wanting to access an office desktop from a home computer or while traveling. It consists of a server part that is run on the computer whose desktop is to be shared and client parts that run on systems wishing to access the server. Multiple clients can access a single server. You can either open the ports used by VNC in your firewall, or you can use SSH to tunnel X with VNC.
Figure 12 shows a Linux Mint system with a terminal window where I launched the TigerVNC viewer and the desktop from Fedora 30 running on another system. After the remote desktop’s window is up and running, you interact with it as you would on the remote system. In this example, I clicked the application launcher and then the 9-dot application menu.
Figure 12. Linux Mint with a Fedora 30 GNOME desktop window
The SPICE project describes itself as aiming to “provide a complete open source solution for remote access to virtual machines in a seamless way so you can play videos, record audio, share USB devices and share folders without complications“. Refer to the SPICE home page.
The SPICE project describes four components: protocol, client, server, and guest. The protocol is the specification in the communication of the three other components; A client such as remote-viewer is responsible to send data and translate the data from the Virtual Machine (VM) so that you can interact with it; The SPICE server is the library used by the hypervisor in order to share the VM under the SPICE protocol; And finally, the guest side is all the software that must be running in the VM in order to make SPICE fully functional, such as the QXL driver and SPICE VDAgent. (/www.spice-space.org)
SPICE is currently targeted at the QEMU (short for Quick Emulator) in virtual machine environments.
Remote Desktop Protocol (RDP) provides a user with a graphical interface for a client computer to connect to a server computer over a network connection. It is a proprietary protocol developed by Microsoft. As with VNC, you use client software on the client end which connects to server software on the server end.
Server implementations on Linux are available from xrdp and FreeRDP. The xrdp server works with several RDP clients, including FreeRDP, rdesktop, NeutrinoRDP and Microsoft Remote Desktop Client (for Windows, macOS, iOS, and Android). The FreeRDP implementation has both server and client parts available.
This concludes your introduction to Topic 106.2 Graphical Desktops.