How to Install Xfce Desktop in Arch Linux [Complete Guide]

6 min


This guide explains installing the latest Xfce desktop in Arch Linux. The guide explains the steps for the latest Xfce desktop release. However, it works for any Xfce version as well.

The first part of the guide explains the steps for installing the base Arch system. The second part is installing the complete Xfce desktop on Arch Linux.

What is the Xfce Desktop?

Xfce is an open-source Linux desktop environment. It is known to be a lightweight desktop, providing enough visual appeal and customisations to the users. Xfce desktop comes with modular packages contributing to the overall desktop feel.

Xfce desktop is an option for many Linux distributions as a lightweight flavour. Some important Xfce desktop features are Xubuntu, Debian Xfce edition, Linux Mint Xfce, MX Linux, Fedora Xfce edition, etc.

You can also install Xfce on top of a base install for Arch Linux. In this guide, we explain the steps for the same.

Install Xfce Desktop in Arch Linux

Part 1: Install Arch Linux

If you already have Arch Linux installed, you can skip this step and directly go to the install Xfce Desktop section below.

For a quick Arch Linux base installation, follow the installation guide using the archinstall automated script here. It’s the recommended method for installation.

If you want the legacy way of installing Arch Linux, follow the below steps.

Download Arch Linux

Download Arch Linux .iso from the below link. There are magnet and torrent links available. Once you download it, write the ISO to a USB drive. And then boot from the drive.

If you plan to install it as a virtual machine image via GNOME Boxes, virt-manager – you do not need to write it to a USB drive.

Boot and Configure Partitions

After you boot from the Arch Linux iso, you must run a series of commands to install the base system.

First, run the below command to find out the device identifier.

fdisk -l
fdisk -l before
fdisk -l before

Then with the device identifier, run the below command to start partitioning your disk. Make sure to change /dev/sda as per your system.

cfdisk /dev/sda

Select label type = dos the following prompt.

Select the free space and choose the option NEW from the bottom. In this example, I will create three partitions as per below.

/dev/sda1 - 1G - for /boot
/dev/sda2 - 5G - for root
/dev/sda3 - 1G - for swap
cfdisk
cfdisk

In the next screen, provide the partition size for the boot partition (for this example, I gave 1 GB). Select it as the primary partition.

Repeat the same step for the primary root partition of size 5GB.

Swap partition type change
Swap partition type change

Create a swap partition using the same steps with size 1G (you may change it as needed). After creating the swap partition, select Type at the bottom and mark it as a swap with the option “Linux Swap/Solaris”.

final partition list in cfdisk
final partition list in cfdisk

Once done, write the changes to the disk using the Write option at the bottom. Make sure you take a backup before you write, as this is a permanent change in your system.

Run the below command to check before you proceed. You can see in this example that three partitions are listed.

fdisk -l
final partition list in fdisk
final partition list in fdisk

Run the following commands to format and create an ext4 file system in the newly created partition above. Make sure you change the /dev/sda1 and /dev/sda2 as needed.

mkfs.ext4 /dev/sda1
mkfs.ext4 /dev/sda2
mkswap /dev/sda3
swapon /dev/sda3

After completion, mount the system and create the necessary directories.

mount /dev/sda2 /mnt
mkdir /mnt/boot /mnt/var /mnt/home
mount /dev/sda1 /mnt/boot

Again, make sure you change /dev/sda1, /dev/sda2 and /dev/sda3 as per your system.

prepare file system
prepare file system

Install the base system

I hope you are already connected to the internet. If not, try using a USB dongle or wired internet connection which the Arch installer automatically configures and detects. If you do not have a wired connection, follow this guide to configure a wireless or wifi network using the Arch Linux installer.

Run the below commands in sequence to install the base system in the mounted partition. The download size is approx 400 MB.

pacman -Syy
pacstrap /mnt base base-devel linux linux-firmware nano dhcpcd net-tools grub
Install base system
Install base system

Once complete, generate a file system table without which you can’t boot the system.

genfstab -U /mnt >> /mnt/etc/fstab

Configure the base system

Follow the below commands in sequence to configure the base system. This involves setting up your locale and language, adding a login user, and setting up the internet.

arch-chroot /mnt
nano /etc/locale.gen

