FreeBSD 12 as an alternative to the Linux desktop
Swapping Tux
FreeBSD is a reliable and highly secure server operating system. We look at how FreeBSD fares as a desktop system.
FreeBSD has been around since 1993 and enjoys an excellent reputation, especially in the server sector. The system is based on the Berkeley Software Distribution (BSD), a Unix-style operating system whose origins go back to 1977. Numerous BSD variants, such as TrueOS (the former PC-BSD), Dragonfly BSD, or GhostBSD, make the scene just as confusing as the Linux world.
With the exception of TrueOS and GhostBSD, BSD derivatives don't focus on the desktop but on servers, storage appliances, routers, and firewalls. However, mainline BSD variants like FreeBSD have extensive software repositories with plenty of desktop tools if you're ready to look for them. We decided to explore the possibility of setting up a desktop system on FreeBSD.
Installation
FreeBSD is available as an ISO image for various computer architectures. Whether you are using a traditional Intel computer, a Raspberry Pi, a PowerPC system, or a Sparc workstation, you'll find a version of FreeBSD for your hardware at the project site [1].
After downloading the right image for your application, burn it onto an optical disc or transfer it to a memory stick. For example, on Linux, you can use the dd
command (see Listing 1). Please be sure to replace the drive name sdX
with the correct drive for your system.
Listing 1
Burning the Image
Then boot your computer from the newly created removable disc. FreeBSD will soon provide you with a simple boot manager, where you can choose to reboot or to run the system in multiuser or single-user mode. In addition, there is an option to switch to the prompt. If FreeBSD does not show the boot manager, you may be asked to check the list of compatible hardware, which usually means that a hardware component is not supported.
By default, FreeBSD starts in multiuser mode from the boot manager, and shortly afterwards, you will see an Ncurses dialog asking if you want to start a Live operating system or install right away. If you opt for Live mode, a login prompt immediately appears, and you can log on as root without password. You are taken back to the prompt again without a graphical user interface launching. Live mode is thus not suitable for beginners and users who prefer a graphical desktop.
Static installation on a test partition is easier. Select the option for static installation. FreeBSD then calls the default Bsdinstall installer, which installs the system on your storage device in just a few steps. Since the BSD derivative uses a US keyboard layout by default, you may want to change the keyboard layout to suit your needs. Select one of the options and confirm by pressing Select. You then have the option of specifying a host name and importing optional system components of the BSD derivative via a selection window (Figure 1).
The default selection is usually for newcomers; you can thus move on to the next step, which involves partitioning the mass storage media, without making any adjustments. FreeBSD supports UFS and ZFS as native filesystems – both are firmly anchored in the Unix world and are primarily used in professional environments.
UFS2 is FreeBSD's default filesystem, while the sophisticated ZFS seems over the top for desktop systems. If the entire mass storage device is available for a complete reinstallation, you can tell the installer to perform automatic partitioning. In this case, the system creates a UFS2 root partition and a swap partition. If there are already other operating systems on the hard disk, the installer identifies them and supports manual partitioning.
Please note the completely different nomenclature of the drive names compared to Linux: The first hard disk or SSD under FreeBSD has a drive name of ada0
; the other mass storage devices are counted in ascending order. Each partition is preceded by p
and numbered in ascending order after the drive name. For example, the first partition on the first drive is ada0p1
. When partitioning is complete, the installer copies the operating system to the mass storage device (Figure 2).
Enter a new password at the prompt for the root user. When you get to the configuration dialog, first enable network access and set the date and time. The routine will then branch to a dialog where you can select the system services that you want FreeBSD to launch automatically at boot time.
In another Ncurses window, you then compile a list of various security options that serve to harden the operating system against attacks. The configuration dialog then takes you through the process of creating new users and entering their authentication credentials. The installer asks for further optional information, such as the new users' membership in groups and the associated home directories (Figure 3).
In the Final Configuration window, you will find all previous configuration dialogs again. If you want to modify the configuration, activate the dialog with the arrow keys. When all changes are complete, you return to the Final Configuration screen. Use the Exit option to reboot from the newly installed mass storage device.
First Launch
The system first opens the same boot loader as on the installation disc and starts multiuser operation if you do not select any of the options offered. You'll soon reach a login prompt where you can log in as the root user. Now you can install a graphical user interface. The Ports Collection provides a variety of desktop environments for this purpose.
First you have to install the X11 server. At the prompt, type pkg install xorg
(Listing 2, Line 1). Since no package management tool is installed as yet, the routine first asks if it should download and configure a package manager; you will want to say yes. FreeBSD then collects files for the missing package manager from the repository servers and installs them.
Listing 2
Setting Up X11
The routine then downloads the complete X11 system, including the matching fonts, and installs it on your mass storage device. Next, at the prompt, add the users previously created in the system to the groups video and wheel using the commands from Listing 2, Lines 3 and 4. Then open the Vi text editor at the prompt and edit the /etc/rc.conf
file (Line 5).
/etc/rc.conf
is where you need to add the dbus_enable="YES"
line (see the box entitled "Editors"). The pkg install desktop_name
command lets you install the desired desktop environment on the system [2]. For example, to install XFCE, the command line is pkg install xfce
(Line 7). At another prompt, the program lists the number of packages required for the desktop environment and their space requirements. The installer will then ask you if you really want to install these packages, which you can do by pressing [Y].
Editors
FreeBSD installs the Vi editor by default, but using this editor can be a little overwhelming for newcomers. As an alternative to Vi, you can also use the package manager to install a friendlier editor such as Nano. The package is named after the program, so the installation just requires you to type pkg install nano
.
Now you have installed both the X11 server and a desktop environment. To ensure that they launch when the startx
command is entered, create a suitable .xinitrc
(Listing 2, line 8) at the prompt in the last step. Now you can load the desktop by entering startx
together with the desktop environment.
If the X server does not start as expected but is closed with a note to the effect that a D-Bus UUID is missing, you need to enter the dbus-uuidgen --ensure
command at the prompt. The X server and desktop environment will then launch correctly.
Manual Work
FreeBSD is designed primarily for server systems, and it lacks many tools to set up the system on the desktop. Since the hardware detection and driver support for desktop systems also leave much to be desired [3], FreeBSD requires more manual work than most current Linux distributions if you want to use the operating system productively with a graphical user interface.
The graphical configuration tools of the working environments are available after the basic installation, but some of them only work in a limited way. In many cases, the system does not fully detect graphics cards and often offers only rudimentary display settings on the desktop [4]. For XFCE 4.12, only the SVGA and XGA resolutions were available in our lab (Figure 4).
In order to adapt the system to the graphics hardware and output devices, you either need to set the appropriate video modes via the xrandr
program or modify various X server configuration files directly by hand to reflect the installed hardware. You can also perform these tasks in the terminal.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.
-
Gnome OS Transitioning Toward a General-Purpose Distro
If you're looking for the perfectly vanilla take on the Gnome desktop, Gnome OS might be for you.
-
Fedora 41 Released with New Features
If you're a Fedora fan or just looking for a Linux distribution to help you migrate from Windows, Fedora 41 might be just the ticket.
-
AlmaLinux OS Kitten 10 Gives Power Users a Sneak Preview
If you're looking to kick the tires of AlmaLinux's upstream version, the developers have a purrfect solution.
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.
-
System76 Unveils an Ampere-Powered Thelio Desktop
If you're looking for a new desktop system for developing autonomous driving and software-defined vehicle solutions. System76 has you covered.
-
VirtualBox 7.1.4 Includes Initial Support for Linux kernel 6.12
The latest version of VirtualBox has arrived and it not only adds initial support for kernel 6.12 but another feature that will make using the virtual machine tool much easier.