Trying out FreeBSD as my main OS

This post was published on 07 Apr 2025

A screenshot of a FreeBSD desktop with a photo of a bateleur eagle as the background image and a terminal window showing the outout of the program 'fastfetch'.
A screenshot of my FreeBSD desktop running XFCE

After playing around with OpenBSD for a while and being honestly very happy with it, I decided to give it a try as a desktop OS and … unfortunately had a lot of trouble getting anything to work properly. I might try again some other time, but getting a desktop environment to work properly with everything that comes with it was something I struggled with quite a bit, unfortunately; and in addition to that, I found that a lot of programs I’d need on a desktop simply weren’t available as packages, either.

I will, as I said, probably try this again at some point, but I just decided to try FreeBSD on desktop instead and it’s definitely been much nicer, even though it involves a lot more manual steps than your typical Linux distribution. I ended up getting a bunch of old Lenovo ThinkCentres and an old Lenovo ThinkStation from my dad and decided to use the ThinkStation as my FreeBSD machine; it’s got an Intel Xeon E3-1276 v3 (4C/8T @ 3.6 - 4 GHz) and 16 GB of DDR3 memory (upgraded to 32 GB later on). It does not have a dedicated GPU which, honestly, I think is probably a good thing, because I have no idea how well a dedicated GPU from NVIDIA would’ve worked on FreeBSD!

Before we begin, it is probably important to note that FreeBSD doesn’t just come with a desktop environment or even a menu in the installer that installs a desktop environment for you like a lot of modern Linux distributions. Additionally, a whole bunch of other things you might take for granted also aren’t pre-installed or pre-configured. I am just telling you this so you don’t go running off to install FreeBSD on all your machines, only to find out that basically nothing has been configured automatically and you need to spend a few minutes / hours getting everything running how you want it to.

A lot of what I am going to be talking about here can be found in the absolutely amazing FreeBSD Handbook; if you’re going to be installing FreeBSD yourself, I highly recommend taking a look at it because I very much doubt I would’ve gotten as far as I have without having read the handbook. I will try to always link to the appropriate chapter in the handbook when talking about how to do a particular task so you can simply click the link and find some more information about it there.

Getting a desktop

Further reading: Check chapter 5 and chapter 8 of the FreeBSD Handbook for more information. You may also want to check out chapter 6 in case you want to run Wayland instead of X11. Additionally, you may find tennea9’s DE installation script helpful.

After installing FreeBSD, the very first thing (after setting up doas and a bunch of other things) I had to do was to install X11, a desktop environment and I also had to find out what driver my iGPU requires and load the required kernel module. I could’ve also tried running Wayland, but as I wanted to go with XFCE, I decided to hold off on that for now as the Wayland support in XFCE is still a bit… lacking.

Installing X11 requires you to not only install the required package (pkg install xorg), but also to add your user to the video group; and unlike most Linux distributions or even OpenBSD, there is no usermod command. Instead, FreeBSD uses the pw command like so: pw groupmod video -m hex (wherein hex is my user account).

Afterwards, you have to install and then load the appropriate kernel module for your graphics card; as I am using the integrated graphics of the Xeon CPU in this ThinkStation, I downloaded the drm-kmod package and ran sysrc kld_list+=i915kms to add the kernel module for Intel graphics to my /etc/rc.conf file so that it is loaded automatically on boot. To immediately load the module, you can also run kldload i915kms (this will not load the kernel module automatically on boot, however, so you still need the line in the /etc/rc.conf – using kldload will just make it so you don’t have to reboot to load the module).

Afterwards, I was able to start installing XFCE and an appropriate display manager (lightdm in this case). This requires a few more steps than X11, as you need to first install the packages (pkg install lightdm lightdm-gtk-greeter xfce) and then also need mount the /proc directory and enable lightdm and dbus using two sysrc commands. To mount /proc, the following line is required in /etc/fstab:

# Device                Mountpoint      FStype  Options         Dump    Pass#
proc                    /proc           procfs  rw              0       0

Some additional packages you may want

This is enough to get a very basic desktop going, but beware that you will still need to install a whole bunch of fonts or other packages. For example, I was unable to see any non-ASCII characters, presumably due to the fact that I barely had any fonts installed on the system. I, therefore, added not only my own version of Iosevka to the ~/.fonts directory, but also installed the following two packages: pkg install nerd-fonts noto.

Additionally, XFCE was unable to save passwords which meant I always had to enter my XMPP password whenever I opened Gajim or the password for my NAS whenever I wanted to access it. To mitigate that, I installed the gnome-keyring package.