Uncomment the locale of your choice by removing the # at the beginning. For this guide, I have chosen en_US.UTF-8 UTF-8. Press CTRL+O, Enter, and CTRL+X to exit from nano.

change locale
change locale

Generate the locale using:

locale-gen

Set up the language using the below command.

echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8

Set up the local time zone.

ln -s /usr/share/zoneinfo/America/New_York /etc/localtime

Again, you can choose them as per your need. You can list the local time zones via the below commands.

ls /usr/share/zoneinfo
ls /usr/share/zoneinfo/America

Set up the hardware clock, create a hostname and enable the DHCP for the internet using the commands below. You can change "arindam-pc" to any hostname as per your desire.

hwclock --systohc --utc
echo arindam-pc > /etc/hostname
systemctl enable dhcpcd

The next step is to set up the root user password, create an admin user, and add the user to the sudoers file.

Follow the below commands in sequence. Make sure to change the user name debugpoint to something else per your need.

passwd root
useradd -m -g users -G wheel -s /bin/bash debugpoint
passwd debugpoint
create user
create user

Open the sudoers file and add the below lines.

nano /etc/sudoers

Add the below lines. As you already created the root user, the entry should be there.

root ALL=(ALL) ALL
debugpoint ALL=(ALL) ALL
update sudoers file
update sudoers file

Install grub, set up the initial ramdisk environment, and unmount the system using the commands below.

grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
mkinitcpio -p linux
exit
configure grub
configure grub

Then reboot your system.

umount /mnt/boot
umount /mnt
reboot

You have now successfully installed the Arch Linux base system. It’s time to install the complete Xfce desktop.

Part 2: Install Xfce Desktop in Arch Linux

After reboot, choose Arch Linux from grub. In the Arch Linux prompt, start running the following commands in sequence. These commands install the Xorg server, lightdm display manager, Xfce desktop components, controller packages, and additional applications.

For all the commands, use the default, i.e. press enter when asked.

  • Install Xorg. Approx install size is 80 MB.
sudo pacman -S --needed xorg
  • Install additional components and applications (approx 144 MB)
sudo pacman -S --needed xfce4 mousepad parole ristretto thunar-archive-plugin thunar-media-tags-plugin xfce4-battery-plugin xfce4-datetime-plugin xfce4-mount-plugin xfce4-netload-plugin xfce4-notifyd xfce4-pulseaudio-plugin xfce4-screensaver xfce4-taskmanager xfce4-wavelan-plugin xfce4-weather-plugin xfce4-whiskermenu-plugin xfce4-xkb-plugin file-roller network-manager-applet leafpad epdfview galculator lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings capitaine-cursors arc-gtk-theme xdg-user-dirs-gtk
  • If the above command is too much to type, try to install xfce4-goodies group via the below command with the rest of the required packages (Thanks to Philip and others).
sudo pacman -S --needed xfce4-goodies file-roller network-manager-applet leafpad epdfview galculator lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings capitaine-cursors arc-gtk-theme xdg-user-dirs-gtk
  • If you are installing Arch + Xfce in a VirtualBox virtual machine, install the following package for guest additions. This is optional.
sudo pacman -S --needed virtualbox-guest-utils xf86-video-vmware

The above packages are just for reference. You can also install the ones you require.

Now it’s time to enable the display and network manager as a service. So that the next time you log on, they can run automatically by systemd.

systemctl enable lightdm
systemctl enable NetworkManager
Enable lightdm and network - Install Xfce Desktop in Arch Linux
Enable lightdm and network – Install Xfce Desktop in Arch Linux

Reboot the system using the reboot command.

reboot

You should see a lightdm login prompt on the Xfce desktop if all goes well. Login using the credentials you just created in the above steps. You should be greeted with the latest Xfce desktop environment.

lightdm login prompt
lightdm login prompt
Xfce Desktop in Arch Linux
Xfce Desktop in Arch Linux

I hope this guide helps you create your own Arch Linux environment with a lightweight Xfce desktop from scratch.

Please let me know if you run into trouble using the comment box below.


Arindam

Creator and author of debugpoint.com. Connect with me via Telegram, đť•Ź (Twitter), or send us an email.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

14 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments