FreeBSD is an amazing operating system
Published on 2020-01-20. Modified on 2023-10-23.
This is a small article about some of my adventures with FreeBSD and why I believe it is an amazing operating system.
I think it was late 1999 when I one day was browsing computer books at my favorite bookshop and I discovered the book The Complete FreeBSD third edition from 1999 by Greg Lehey. With the book came 4 CD Roms with FreeBSD 3.3.
I had already familiarized myself with GNU/Linux and I was in the process of migrating every server and desktop operating system away from Microsoft Windows to GNU/Linux, both at home and at my company. Initially I ran Red Hat Linux and then later Debian GNU/Linux, which eventually became my favorite Linux distribution for many years.
When I first saw The Complete FreeBSD book by Greg Lehey I remember noticing the text on the front page that said, "The Free Version of Berkeley Unix" and "Rock Solid Stability", and I was immediately intrigued! What was that all about? A free Unix operating system! And rock solid stability? That sounded amazing.
I bought the book and it became my favorite reading material for some time :)
I was surprised that I had not heard about FreeBSD before since it had existed since 1993, but at least another UNIX-like operating system wouldn't be too foreign to me because of my experience with Linux, and it wasn't.
I did some test installs on different hardware and I loved FreeBSD right away. FreeBSD became my first FTP server run from home.
Later in 2000 I was employed by one of the fastest growing ISPs in Denmark at the time and I was surprised to learn that their entire server and network infrastructure all ran on FreeBSD. The only computers that didn't run FreeBSD was the computers at the office where the sales people and secretaries worked, those ran Microsoft Windows 98.
When I asked about why they where running FreeBSD the system administrator said something like:
People who know what they are doing run FreeBSD. Everyone in the communication industry run FreeBSD!
I eventually got to experience the FreeBSD rock solid stability, mentioned in Greg Leheys book, first hand. FreeBSD was amazing. It was very performant and extremely stable, something that was rare at the time with Microsoft Windows and even Linux. Every single customer that was doing web or email hosting at the ISP, and that was a lot of customers, was being served by FreeBSD, and it was running on everything from old Intel 386 PCs to the latest Intel Pentium 4 machines. The only time FreeBSD needed to be rebooted was when it had been upgraded in the base system. During the time I was there I truly never experienced a single problem anywhere where FreeBSD was running.
Later in the years to come GNU/Linux got better hardware support and the development of Linux was very rapid. More and more Linux distributions began to emerge, and I eventually began running Debian more than FreeBSD. Partly because I was already running Debian on the desktop, but also because of better hardware support and a couple of other issued. I still liked FreeBSD very much and did also run it on my desktop for a couple of years before switching back to Debian.
Some of the things I have always loved about FreeBSD:
- Contrary to Linux, FreeBSD is a complete operating system.
- FreeBSD is very well designed. Once you get to understand how FreeBSD is setup and how it works, it is surprising how many details the developers have thought about.
- FreeBSD sets the kernel and the base system apart from third party packages (the other BSDs do that too, whereas Linux distributions mix it all together).
- All third party applications are installed in
/usr/local/and all third party application configuration goes into
/usr/local/etc/. Combined with the separation between the base system and third party applications, this makes it trivial to manage third party applications and if you ever need to change your setup completely you can simply delete all installed packages with
pkg delete -aand then start installing the ones that you want.
- Apart from some basic services that are run by default, like cron, as this is a part of the basic operating system maintenance tools, FreeBSD is installed only with the features you enable (either during installation or manually) and nothing is running that you don't know about. FreeBSD is opt-in, meaning that you have to enable something in order for it to run and work.
- FreeBSD has both the UFS and ZFS filesystems in the base install.
- FreeBSD comes with the rich storage system GEOM.
- FreeBSD also has geli which is a block device-layer disk encryption system that uses the GEOM disk framework.
- FreeBSD service handling is very simple. Each service, whether part of the base system or installed from a port, comes with a script that is responsible for starting and stopping the service (and often some other options). Default scripts reside in a default directory with default settings, like
/etc/default/rc.conf, but all settings can be overwritten by using
/etc/rc.conf. If you want to enable the OpenSSH Daemon, you just add
/etc/rc.confand the OpenSSH service is enabled at boot, or you can use the command
service sshd enable, which is even easier and it does the same.
The FreeBSD rc system that reads the configuration file understands dependencies between services and it can automatically launch them, or wait until one is finished before starting the services that it needs. You get all of the benefits of a modern configuration system without a complex interface.
- FreeBSD has both the ports system and pkg.
- FreeBSD has the amazing Jails system that allows you to run applications or entire systems in a sandbox that cannot access the rest of the system. Long before Docker existed, FreeBSD had Jails. FreeBSD also has the Bastille container management framework installable from both the ports and packages system.
- FreeBSD has Mandatory Access Control, from the TrustedBSD project, which allows you to configure access control policies for all operating system resources.
- FreeBSD has Capsicum which allows developers to implement privilege separation, reducing the impact of compromised code.
- FreeBSD also has the VuXML system for publishing vulnerabilities in ports, which integrates with tools such as pkg, so that your daily security email tells you about any known vulnerabilities in ported software.
- FreeBSD has security event auditing, using the BSM standard.
As mentioned previously, because FreeBSD is a real multi-purpose operating system with many different use cases, FreeBSD is very flexible and tuneable. Whether you want to run FreeBSD on your desktop computer or on your server, it provides many tuneable options that enables you to make it very performant. The options set out-of-the box may not suit your needs exactly, but then FreeBSD provides lots of documentation on how to get it to work as you need, and it provides a very helpful community with many people who has experience in dealing with many different situations and problems.
It is important to understand that FreeBSD is not like a Linux distribution. FreeBSD is an operating system made by developers who are also system administrators, at least it used to be like that, perhaps today to a lesser degree. In any case, you are supposed to understand how the system works. You cannot simply jump from something like Ubuntu, Fedora or OpenSUSE and then expect that you get the same experience on FreeBSD, you're not supposed to, and that is something that is very good.
A Linux distribution is a collection of tools written by different groups of people, often with conflicting interests and priorities.
FreeBSD is not like that. FreeBSD is a complete operating system produced by a team of people who are passionate about the work they do, there are no conflicting interests in the project. The people who maintain the kernel are also the people who maintain the C library, the
ls command, the
top command and all other system commands. FreeBSD also provides full documentation to everything related to the operating system.
Update 2020-01-21: Someone has pointed out that there do exist conflicting interests in the FreeBSD project as well and an example that springs to mind is perhaps the conflict between Matthew Dillon who eventually forked FreeBSD into DragonflyBSD because he disagreed with other FreeBSD developers about performance issues. However my original statement has perhaps been misunderstood. I don't think issues like that with Matthew Dillon is the same as conflicts between completely different projects like e.g. the Linux kernel and the systemd developers. A serious conflict in Linux land could result in a non-functional operating system, this cannot happen with the BSD projects because of the structure of these projects. On FreeBSD disputes are settled by the core team and by voting and on OpenBSD Theo de Raadt, who is the project leader, has the final say. This is different from what's going on in Linux land, which is what I meant to express.
Whether you're a Linux user, a MacOS user, or a Windows user, I highly recommend you try out FreeBSD. But before you do so, spend some quality time studying the FreeBSD documentation, you will get the most out of the system if you understand something about how it works. Reach out to people on the IRC channels or the FreeBSD mailing lists or the FreeBSD forums, you will find people very friendly and helpful.
I also highly recommend the book Absolute FreeBSD by Michael W. Lucas, who is a system administrator and network/security engineer with lots of experience working with high-availability systems on FreeBSD. Michaels book gets into a lot of details about the FreeBSD operating system. It is well written and contains many relevant details.
Michael W. Lucas, together with Allan Jude, has also written the FreeBSD Mastery: ZFS and FreeBSD Mastery: Advanced ZFS books for those interested in the ZFS filesystem running on FreeBSD. The second book is a follow-up to the first book, with more advanced use cases. Both books are invaluable.
I run FreeBSD as my daily driver on both my main workstation and on all my servers. If you're interested in a tutorial on how you can setup FreeBSD on your desktop, you can take a look at my tutorials:
- How to setup FreeBSD with a riced desktop - part 1 - Basic setup
- How to setup FreeBSD with a riced desktop - part 2 - Xfce
- How to setup FreeBSD with a riced desktop - part 3 - i3
FreeBSD is an amazing operating system!