Why FreeBSD Desktop and My Linux Rant

55
Why FreeBSD Desktop and My Linux Rant

I have been a FreeBSD user for 4 years now, and a FreeBSD desktop user full time since December of last year (2020). Previously, I used FreeBSD on my desktop on and off since the end of 2019 and have enjoyed it, despite some of the creature comforts that are lacking (which I’ll explain later).

As some background, I’ve been a Linux desktop user since 2013, started with Ubuntu, then Linux Mint, and played the whole distro hop game, using every popular distro, and most every desktop environment out there. I was never quite satisfied, hence I distro hopped. Debian and Ubuntu were stable, but there were some package updates I wanted that I thought were an inconvenience to add, or I couldn’t get the package (such as no PPAs). So then, I tried Fedora, Arch Linux, etc. that were more bleeding edge, and in less than a year it was either far too unstable for me (to the point of having irrecoverable systems sometimes after an update) or the desktop environment had so many bugs that I couldn’t use it. By that time, maybe a new LTS was out and I’d hop on that until the packages felt too old, I wanted an update, had loads of PPAs, bla bla bla and the circle went on.

I am coming at this as someone who is a power user, spends most of my time in a terminal, does sysadmin work, devops, some programming for fun. So, if you aren’t comfortable with a terminal, my opinions of “easy” and “I like this” may not align with what you would find easy or like. If you consider yourself a power user who’s comfortable with the idea of using a terminal and digging into a system, maybe you will find my thoughts interesting.

What I Like; TLDR

To begin, here’s a bullet point list on what I like about FreeBSD on the desktop to act as a TLDR

  • Stable base operating system
  • Option to get packages at a slower pace
  • Option to get packages as they’re available in ports
  • Safe updates/upgrades
  • ZFS to manage my disks
  • Easy disk encryption
  • lagg devices to go between wired/wireless connections
  • systemd-free
  • Good documentation, good man pages
  • bsd’s rc for managing networking, services, etc
  • Good sound system (with a caveat)

What I Don’t Like; TLDR

  • Some nice-to-have packages unavailable
  • Some desktop integration with the OS missing
  • USB audio (GGGRRRRRR)

What I Like

Stable Base Operating System

If you read my intro, recall I mentioned wanting to have newer software but complained about the “base OS” (since Linux doesn’t necessarily have a “base”) being too unstable to get that newer software. I’ll get to packaging next, but who wants a crashy system, or something that is so bleeding edge that you aren’t too sure if your next update will be a great success or not? After hundreds of reboots with Ubuntu Server LTS from 14.04 to 20.04, I probably couldn’t tell you of one time when a reboot after updates failed because of the updates. But, it was a common occurrence for me when I daily drove the non-LTS Ubuntu releases, Fedora, Arch Linux. Sometimes I had to fight with the systems, other times it was just dead and I had to reinstall. For anybody reading this you’ll probably say something like “I’ve been running X for year(s) with no issues!” Good for you. Unfortunately, that was not my case.

FreeBSD has continually provided a solid base operating system for me. It provides a clean and firm foundation for me to build upon. I haven’t had any of my systems die on me or have a borked update (both home PCs and production servers). FreeBSD updates each release to ensure compatibility from minor upgrade to minor upgrade, and in my experience, has also been very clean going from major release to major release. I’ve tried numerous upgrades on Linux and it’s rare that I came out without issues. There was always some new annoying bug, or maybe it was entirely broken. Security patches are quickly made, I get access to great tools like jails and bhyve to do my work, ZFS or UFS2.

Packages

To me, this is one of the neatest things about FreeBSD for the desktop. The way FreeBSD packages software is what effectively killed my distro hopping life. FreeBSD has 3 primary ways you can get packages

  1. Ports
  2. Quarterly packages
  3. Latest packages

With ports, you download the ports tree and compile and install the software yourself. And if you choose, you can automate the process with tools like poudriere. Quarterly packages is a slower-rolling repository where packages receive updates every quarterly through the year. So, if you need a bit more stability you can lag behind and use these packages. If you want the latest software, you can switch to the “latest” repository and get packages as they’re compiled and available via the package repository.

With this design, I really felt like I could “have my cake and eat it too”. A stable operating system to depend on, and get the up-to-date desktop packages I need (thank you to all the port maintainers out there for your hard work!).

