Install XFCE on FreeBSD: The Ultimate Lightweight Desktop Environment

Install XFCE on FreeBSD: The Ultimate Lightweight Desktop Environment

How to Install XFCE on FreeBSD

Hi all, and welcome back to MusaBase! In today's article, I will guide you through the process of installing and configuring the XFCE desktop environment on your FreeBSD system.

In our previous walkthroughs, we covered how to set up KDE Plasma as a modern FreeBSD workstation and how to configure GNOME for a dual-desktop FreeBSD setup. In this follow-up, we are adding XFCE to that same system, providing a lightweight yet powerful alternative. In this comprehensive guide, you will learn how to:

  • Prepare and configure your FreeBSD base system for XFCE
  • Download and install the official XFCE packages
  • Install the Xorg display server and the LightDM graphical login manager
  • Configure procfs entries and essential input services
  • Enable and initialize the necessary display services
  • And finally, log into your new XFCE desktop environment

By the end of this guide, you will have a fully functional XFCE desktop environment running smoothly on your FreeBSD system. So without further ado, let's get started!







Prerequisites

This guide focuses specifically on the desktop configuration and does not cover the initial OS setup. To follow along, you should have a clean, working installation of the system. If you haven't reached this stage yet, you can refer to my walkthrough on setting up a foundational FreeBSD environment.

Once your base system is up and running, return to this tutorial to proceed with the XFCE installation. Having a solid base configuration ensures that the graphical components and display services integrate seamlessly.




Why Choose XFCE?

XFCE is fast and lightweight desktop environment as compare to KDE Plasma or GNOME beacuse of its less consumption on CPU and is best suited for older hardware, limited RAM space or for a snappier response.

  • Older or low-spec hardware: XFCE will respond faster on Laptops or desktops with limited RAM/CPU.
  • Virtual machines: If you want to run FreeBSD inside a VM (as me), Xfce will consume fewer host resuources, leaving room for other tasks on host (e.g., browsing, coding, etc).



Step 1: Prepare FreeBSD System for DE

First, we need to update the FreeBSD OS itself and installed packages. Though its optional but, by updating and upgrading system and system packages we ensure our system is up-to-date and has the latest available packages and their correct dependencies. If we continue without updating, then the package installer might try to pull in outdated or missing packages, that will conflict in dependencies and may result failure in new package installation.

1.1: Update FreeBSD OS

  • Run:
doas freebsd-update fetch
doas freebsd-update install
#OR
sudo freebsd-update fetch
sudo freebsd-update install

1.2: Update Packages

  • Run:
doas pkg update && doas pkg upgrade
#OR
sudo pkg update && sudo pkg upgrade



Step 2: Install XFCE

Installing Xfce is really simple we only need to run a single command which will install XFCE and its required dependencies. But it will not install display server or login manager, we will do that in next step.

  • Run:
doas pkg install xfce
#OR
sudo pkg install xfce



Step 3: Install Display Server and Configure Services

Next, we need to install Xorg a display server, ligthdm a login manager. When we installed xfce meta package in the previous step, it only installed dependencies and other packages required by Xfce. In order to run an actual Graphical environment we need the display server and also configure our fstab for /proc filesystem.

3.1: Add proc entry at Fstab

  • Run:
doas nano /etc/fstab
#OR
sudo nano /etc/fstab
  • In the fstab file,add the following line:
#Device   Mountpoint    Fstype   Options  Dump   Pass#
proc      /proc         procfs   rw       0      0
  • After adding the entry, press CTRL + O to save the changes then press ENTER to apply the changes, then press CTRL + X to exit the file.

3.2: Install Xorg Display Server

  • Next, we will install our display server.
  • Run:
doas pkg install xorg
#OR
sudo pkg install xorg

3.3: Install Lightdm Login Greeter

  • Run:
doas pkg install lightdm lightdm-gtk-greeter
#OR
sudo pkg install lightdm lightdm-gtk-greeter

3.4: Enable Display Services

Now wth all packages are installed, we only need to enable D-Bus and lightdm and reboot the PC to log into our freshly installed Xfce desktop environment.

3.4.1: Enable D-Bus Service

  • To enable dbus, we need to add the its variable at /etc/rc.conf.
  • Run:
doas nano /etc/rc.conf
#OR
sudo nano /etc/rc.conf
  • In the opened file add:
sysrc dbus_enable="YES"

3.4.2: Enable LightDM

  • Do the same for lightdm:
doas nano /etc/rc.conf
#OR
sudo nano /etc/rc.conf
  • Add the following line:
sysrc lightdm_enable="YES"

3.5: Reboot

  • Run:
reboot



Step 4: Log into XFCE

After reboot your PC should have the following login screen:

freebsd-xfce-login-screen-for-xfce
  • Simply enter your user's password and you will be in XFCE home screen:
xfce-home-screen=on-freebsd-system


πŸš€ Your FreeBSD Desktop is Ready!

Well, now you have a fully functional XFCE desktop session up and running on your FreeBSD system. XFCE is known for being incredibly lightweight, making it a perfect choice for those who want a fast, stable experience without high resource consumption. I will also be exploring modern Wayland compositors like Hyprland for FreeBSD in future guides, so stay tuned for those updates!

Explore More FreeBSD Environments

πŸ’Ž KDE Plasma: If you prefer a more feature-rich and visually modern workspace, check out my tutorial on building a high-end FreeBSD workstation.

🎨 GNOME Desktop: For users who want a sleek, simplified, and tablet-friendly interface, follow my guide on optimizing the GNOME experience on FreeBSD.

πŸ› ️ Support & Feedback: If you hit any error at any step or have problems while logging into your desktop session, please let me know in the comments below. I will be more than happy to help.

FreeBSD offers incredible flexibility with its desktop choices. Switch between environments to find what fits your workflow best.
101 out, I’ll see you in the next one! πŸš€

Load comments