Step 2: Desktop Environment Installation
Welcome to the “Arch Linux Install Guide – Step 2: Desktop Environment (DE) Installation”. In this guide I will show you how to install popular DE such as GNOME, KDE, Xfce, etc.
Before we begin installing a Desktop Environment for our system, I will briefly explain to you some core notions and elements of the Linux GUI. This way, I believe, if you have an insight of the Linux GUI environment, the steps that are about to follow will come naturally to you. Of course, if you are already familiar with this topic, jump straight to the installation process!
Base Components of the Linux GUI
I will not dig deep into the abyss of the Linux GUI, but merely scratch its surface. At first, as a new Linux user, I came often across words like “GNOME”, “GNOME Shell”, “KDE”, “X11”, “xorg” and really didn’t understand what this words stood for, except that they were part of the Linux GUI. And to be honest, as an Ubuntu user, I did not really had the need to know. Only years later, when I started exploring Linux, these words started to make some sense to me! Thus I believe, if you are not “just and Ubuntu” user – as I once was – should be able to – or ought to – understand what these words represent. You should also be able to distinguish notions of the Linux GUI such as:
- graphics driver
- diplay server
- window manager
- graphical (desktop) environment
And I believe this not because you are about to write some exam on Linx GUI the next day, but because I truly believe that “knowledge is power”! And with this power your own killer customized Arch Linux system! Below is high level abstraction of the Linux GUI stack.
Display Server
A display server or window 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, a communications protocol, which can be network transparent or simply network capable Display Server. In other words, the display server controls and manages the low-level features to help integrate the parts of the GUI. For instance, display servers manage the mouse and help match the mouse movements with the cursor and GUI events caused by the cursor. But don’t get confused, the display server does not draw anything. They just manage the interface, libraries, toolkits, and as you can see, they communicate directly with the kernel.
Check a list of available display servers here: Display Server List – Wikipedia.
Communication Protocols
There are different sets of display server protocols and different display servers that implement a specific protocol. Here are some known protocols:
- X11 (X window system version 11)
- Wayland
- Mir (used only by Mir display server)
- SurfaceFlinger (used by Android’s SurfaceFlinger display server)
Often times, users may say they have X11 on their computer. They are referring to the fact that they have a display server installed on their computer that uses the X11 protocol. When a user installs an X11 library, they are installing a binding for the X11 protocol or some extension for X11-compatible software. X11 itself is not a program. However, many display servers use the X11 protocol (Display-Servers/Windowing-Systems – Linux.org).
The Wayland and Mir are projects that aim at replacing X11 while enhancing desktop performance, security and appearance.
Window Manager
A window manager (WM) is system software that controls the placement and appearance of windows within a windowing system in a graphical user interface (GUI). It can be part of a desktop environment or be used standalone. They determine the border, titlebar, size, and ability to resize windows.
Here are some known window managers:
Some window managers are instead designed to be used standalone, giving the user complete freedom over the choice of the other applications to be used. This allows the user to create a more lightweight and customized environment, tailored to his/her own specific needs.
Most importantly, some standalone window managers can also be used to replace the default window manager of a desktop environment, just like some desktop environment-oriented window managers can be used standalone too! In other words, you can for example use the the Xfce desktop environment together with the KWin display server (which in turn is part of the KDE Plasma).
Graphical Desktop Environment
Well, there is not much to say here (or maybe there is a lot to say here):
Yes! These are all desktop environments! They provide a complete graphical user interface for a system by bundling together a variety of display server clients. For a complete list of supported/unsupported desktop environments visit this page:
Display Manager or Login Manager
A display manager, or login manager, is typically a graphical user interface that is displayed at the end of the boot process in place of the default shell [ [ref]Display Manager – ArchWiki[/ref] ]. Don’t get confused with the window manager here. There are various implementations of display managers, just as there are various types of window managers and desktop environments.
For instance if you are going to install the Xfce (DE) you will notice that there is no graphical login environment. So this means, that you can either log-in using the command-line and then start Xfce or you can install a display manager such LightDM, which – after a successful login – will start Xfce for you.
The display manager basically concludes the high-level list of components of the Linux GUI. This means that you are ready to move on and install your Desktop Environment of your choice! Figure 2 sums up the process it takes you to install a Deskotop Environment in Arch Linux.
Compatibility
Not all window managers and widget-toolkits are compatible with all of the display servers. So, when installing display servers, window managers, or toolkits, make sure the desired GUI components are all compatible.
Also, keep in mind that display servers communicate directly with the kernel. Since display servers are so close to the kernel, this means display servers are operating system specific. For example, Xorg is a native X11 display servers for Linux. However, FreeBSD also uses Xorg, but it is a ported package.
Display servers that were designed for the Linux kernel will very likely work on Android as long as the ARM architecture and libhydris are supported. The Mir, Wayland, and X11 protocols are Android compatible. Display servers using these protocols are available for Android.
Desktop Environment Install Guide
For those who didn’t read the above sections, the installation of the Desktop Environment follows the below steps:
Install Display Server
Let’s install X-server:
pacman -S xorg-server xorg-server-utils xorg-xinit
Install Graphics Driver
It’s time to install video drivers. I assume you know which GPU you are using. If you do not know what graphics card you have, find out by issuing:
lspci -k | grep -A 2 -i "VGA"
My card is a NVIDIA GTX 460M so I’m going to install the nvidia package. I’m also on 64-bit Linux and I need 32-bit OpenGL support. Thus, I’m going to install the equivalent lib32 package from the multilib repository (lib32-nvidia-libgl).
sudo pacman -S nvidia lib32-nvidia-libgl
Optional:
Consider also the automatic re-compilation of the NVIDIA module with every update of any kernel.
>Warning: This will uninstall nvidia package.
yaourt -S nvidia-hook
Add ‘nvidia’ to the HOOKS array in /etc/mkinitcpio.conf:
sudo nano /etc/mkinitcpio.conf
The hook will call the dkms command to update the NVIDIA module for the version of your new kernel.
Wait!!?!?! I have a different Graphics Card… which driver should I install?
Nvidia
Install the appropriate driver for your card:
- For GeForce 400 series cards and newer [NVCx and newer], install the nvidia or nvidia-lts package, available in the official repositories.
- For GeForce 8/9 and 100-300 series cards [NV5x, NV8x, NV9x and NVAx], install the nvidia-340xx or nvidia-340xx-lts package, available in the official repositories.
- For GeForce 8/9 and 100-300 series cards [NV5x, NV8x, NV9x and NVAx], install the nvidia-340xx or nvidia-340xx-lts package, available in the official repositories.
- For GeForce 6/7 series cards [NV4x and NV6x], install the nvidia-304xx or nvidia-304xx-lts package, available in the official repositories.
- For the very latest GPU models, it may be required to install nvidia-beta from the Arch User Repository, since the stable drivers may not support the newly introduced features.
If you are on 64-bit and also need 32-bit OpenGL support, you must also install the equivalent lib32 package from the multilib repository (e.g. lib32-nvidia-libgl, lib32-nvidia-340xx-libgl or lib32-nvidia-304xx-libgl).
If you graphics card is not listed check Unsupported Drivers at ArchWiki.
ATI
The xf86-video-ati (radeon) driver:
- Works with Radeon chipsets up to HD 6xxx and 7xxxM (latest Northern Islands chipsets).
- Radeons in the HD 77xx (Southern Islands) series are mostly supported. Check the feature matrix for unsupported features.
- Radeons up to the X1xxx series are fully supported, stable, and full 2D and 3D acceleration are provided.
- Radeons from HD 2xxx to HD 6xxx have full 2D acceleration and functional 3D acceleration, but are not supported by all the features that the proprietary driver provides.
- Supports DRI1, RandR 1.2/1.3/1.4, Glamor, EXA acceleration and kernel mode-setting/DRI2.
- Generally, xf86-video-ati should be your first choice, no matter which AMD/ATI card you own. In case you need to use a driver for newer AMD cards, you should consider the proprietary catalyst driver.
Note: xf86-video-ati is specified as radeon for the kernel and in xorg.conf.
For 32-bit 3D support on x86_64, also install lib32-mesa-dri and lib32-mesa-libgl from the multilib repository.
sudo pacman -S xf86-video-ati lib32-mesa-dri lib32-mesa-libgl
Intel
Install the xf86-video-intel package from the official repositories and mesa-libgl (and lib32-mesa-libgl for 32bit support) for OpenGL support:
sudo pacman -S xf86-video-intel mesa-libgl lib32-mesa-libgl
Install the VA-API driver and library provided by the libva-intel-driver and libva packages respectively.
sudo pacman -S libva-intel-driver libva
There is no need for any configuration to run X.
GNOME
If you are using a laptop you need to install the drivers for input devices like touch-pad:
sudo pacman -S xf86-input-synaptics
Before you install GNOME, it is recommended to install ttf-dejavu, fontconfig-ttf-ms-fonts< font packages, in order to achieve an visually-appealing experience.
sudo pacman -S ttf-dejavu ttf-droid
yaourt -S fontconfig-ttf-ms-fonts
For the whole GNOME-experience you need to install gnome and gnome-extra packages:
sudo pacman -S gnome gnome-extra
As you can see, GNOME uses mutter as a window manager and gdm as a display manager. This means that we don’t have to install any display manager for our graphical log-in.
Now enable the gdm at system boot for graphical log-in:
sudo systemctl enable gdm.service
Reboot and welcome to GNOME!
KDE
If you are using a laptop you need to install the drivers for input devices like touch-pad:
sudo pacman -S xf86-input-synaptics
Before you install KDE, it is recommended to install ttf-dejavu, fontconfig-ttf-ms-fonts< font packages, in order to achieve an visually-appealing experience.
sudo pacman -S ttf-dejavu ttf-droid
yaourt -S fontconfig-ttf-ms-fonts
To install KDE run:
sudo pacman -S plasma
You will notice there are alot of dependencies! One of the is kdebase-workspace. This package basically contains kwin as a window manager and kdm as a display manager. This means that we don’t have to install any display manager for our graphical log-in.
For the Network Manager it is recommended to install plasma-nm:
sudo pacman -S plasma-nm networkmanager-openvpn # Disable dhcpcd sudo systemctl stop dhcpcd sudo systemctl disable dhcpcd # Enable NetworkManager sudo systemctl enable NetworkManager sudo systemctl start NetworkManager
Xfce
If you are using a laptop you need to install the drivers for input devices like touch-pad:
sudo pacman -S xf86-input-synaptics
Before you install KDE, it is recommended to install ttf-dejavu, fontconfig-ttf-ms-fonts< font packages, in order to achieve an visually-appealing experience.
sudo pacman -S ttf-dejavu ttf-droid
yaourt -S fontconfig-ttf-ms-fonts
To install Xfce run:
sudo pacman -S xfce4
As you can see, Xfce uses xfwm4 as a window manager, but no display manager. This means that we have to install some display manager that is compatible with Xfce in order to have graphical login. I recommend installing lightDM, as the development of SLiM has been abandoned.
Graphical Login
To install lightDM run:
sudo pacman -S lightdm lightdm-gtk2-greeter
Make sure to enable lightdm.service using systemctl so LightDM will be started at boot.
sudo systemctl enable lightdm.service
You might be experiencing this bug: https://bugs.freedesktop.org/show_bug.cgi?id=54168. Appears to affect ATI/Nvidia proprietary drivers and window manager themes with 1 pixel-wide borders.
Non-Graphical Login – Xfce autostart
add the following to the bottom of ~/.bash_profile :
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
If the file does not exist, copy a skeleton version from /etc/skel/.bash_profile:
cp /etc/skel/.bash_profile ~ nano ~/.bash_profile
More info: Start X at login
Network Manager
I also recommend installing Wicd Network Manager.
sudo pacman -S wicd wicd-gtk xfce4-notifyd python2-notify
Enable wicd at boot:
sudo systemctl enable wicd.service
Warning: Running multiple network managers will cause problems, so it is important to disable all other network management daemons. For instance, you might try to connect to a Wireless-Network but fail by receiving “Bad Password”. To resolve this, first, stop all previously running network daemons (like netctl, netcfg, dhcpcd, NetworkManager). Then, disable any existing network management services, including netctl, netcfg, dhcpcd, and networkmanager.
To install NetworkManager instead of Wicd, see below.
Thunar click to mount
There is a high chance to get “Failed to mount – Not authorized to perform operation.” error when trying to click and mount a drive on Thunar:
To fix it you have to edit the /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy file:
sudo nano /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy
find (ctrl+W)
<action id="org.freedesktop.udisks2.filesystem-mount-system">
and change the allow_active field to yes like below:
<allow_active>yes</allow_active>
Now you should be able to click and mount your drivers. It is also recommended to install the ntfs-fs tool to have full support of NTFS drives:
sudo pacman -S ntfs-3g
Cinnamon
If you are using a laptop you need to install the drivers for input devices like touch-pad:
sudo pacman -S xf86-input-synaptics
Before you install Cinnamon, it is recommended to install ttf-dejavu, fontconfig-ttf-ms-fonts< font packages, in order to achieve an visually-appealing experience.
sudo pacman -S ttf-dejavu ttf-droid
yaourt -S fontconfig-ttf-ms-fonts
To install Cinnamon run:
sudo pacman -S cinnamon nemo-fileroller
As you can see, Cinnamon uses muffin as a window manager, but no display manager. This means that we have to install some display manager that is compatible with Cinnamon in order to have graphical login. I recommend installing GDM.
sudo pacman –S gdm
Enable gdm on boot:
sudo systemctl enable gdm
Network Manager
If you want to manage your network connections from GUI you need to disable dhcpd service and install, enable and start Network Manager package.
Install Network Manager:
sudo pacman -S networkmanager network-manager-applet xfce4-notifyd gnome-keyring wpa_supplicant bluez
Disable dhcpcd service:
# use this to see your interface ip link # Disable dhcpcd sudo systemctl stop dhcpcd@<interaface>.service sudo systemctl disable dhcpcd@<interaface>.service sudo systemctl stop dhcpcd.service sudo systemctl disable dhcpcd.service
Enable Network Manager:
sudo systemctl start NetworkManager sudo systemctl enable NetworkManager