To go back to my allusion to a later point in the article, let me give Ubuntu as an example. One piece of software I use daily is KeePassXC. As of writing, the current version is 2.6.6. This is currently the version I have installed on FreeBSD. The current version of Ubuntu (21.04) is 2.6.2 and the latest LTS offers (20.04) it’s 2.4.3. Oof! I was able to remedy this with PPAs on Ubuntu. But what if I’m not using Ubuntu? How about redis server? On 20.04 it’s version 5.0.4, and 21.04 it’s 6.0.11. For the 5.X branch 5.0.14 is the current version and 6.0.14 is the current for the 6.0.X branch. You won’t see updates for these packages. There have been reported vulnerabilities for these packages, yet, they won’t receive updates. For the desktop, what if I want some added features, bug fixes, or security patches? For something like KeePassXC (which is a security application), I want things fixed. I also want my keepassxc-browser extension to not yell at me every day because my copy of KeePassXC is outdated.

For the desktop experience, I am particularly interested in getting a new feature. Therefore, I couldn’t use an LTS distro. Onto rolling or bleeding edge distros. I got my up to date packages, but somehow they ended up being buggier on Linux than FreeBSD. My guess, like with KDE Plasma for example, I would see a hodge podge of different dependency versions for the different kf5 packages and mismatched versions of other software. I have yet to see that be the case with how packages have been added to FreeBSD. Truth be told, my most stable KDE Plasma experience yet has been on FreeBSD.

It has been a pleasure to run a stable OS with my “unstable” packages. It really does feel in a way like I’m on an LTS distro but getting all the up to date software that I would expect to be frequently updated without being frozen.

Safe Updates/Upgrades

Since I do like to live on the edge more with packages (such as my desktop environment), I have encountered bugs. It’s only natural. Although FreeBSD’s design has given me ample opportunity to mitigate some of the bugs that might annoy me, I at least have an easy way to roll back when bad stuff happens. For example, I just yesterday updated my KDE apps to 21.08.2. All good, except Konsole does not like me typing exit to close out of the terminal or ctrl+d. It ends up crashing, which means I have to go click on the “ok” button to close out the crash window. Though I was able to install 21.08.1 from /var/cache/pkg, if I had greater problems I could have relied on using ZFS boot environments. I thought more about using ZFS boot environments on package updates (as well as system updates) when I saw OmniOS automaking a boot environment for me when I used its package manager. My method now is to create a boot environment, use the boot environment and do my updates, then if things go south just revert back to the previous environment before I did my updates. With FreeBSD 13.0 they make this easy:

$ bectl create BE_name
$ bectl mount BE_name
$ chroot /tmp/BE-13.xxxxxx
$ pkg update && pkg upgrade
$ exit
$ bectl activate BE_name
$ shutdown -r now

I can do this with updating FreeBSD too. Again, if things go bad, I just activate the old boot environment, or at the bootloader select the known good boot environment and go back to my working system.

ZFS

There’s a lot of ZFS content out there, so I will keep it short. I use this to delegate permissions to certain users to do certain tasks, such as a backup user to take snapshots or give a user the permission to create new datasets to make custom changes, whatever I desire that ZFS allows me to do. I also love using ZFS to work with virtual machines. Very often I make and test Ansible scripts for work, and I will do it locally on my machine since if the script doesn’t work as intended, I can stop my VM, rollback to a snapshot, start it. And in ~20 seconds I have a fresh system to run on again.

As for backups, I don’t send/receive backups to my backup server. Instead, I take snapshots and us the borg backup utility to backup the snapshot contents. It’s great this way since I can be certain that my backup contains my file contents at a point in time, not over the course of time that it takes to complete a backup.

Disk Encryption

Have you tried setting up disk encryption on Void Linux? It’s a pain. It was the hardest OS for me to get disk encryption working on. I wouldn’t wish to do it again. FreeBSD has a simple page in the handbook on enabling disk encryption, but in the installer it is done via a basic yes/no question. Full disk encryption (except maybe boot?) out of the box with no headache, encrypt disks easily with no headache (though, I suppose post-install you can use handy tools to make disk encryption easy on Linux too). Additionally, you can utilize ZFS encryption now whenever and wherever you need it.

lagg Devices

I came across an article on setting up a Thinkpad, and one of the things mentioned was to create a lagg device so I could easily switch between wired/wireless connections whenever I plug/unplug my ethernet cable. Now, I’ve generally had this work pretty well on Linux too since I think desktop environments will do it for you. But I’ve seen some of the DIY methods for Linux, and have done them in the past, and it was a bit of a trouble for me at times. However, FreeBSD lets you put it all in your /etc/rc.conf file and set and forget:

