FreeBSD is an outstanding platform. It’s about as reliable an operating system as you will ever find. And FreeBSD is equally as good as a desktop as it is a server.

However, the one caveat to using FreeBSD is that it doesn’t install with a desktop environment. Although the process for installing a desktop environment on this platform isn’t impossible, it’s not quite as straightforward as you might find on a typical Linux operating system.

To that end, I want to show you how to install the GNOME Desktop Environment on top of a fresh instance of FreeBSD. This is done completely from the command line, so prepare to type.

SEE: Disaster recovery and business continuity plan (Tech Pro Research)

What you need

To accomplish this, you’ll need a running FreeBSD installation, the admin password, and a bit of time. That’s it.

Update/upgrade

Before we install GNOME, it’s best to update and upgrade FreeBSD. To do that, log into your instance and issue the command su. Type the root user password and then update the package manager with the command:

pkg update

Once the update completes, upgrade with the command:

pkg upgrade

Allow the upgrade to complete, and you’re ready to go.

Install GNOME

GNOME can be installed on FreeBSD with a single command:

pkg install gnome-desktop gdm xorg gnome3

That will take care of the installation process.

Enable the mouse, dbus, hal, and gdm daemons

Because FreeBSD installs without an X server, neither the mouse, dbus, hal, and gdm daemons are running on start up. To enable these daemons, issue the command:

vi /etc/rc.conf

Add the following lines to the bottom of this file:

gnome_enable="YES"
moused_enable="YES"
dbus_enable="YES"
hald_enable="YES"
gdm_enable="YES"

Save and close that file.

Mount /proc

We also need to add /proc filesystem to be mounted at startup. Issue the command:

vi /etc/fstab

Add the following line to the bottom of that file:

proc /proc procfs rw 0 0

Save and close that file.

Reboot and log in

At this point you should be able to reboot the machine and be greeted by the GDM login screen (Figure A).

Figure A

Install sudo and give user sudo privileges

Out of the box, you won’t find sudo installed on FreeBSD. Because of this, you’ll need to log in as root to install anything. That’s a security issue. To fix this, you’ll want to first install sudo and then give your user sudo privileges.

First, install sudo with the command:

pkg install security/sudo

Open the sudoers file for editing with the command:

visudo

At the bottom of this file, add the following:

USER ALL=(ALL) ALL

Where USER is the name of the user to be added.

Save and close that file.

Exit from the terminal, log out as your user, and log back in. Your user should now have sudo privileges, and can install and administer as necessary.

Getting GUI on FreeBSD

Congratulations, you now have a FreeBSD installation that includes a GUI desktop that allows your user to work as you need, without having to log in or change to the root user. Enjoy that GUI on an incredibly reliable platform.

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays