How to Install GNOME Desktop Environment on FreeBSD

How to Install GNOME Desktop Environment on FreeBSD

How to Install Gnome on FreeBSD

Building a desktop on FreeBSD is like putting a luxury interior inside a heavy-duty industrial engine. It gives you the legendary stability of the Berkeley Software Distribution with an interface that is built for high-level productivity and seamless hardware integration.

Welcome back to MusaBase! If you have been following my recent series on BSD systems, you have already mastered the core installation of FreeBSD: The Power to Serve and learned how to set up KDE Plasma as a modern FreeBSD workstation.

In this follow-up, we will continue the journey by installing and configuring the GNOME desktop on your FreeBSD system. By setting this up alongside KDE Plasma, we will add incredible flexibility to our system, allowing you to switch between two of the most powerful desktop environments available. In this guide, we will cover how to:

  • Prepare your FreeBSD system for the GNOME software stack
  • Download and install the official GNOME packages for FreeBSD
  • Configure the essential services and display managers needed by GNOME
  • And finally launching your first GNOME session on FreeBSD

By the end of this guide, you will have a fully functional GNOME desktop running alongside KDE Plasma, ready for use whenever you choose. So without further ado, let's get started!







Prerequisites

Before we proceed, please note that this tutorial focuses solely on the desktop environment setup. You should already have a functional base system ready. If you haven't performed the initial setup yet, you can follow my comprehensive walkthrough on setting up FreeBSD from scratch.

Once your base installation is complete and you have your user privileges configured, you can return here to continue with the GNOME desktop session installation.




Step 1: Prepare FreeBSD System

First things first, we need to update the FreeBSD OS itself and also update installed packages. It is important because by updating and upgrading the system and system packages, we ensure our system has the latest list of available packages and their correct dependencies. If we continue without updating, the package installer might try to pull in outdated or missing packages, which will conflict in dependencies and may result in a failed install.

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 Installed Packages

  • Next, we can fetch and install updates with:
doas pkg update && doas pkg upgrade
# OR
sudo pkg update && sudo pkg upgrade



Step 2: Install GNOME

Next, we'll install the GNOME package, which contains meta-packages for the GNOME Desktop and Applications.

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

GNOME Lite

  • If you don't want the full GNOME with its extra packages, you can go with the minimal version.
  • Run:
doas pkg install gnome-lite
# OR
sudo pkg install gnome-lite



Step 3: Configure Fstab & Services

Next, we need to configure our fstab, rc.conf, ~/.xinitrc files and enable the d-bus service for our GNOME desktop session to run and work without any error.

3.1: Configure Fstab for /proc

  • Run:
doas nano /etc/fstab
# OR
sudo nano /etc/fstab
  • In the fstab file, add the following line accordingly:

# Device   Mountpoint  FStype   Options  Dump   Pass#
proc       /proc       procfs   rw       0      0
  • After adding proc, press CTRL + O to save the changes, then press ENTER to apply the changes, then press CTRL + X to exit the file.

3.2: Enable D-Bus

  • Next, we need to enable D-Bus. If you are installing a desktop environment on FreeBSD for the first time, then this is important. Without dbus, the desktop session won't launch.
  • Run:
doas sysrc dbus_enable="YES"
# OR
sudo sysrc dbus_enable="YES"

3.3: Enable GDM (For Single Desktop Session)

This step is optional. If you already have KDE Plasma installed and are using it as your desktop session from my previous guide, then you don't need to do this step. If you are installing only GNOME and intend to use only one desktop environment, then follow this step.

  • Run:
doas nano /etc/rc.conf
# OR
sudo nano /etc/rc.conf
  • In the rc.conf, add the following line:
gdm_enable="YES"
# OR
sysrc gdm_enable="YES"
  • After adding the gdm variable, press CTRL + O to save the changes, then press ENTER to apply the changes, then press CTRL + X to exit the file.

3.4: Add GNOME Session to ~/.xinitrc

  • Run:
doas nano ~/.xinitrc
# OR
sudo nano ~/.xinitrc
  • In the ~/.xinitrc, add:
exec gnome-session
  • After adding gnome-session, press CTRL + O to save the changes, then press ENTER to apply the changes, then press CTRL + X to exit the file.



Step 4: Launch GNOME Session

  • Now that everything is set up and services are enabled and configured, let's start the GNOME session.
  • Run:
startx
  • After a few seconds, you will be on the GNOME home screen:
Default GNOME desktop home screen on FreeBSD after a successful login.

Multi Desktop Session

If you have followed my Installing KDE Plasma on FreeBSD guide and you also followed this guide to install GNOME, then now you should have two desktop sessions installed. At the SDDM screen, you should have the option for multiple desktop sessions:

SDDM login screen on FreeBSD showing multiple desktop session options (Plasma, GNOME).
  • Display managers like SDDM or GDM will automatically detect multiple sessions and list them to choose from at the login screen.
  • Simply select Plasma (X11) for the KDE Plasma desktop session or select GNOME on Xorg for the GNOME desktop session, and enter your password to log in.


πŸš€ Dual Desktop Setup Complete!

Well, now you have a fully functional system with the flexibility to switch between multiple desktop sessions whenever you want. Whether you choose the modern workflow of GNOME or the polished experience of KDE, your FreeBSD workstation is now more versatile than ever. I will be uploading more guides on other desktop environments and Wayland compositors, such as Hyprland, so stay tuned for those updates.

Explore More FreeBSD Desktops

🌟 KDE Plasma: If you haven't tried it yet, check out my detailed guide on installing KDE Plasma on FreeBSD to complete your dual-setup.

XFCE Environment: For those looking for a lightweight and lightning-fast alternative, follow my walkthrough on how to install XFCE on FreeBSD.

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

If this guide helped you expand your FreeBSD experience, subscribe to the MusaBase newsletter for more BSD and Linux tutorials.
101 out, I’ll see you in the next one! πŸš€

Load comments