ifconfig_em0="ether  up"
wlans_iwm0="wlan0"
ifconfig_wlan0="WPA up"
cloned_interfaces="lagg0"
ifconfig_lagg0="up laggproto failover laggport em0 laggport wlan0 DHCP"

Systemd-free

Okay, this one is probably the least struggle I’ve had for a desktop/laptop computer, but there is one issue that I’ve still had with systemd to this day. And that is that it always disregards my split-DNS configuration for my house. It used to be that I could modify a couple configuration files and my resolv.conf file would be populated with whichver nameservers were set via DHCP. Great! Exactly what I wanted. Well, systemd loves its own resolvd resolver (which uses Google DNS by default). Not only do I reduce what info I give Google, but as I said, it also messes with my split-DNS network configuration. In recent days, doing my old techniques to stop using resolvd didn’t work, and I tried every solution under the sun for Ubuntu 20.04. No dice. So my solution, whenever I need to force my own DNS changes, is to modify the resolv.conf file with my own configuration, make the file immutable, then try to remember the change later when I leave the house. Very annoying. There’s probably something I’m missing, I’ll admit, but I shouldn’t have to struggle with this. Especially for an OS that is striving to be consumer friendly. Why then is it the Only operating system in my home that disregards what I have set up?

Documentation and manpages

I’ve been a Linux user for 8 years now, and FreeBSD for 4 years. I work with Linux all day long. Even as the years go by, it’s certain that I can’t know everything about how to manage my computers. This is where good documentation is great. I’ve had the FreeBSD Handbook save my skin a number of times, as well as various pages on the wiki. Additionally, I’ve found the man pages to have plenty of information and useful examples to help me figure out what I want. Some of the man pages for Linux are good, but I still often find myself having to hit stack overflow or some article somewhere to solve what I want. Generally, that isn’t the case for me with FreeBSD. I have to give credit where credit is due though: the Arch Linux Wiki is fantastic. Heck, it’s very thorough and sometimes I find myself getting useful tidbits of info for software that I wouldn’t even consider a base package for Arch.

Overall, it has been easier for me to find decent documentation to help me solve my problems with FreeBSD. And, I’ve had great help from the community for various things, but I’ve found that FreeBSD has given me ample tools and an easy enough to understand system to help me be sufficient on my own too.

bsd rc

I have come to greatly appreciate the rc.conf file on FreeBSD. I have a good view of how my computer is set up with network info and services I set. I like how I can use sysrc to manage entries in my file, the service command is as effective as I like it to be (and it isn’t a wrapper for systemctl!). Network configuration is also just a few lines. One thing I really appreciated, so I’ll share here too, is the ability to make a lagg interface to combine my ethernet port and wireless adapter on my laptop to default to ethernet and seamlessly failover to wireless when I unplug my ethernet cable, and vise-verse. Here’s the lines I have

wlans_iwm0="wlan0"
ifconfig_wlan0="WPA country US powersave up"
ifconfig_em0="ether  up"
cloned_interfaces="lagg0"
ifconfig_lagg0="up laggproto failover laggport em0 laggport wlan0 SYNCDHCP"
ifconfig_lagg0_ipv6="inet6 accept_rtadv"

Those few lines achieve a whole lot. Enable wireless, enable my ethernet, combine them, and do DHCP and accept router advertisements for IPv6. Very nice.

Good Sound System

I haven’t pursued this in great detail, but I’ve come to enjoy the simplicity of managing my audio as well as having clean audio. Aside from it overall producing good output with the defaults, the one cool thing I discovered was FreeBSD’s bitperfect flag which doesn’t resample my audio as I play it back. For some of my library this has actually given some of an edge to the output. For all I know it could be placebo for me, but I’ve tried to not let any judgement interfere with that. Some songs I notice no difference, which I think would have more to do with the music itself than the bitperfect mode. I’m just happy that it’s there and one sysctl flag away.

What I Don’t Like

Although I’m a big fan of FreeBSD, there are some pain points that really do suck when I encounter these issues. Here’s a few things that I Really don’t like.

Missing Software

Now, I would say I have about 99% of everything I need. In my day to day, I am happy with what I have, but I have had to sacrifice some software. Really, this is all software that is based on Electron. Our “crossplatform” posterchild. Oh how it annoys me that we’ve reduced the term “crossplatform” to Windows, Mac, and Linux. And yet, look at something like KeePassXC, where I don’t know where it Doesn’t run. But, because of this lacking component I initially found myself missing out on software that I used daily. 2 examples are Spotify and Signal. And though I would still like to use those, I just opt to not use them now. Maybe I could do some SSH forwarding though through a VM. There’s also the LinuxApps method of using some software, but Signal is one that doesn’t work this way and I’ve seen the LinuxApps method spam up my messages log and I don’t like that.