The default installation of XFCE as outlined above also does not come with any web browser, email reader, PDF reader and some other stuff you’ll probably want on desktop. In my case, I went with the following packages: claws-mail firefox zathura zathura-pdf-mupdf feh xarchiver thunar-archive-plugin xfce4-screenshooter-plugin. And because I am not a huge fan of the default feh config, I created both ~/.config/feh/keys and ~/.config/feh/theme and put the following contents into them:

~/.config/feh/keys
menu_parent	Left
menu_child	Right
menu_down	Down
menu_up		Up

scroll_left	h
scroll_right	l
scroll_up	k
scroll_down	j

scroll_left_page	C-h
scroll_right_page	C-l
scroll_up_page		C-k
scroll_down_page	C-j

toggle_aliasing		A
toggle_filenames	d
toggle_pointer		o
toggle_fullscreen	f

zoom_in		plus
zoom_out	minus

next_img	greater
prev_img	less
reload_image	r
size_to_image	w
next_dir	bracketright
prev_dir	bracketleft
orient_3	parenright
orient_1	parenleft
flip		underscore
mirror		bar
remove		Delete
zoom_fit	s
zoom_default	a

close	q Q
~/.config/feh/themes
feh --auto-zoom --scale-down -g 1024x576

In my case, I also installed the Chicago 95 theme which makes XFCE look very similar to Windows 95. Some other programs I use that you may not require are Gajim, Strawberry (music player), Emacs, KeePassXC, VS Code, Telegram and Signal.

Last but not least, I had trouble with my keyboard layout; despite setting it to the German keyboard layout in the XFCE config, whenever the computer would wake from hibernation / sleep, the keyboard layout would change back to the US layout. I did not find any other way to mitigate this than to create /etc/X11/xorg.conf and put the following contents into it:

Section "InputClass"
    Identifier "system-keyboard"
    MatchIsKeyboard "on"
    Option "XkbLayout" "de"
EndSection

Then, in the XFCE keyboard settings, I had to set the “Use system default” toggle in the “Layout” tab to “on”.

Audio

Further reading: Check chapter 9 of the FreeBSD Handbook.

We now have a decently-usable desktop but, unfortunately, no audio. Your mileage may vary if you have different hardware, but neither the speakers I had connected to the rear analog output nor my headphones connected to the front analog output worked without some configuration. The soundcards were, however, correctly detected as the output of dmesg | grep pcm showed:

pcm0: <Intel Haswell (HDMI/DP 8ch)> at nid 3 on hdaa0
pcm1: <Realtek ALC662 rev3 (Rear Analog)> at nid 20 and 24,26 on hdaa1
pcm2: <Realtek ALC662 rev3 (Analog)> at nid 21 and 25 on hdaa1
pcm3: <Realtek ALC662 rev3 (Front Analog Headphones)> at nid 27 on hdaa

However, checking cat /dev/sndstat revealed that the HDMI/DP was being used as the default audio output:

Installed devices:
pcm0: <Intel Haswell (HDMI/DP 8ch)> (play) default
pcm1: <Realtek ALC662 rev3 (Rear Analog)> (play/rec)
pcm2: <Realtek ALC662 rev3 (Analog)> (play/rec)
pcm3: <Realtek ALC662 rev3 (Front Analog Headphones)> (play)
No devices installed from userspace.

To test whether audio would work at all, I ran sysctl hw.snd.default_unit=1 to change the default audio output from HDMI/DP to the rear analog output; I then proceeded to play some music on Strawberry and, lo and behold, it worked! Unfortunately, having to do this is a bit cumbersome and very frequently, I want to change the audio output only for a certain application instead of for the entire computer. To accomplish that, it was necessary to install the packages xfce4-volumed-pulse and xfce4-pulseaudio-plugin. This, amongst other things, installs pavucontrol which is a nice graphical UI for managing per-application audio.

Automounting external drives

Further reading: Check chapter 20 of the FreeBSD Handbook.

I frequently plug external drives into my PC that I would, honestly, just like to be mounted automatically without my having to fiddle with mount commands all the time. Unfortunately, this is not enabled by default on FreeBSD, but enabling it isn’t too difficult either. First, you need to install the required package with pkg install automount. Afterwards, you need to edit a few files. First, you must go and uncomment the following line in /etc/auto_master:

/media		-media		-nosuid

Then, the following lines have to be added to /etc/devd.conf:

notify 100 {
	match "system" "GEOM";
	match "subsystem" "DEV";
	action "/usr/sbin/automount -c";
};

Then, autofs must be enabled by adding autofs_enable="YES" to /etc/rc.conf. You could then simply restart the required services, but I would recommend simply rebooting at this point. Once that has been done you could be able to just plug in a USB drive or HDD and it’ll be automatically mounted for you. The mounted drives will appear in the /media directory. I also installed fusefs-ntfs and fusefs-ext4 and added fusefs_load="YES" into my /etc/rc.conf, though I am not entirely sure how necessary that was.

