Common Features of Different BSDs – What Do Various BSDs Share?

bsddistribution-choice

… and what are the differences between them? I formulated my question like this to make it clear I'm not interested in a flamewar of opinions, rather in an objective comparison between the different flavors of BSD Unix. Ideally I could get feedback from users who have experience in all of them.

Background

I recently discovered that there's much more to Unix than merely Linux. I use Solaris at work, it opened my eyes. Now I'm interested in new unices, I want to try a new one and I'm naturally curious about BSDs.

The problem

I'm not asking for advice or opinions on what BSD to install; I want to know the differences (and common points) between them so I can make up my own mind. The problem is that it's difficult to get proper comparisons between them.

If you're lucky, you get some hasty definition like this one:

FreeBSD = Popular all-rounder.
NetBSD = Portable (runs on a lot of platforms, including a toaster)
OpenBSD = Security above anything else.

(It might be true, but it's not really useful. I'm sure FreeBSD is portable and secure as well …)

If you're unlucky you get caught in one of those inevitable Unix legends about projects splitting, forking, rebranding on intellectual/moral grounds, how Theo de Raadt is an extremist and how MacOS X and FreeBSD had a common ancestor over 20 years ago.

Fascinating, but not really informative, is it?

The BSDs

The BSDs I am interested in are:

  • FreeBSD
  • OpenBSD
  • NetBSD

and optionally

  • Dragonfly
  • Darwin

My questions

In order to understand the differences better, here's a list of somewhat related questions about the different distributions (can we use this term?). If you present your answer under some form of tabular data, you are my all-time hero!

  • Do they use the same kernel?
  • Do they use the same userland tools? (what are the differences, if any?)
  • Do they use the same package/source management system?
  • Do they use the same default shell?
  • Are binaries portable between them?
  • Are sources portable between them?
  • Do they use different directory trees?
  • How big are their respective communities? Are they the same order of magnitude?
  • How much of the current development is common?
  • What are the main incompatibilities between them?

I don't know how easy those questions are to answer, and how relevant to the StackExchange format this question really is. I just never came across a simple document listing the differences between BSDs in a clear way, useful for fairly experienced users to look at and make a choice easily.

Best Answer

I don't think I will provide you and everyone with the perfect answer, however, using a BSD system everyday for work, I am sure I can give you a useful insight in the BSD world. I didn't ever use NetBSD, I won't talk a lot about it.

Do they use the same kernel?

No, although there are similarities due to the historic forks. Each project evolved separately.

Do they use the same userland tools? (what are the differences, if any?)

They all follow POSIX. You can expect a set of tools to have the same functionality between *BSD. It's also common to see some obvious differences in process/network management tools within the BSDs.

Do they use the same package/source management system?

They provide a packaging system, different for each OS.

Do they use the same default shell?

No, for example FreeBSD uses csh, OpenBSD uses ksh.

Are binaries portable between them?

No:

(XXXX@freebsd-6 101)file `which ls`
/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), for FreeBSD 5.5, dynamically linked (uses shared libs), stripped

They don't really support stable and fast binary emulation. Don't rely on it.

Are sources portable between them?

Some yes, as long as you don't use kernel code or libc code (which is tied up tightly to the OS) for example.

Do they use different directory trees?

No, they are very similar to Linux here. However FreeBSD advocates the use of /usr/local/etc for third party software's configuration files. OpenBSD puts all in /etc... They put all third party in /usr/local, whereas Linux distribution will do as they see fit. In general you can say that *BSD are very conservative about that, things belongs where they belongs, and that's not something to make up.

How big are their respective communities? Are they the same order of magnitude?

FreeBSD's is the largest and most active, you can reach it through a lot of different forums, mailing lists, IRC channels and such... OpenBSD has a good community but mostly visible through IRC and mailing lists.

Actually if you think you need a good community, FreeBSD is the way to go. NetBSD and OpenBSD communities are centered around development, talk about new improvements etc. They don't really like to do basic user-support or advertising. They expect everyone to be advanced unix users and able to read the documentation before asking anything.

How much of the current development is common?

Due to really free licenses code can flow among the projects, OpenBSD often patches their code following NetBSD (as their sources have a lot in common), FreeBSD takes and integrates OpenBSD's Packet Filter, etc. It's obviously harder when it comes to drivers and others kernel things.

What are the main incompatibilities between them?

They are not compatible in a binary form, but they are mostly compatible in syntax and code. You can rely on that to achieve portability in your code. It will build or/and execute easily on all flavors of BSD, except if your going too close to the kernel (ifconfig, pfctl...).

Here's how you can enjoy learning from the BSD world:

Try to replace your home router with an openbsd box, play with pf and the network. You will see how easy it is to make what you want. It's clean, reliable and secure. Use a FreeBSD as a desktop, they support a lot of GPUs, you can use flash to some extent, there's some compatibility with Linux binaries. You can safely build your custom kernel (actually this is recommended). It's overall a good learning experience. Try NetBSD on very old hardware or even toasters.

Although they are different, each of them tries to be a good OS, and it will match users more than situations. As a learning experience, try them all (Net/Open/Free), but later you might find yourself using only 1 for most situations (since you're more knowledgeable in a specific system or fit in more with the community).

The other BSDs are hybrids or just slightly modified versions, I find it better to stay close to the source of the software development (use packet filter on OpenBSD, configure yourself your desktop on FreeBSD, ...).

As a personal note, I'm happy to see an enthusiast like you, and I hope you will find a lot of good things in the BSD world. BSD is not about hating windows or other OSs, it's about liking Unix.