Another program I wouldn’t mind having is the Brave browser. I’m more of a Firefox kind of guy myself anyway, but I would like to have Brave as a good secondary. There’s still chromium though.

Games is also something that’s missing, but I really don’t see FreeBSD as my gaming platform. I much prefer FreeBSD to get work done. I still hop on Windows for gaming. And, if one day Linux can compete with Windows in this realm, I’ll still likely dual boot but do FreeBSD for work and Linux for play. Really, with the way my mind is, it wouldn’t be great for me to pool my work and play together on a single computer anyway as I work from home and really try to separate the 2 where I can.

Missing Desktop Integrations

The couple things I can thing of off the top of my head are with KDE. One with their new monitoring program that I think will be replacing Ksysguard, and some of the other cool features like volume control, seeing networks in the toolbar, managing networks there, connecting, seeing bandwidth usage…I claim these are nice-to-haves because, for networks I’m fine with the rc.conf and wpa_supplicant.conf file edits, ksysguard is good and so is top, and, sometimes I find to get certain audio control bits working I have to switch sysctl flags. Though, as I’m typing this, I see some of these audio managing bits from KDE have improved on my laptop since I last tried (I’m so used to not having this sort of stuff on my desktop for various reasons, one being I use a USB DAC to increase/decrease volume).

USB Audio

This one is tricky. Does USB audio work? Yes. In fact, it’s been working great for years now. I have a FiiO DAC and I’ve had no problem listening to anything. BUT…this one point of contention I have drives me absolutely bonkers and really does prevent me from having 2 computers on my desk. And that is if I unplug my USB DAC for any reason all hell breaks loose. Up until later last year, if I unplugged my DAC I would have to hard restart, or SSH into my desktop (!!!) to kill audio processes that were using my DAC because the ENTIRE USB bus hung up. With the latter, I basically had to reboot after that anyway because my desktop environment had some process killed somewhere and wouldn’t start properly. Maybe things were okay, but audio still didn’t work until I rebooted.

Today, I don’t have to hard reboot or SSH in, but I do still have to go find and kill processes, and still probably log out or reboot anyway because the process wasn’t clean. What’s worse, they hardly seem to care to fix this problem. In fact, this is a feature. Expected behavior. Okay, well if that is true, why isn’t there some clear cut fix? One solution mentioned is virtual_oss. virtual_oss however hasn’t fixed it for me, and has been one of those programs that I would say Isn’t well documented to fix a problem such as this. In fact, the scope of the fix for this problem seems to be very limited.

This has been a huge point of contention for me. On my note of splitting work from personal life, I initially had FreeBSD on a separate computer. I thought it would be a great idea to have my work computer and my personal computer. A personal FreeBSD/Windows dual boot and a work FreeBSD desktop separate from my personal box. Part of my idea was to leave the work box running so if, while off the clock I had to respond to an incident, I could press the button on my KVM switch, switch display to my work computer, sort out the incident, and then go back to my personal box. Nope. I can’t. Due to the USB audio issue, I would have to turn my FreeBSD computer on/off each time I wanted to switch my KVM. If I pursue this again, I may have to pursue getting a second DAC altogether and a way to switch cables on my headset to whichever system I’m on so I don’t have to unplug my USB DAC.

Wrapping Things Up

If you got this far, I’m sorry for my verbosity, I hope you enjoyed reading this. With my 2 years of full-timing a FreeBSD desktop, I would say that the advantages I have gotten using FreeBSD has really outweighed the disadvantages I have from not using Linux. It has been a great OS for me to settle on and given me what I need to stop the distro hopping craze I went through (my friend would always razz me whenever I talked about yet another distro because distro X just didn’t cut it, my buddy who would do the distro hopping game with me through college). I really feel more productive using FreeBSD. Maybe one day I’ll do somewhat of a workflow article, who knows.

If you are someone who isn’t afraid of the command line and want to try FreeBSD out for yourself, I really encourage it. There’s lots of ways to learn, lots of good resources, and once you start to learn the design of FreeBSD, it really starts to come together and make a lot of sense the way things were done. You could even try GhostBSD if you want an out of the box desktop experience.

NOW WITH OVER +8500 USERS. people can Join Knowasiak for free. Sign up on Knowasiak.com
Read More

Ava Chan
WRITTEN BY

Ava Chan

I'm a researcher at Utokyo :) and a big fan of Ava Max