Graphics woes

Unfortunately, I had a bit of trouble with a few graphics-related things. Part of this might be due to the fact that this is an older platform, but some of it really just appears to be a bug in the current drivers on FreeBSD.

Suspending breaks the GPU driver

Whilst loading the i915kms kernel module was enough for my graphics to work properly, I still had some very strange issues. One thing was that when I tried playing a video through VLC, it would simply crash. I also made a post about it on the FreeBSD forum and it turned out it’s actually an error that occurs when you switch VTs which is also something that happens when you suspend the PC (which I do a lot). As I understood it, the driver would be unloaded when a switch to a new VT occurred and never be loaded back in afterwards which breaks all sorts of things. For example, I also had trouble with VS Code because sometimes, I would not see any text but… sometimes I would; and as it turns out, it was because I had suspended the PC which briefly made it switch to a different VT!

At any rate, there does not appear to be a fix for this bug for now. The only thing you can do is make it so that FreeBSD does not switch to a different VT when suspending the PC; this can be done by adding kern.vt.suspendswitch=0 to /etc/sysctl.conf.

Hardware accelerated video decoding in Firefox

I watch a lot of YouTube videos; in fact, YouTube is the only video streaming platform I use nowadays and as such, it’s quite important for me to be able to watch YouTube videos and it’s always very much appreciated if those videos actually play smoothly. Unfortunately, they did not do so by default. Checking about:support showed me that hardware decoding for basically every codec was unsupported and that only software decoding was supported; this, then, meant that watching videos would always make the CPU usage go up by quite a bit and, unfortunately, make it so that frames were dropping left and right.

I had to do a bit of Googling (well, technically I was using Startpage, but “startpaging” just sounds rather odd) to figure out that what I needed to do was to install either libva-intel-media-driver or libva-intel-driver. The former did not work, unfortunately, but installing the latter did work; I think it’s due to the fact that I have an older CPU which needs the legacy driver and doesn’t work with the more modern one. I also installed the libva-utils package which allows me to run the vainfo command that now shows the following output:

vainfo
Trying display: wayland
Trying display: x11
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Server - 2.4.3
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264MultiviewHigh      :	VAEntrypointVLD
      VAProfileH264MultiviewHigh      :	VAEntrypointEncSlice
      VAProfileH264StereoHigh         :	VAEntrypointVLD
      VAProfileH264StereoHigh         :	VAEntrypointEncSlice
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD

FreeBSD updates are … strange

Further reading: You may find this thread on the FreeBSD forums interesting.

FreeBSD has two package branches, Quarterly and Latest, with the default branch being Quarterly nowadays (from what I was able to gather, it actually used to be Latest up until a few years ago; and as the new quarter had just arrived (as of April 7th 2025), I decided to just go ahead and update / upgrade all my packages with the pkg update and pkg upgrade commands.

Unfortunately, that was a bit of a mistake; and while I could have definitely read all the messages a bit more carefully and will do so next time, I still find the fact that this happened at all… very strange. What happened is that the pkg upgrade command correctly upgraded all my packages but also deleted a bunch, including thunar (my file manager), xfce4-desktop and a bunch more. The reason for this is that both those packages (and a bunch of others) do not yet have a binary package available in the new Quarterly branch due to a build dependency failure; webkit2-gtk failed to build and, thus, all packages that have that as their dependency were simply … skipped.

The only way to get my desktop back to working order was to go and switch from Quarterly to Release and re-install all the packages that pkg upgrade uninstalled. I admit, I should’ve read the output of pkg upgrade more carefully and I would have seen that it was uninstalling important packages, but I frankly don’t think this is something that should happen, especially not on the supposedly more “stable” Quarterly branch. I admit, I should’ve read the output of pkg upgrade more carefully and I would have seen that it was uninstalling important packages, but I frankly don’t think this is something that should happen, especially not on the supposedly more “stable” Quarterly branch. Just the fact that a build can fail and if you then run pkg upgrade at the wrong time, it just nukes your packages is a bit… strange to say the least.

Conclusion

To be brutally honest, my experience has been somewhat mixed all things considered. I was especially annoyed by the the rather odd package upgrading behaviour after the release of the new Quarterly branch because this is something that I have never experienced before, even using something like Arch. Nevertheless, I am – for whatever reason – very determined to make this work and, honestly, it’s been working quite well barring the problems I outlined above and I am going to continue trying to use it as my daily driver for the foreseeable future. FreeBSD just feels very cosy for some reason (I really cannot pinpoint a reason why, it just does).