Run Multiple Desktops: How to Install GNOME Alongside KDE on FreeBSD
BSD Desktop Env FreeBSD Guide InstallationHi all, welcome back to MusaBase! If you've been following my recent guides for BSD systems, then you've already learned how to install FreeBSD and then KDE Plasma as your first desktop environment. In this follow-up, we'll continue the journey by installing and configuring GNOME on FreeBSD system alongside KDE Plasma. We'll add flexibility to our FreeBSD system to switch between two powerful desktop environments. In this guide, we'll learn how to:
- Prepare FreeBSD system for GNOME packages
- Download and install Gnome packages for FreeBSD
- Configure services needed by GNOME
- And finally launcing GNOME
By the end of this guide, you'll have a fully functional GNOME desktop running alongside KDE Plasma on your FreeBSD system, ready to use whenever you choose. So without further ado, let's get started!
Prerequisites
In this guide, I won't be installing FreeBSD, please read my FreeBSD Installation Guide, and follow all the steps explained in that article. After completing the installation come back to this guide and continue on installing GNOME desktop session.
Step 1: Prepare FreeBSD System
First things first, we need to update the FreeBSD OS itself and also update installed pacakges. It is important becuase by updating and upgrading system and system packages we ensure our system has the latest list of avaiable 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 in failed install.
1.1: Update FreeBSD OS
- Run:
doas freebsd-update fetch install
# OR
sudo freebsd-update fetch 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 GNOME package, it will contain meta packages with 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 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 procs, 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 enbale D-Bus, if you are installing an desktop environment on FreeBSD for the first time, then this is important. Without dbus 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 have already KDE Plasma installed and 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 use to only use 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:
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 ~/.xintirc add:
exec gnome-session
- After adding the 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 thing is set up and services are enable and configured, let start the GNOME session.
- Run:
startx
- After a few seconds, you will be in GNOME home screen:
Multi Desktop Session
If you have followed by Installing KDE Plasma on FreeBSD and you followed along this guide also to install GNOME then now you should have two desktop session installed. At the SDDM screen you should have option for multiple desktop session:
- Display managers like SDDM or GDM will automatically detect multiple sessions and list them to boot into at login screen.
- Simply select Plasma (X11) for KDE Plasma desktop session or select GNOME on Xorg for GNOME desktop session and enter your password to login.
Afterwards
Well now you have single or multiple fully functional desktop sessions. You can switch between any of them whenever you want. I'll upload guides on other desktop sessions or wayland compositor like Hyprland installation on FreeBSD also, stay tuned for that.
If you hit any error at any step or having problem while logging into desktop session, please let me know in the comments, I'll be more than happy to help.
This is it, 1O1 out, I'll see you in the next one!