FreeBSD for Fedora Users

From time to time, on the Fedora forums someone will ask about BSD. This article is a rather superficial overview, attempting to focus upon the main differences a Fedora user might find.

If you are coming here from the Fedora forums, I will point out that there are a couple of people who strongly dislike the BSDs there, and you are probably far better off going to the Arch, Ubuntu, Linuxquestions, or indeed, just about any other forum to ask your questions. I used to enjoy the arguing, but these days, I have less time and energy. Said arguments have also, in my subjective opinion, gotten nastier, so these days I just post this link and stay out of the thread. Then, those folks can say all the bad things they wish to say about BSD, or me, and I don't see it, so everyone is satisfied. If you wish to take their word that it's not worth the time and has a bad license, then that's up to you. Or, you can read on.

Dru Lavigne has an excellent article on FreeBSD for Linux users. There is another detailed article at over-yonder.net detailing much of the underlying difference between the two. However, as an article from the FreeBSD website comments, the differences to the average user can be surprisingly small. While there are many who trumpet the superiority of BSD over Linux, the official FreeBSD stance can be seen on their myths pages. It states

*BSD is better than (insert other system)
This is user opinion only.

(insert some other system) is better than *BSD
This is user opinion only.

The differences in the source code and licensing probably affect developers more than normal users. Much of this is covered in the links above by people far more knowledegable than I am. Therefore, this page will be aimed specifically at those who use Fedora, and what might surprise them. To cover it in a few sentences, userland and kernel are all produced by one group, whereas in Linux, Linux is really only the kernel. Everything else, such as the shell and various commands, are made by someone else.

As for the license, to completely oversimplify, the usual BSD license says that you can do whatever you want with the code, including using it for closed source programs. Some programmers feel this gives them more freedom. The typical Linux program is licensed under the GPL which says, if you use the code, it has to be kept available to anyone who wants it. Supporters say that this means whoever uses their code will give back to the community. Detractors says that it actually limits the freedom the programmer has to distribute their code. Again, if you're not a programmer, it's not really going to affect you.

RELEASE, STABLE and CURRENT

This can confuse newcomers. RELEASE is the stable version for production. CURRENT is more analogous to Rawhide, in a constant state of flux. Freddie Cash has written an excellent explanation of the differences, which he has kindly allowed me to make into a brief article. Note that the version numbers he uses have changed since the article was written, however, the explanation of the different terms is still correct. (At present, the supported RELEASE and STABLE versions are 6 and 7--and possibly 5) while CURRENT is up to version 8.)

Installation.

While this is being written about FreeBSD, much of this also applies to Net, Open and DragonFlyBSD as well.

FreeBSD requires a primary partition for installation. The installer is curses based (like doing a Fedora text install) but is pretty straightforward. It's covered in great detail in the FreeBSD handbook but there are no major surprises to anyone who's installed Slackware or ArchLinux.

NOTE As of FreeBSD 9.1 this is no longer the case. The old sysinstall is being replaced with bsdinstall, which can be fairly confusing if you're not giving the install the whole drive. The best simplified explanation I've seen is in this thread's first post. Whether one is running Windows or Linux, even if one is already running a disk using GPT rather than MBR as the post's author is using, it explains the new procedure fairly clearly. Assuming that if the reader is looking at this, they're not overly familiar with FreeBSD, just create a / and swap partition as per the instructions.

Addionally, the latest bsdinstall that I've seen didn't provide a bootloader, so unlike the poster, who booted into FreeBSD, I went back to my usual grub prompt.

At that point, I was able to boot by creating a small /boot/grub2/custom.cfg file as explained in my grub2 article.
menuentry "FreeBSD"
setroot='(hd0,3)'
chainloader +1

In FreeBSD 8.x and older, the newcomer can usually accept the defaults. It will take that primary partition and divide it into slices, the BSD name for partitions. It's not that hard to change the default partitioning scheme, but the newcomer is usually safe accepting the defaults.

For those who might feel intimated by the text based installer, there are now two more newcomer friendly versions, PCBSD and DesktopBSD.

PCBSD includes its own package system, PBI, although one can use the FreeBSD ports as well. DesktopBSD is more of a standard BSD with a GUI installer, package manager and, like PCBSD, a preconfigured KDE desktop.

One thing that many BSD users like, however, is the fact that the basic install is rather minimal. Unlike Fedora, where a base install can require gigabytes, a base FreeBSD installation is very small. Fedora's approach is to try and anticipate what you need during a default installation, and give you quite a bit. FreeBSD tends to start small, and let you customize after installation. I can say that Fedora is bloated by default, while someone else might say, no FreeBSD is too minimal by default. (See the FreeBSD myth above.)

During installation, you are given the option to add many packages, but many users prefer to just get the system up and running, update the base system, then begin adding packages.

A minimal FreeBSD install will have your basic tools (but not X), with very little started by default. In contrast, a default Fedora installation will have 20 or more optional daemons running at first boot. This can sometimes surprise the newcomer to FreeBSD. "I booted up and and I can't ssh to the machine." During installation, you're asked if you want to run the ssh daemon at boot, but people miss that screen. If you don't explicitly decide to run it, it won't run at boot.

Preliminary configuration

FreeBSD has one main configuration file, /etc/rc.conf. The syntax is quite simple, for example, if you want to run the ssh daemon at boot, you add the line sshd_enable="YES" to rc.conf.

Interfaces are also configured there. Rather than eth0, eth1 and such, their name will vary, depending upon the manufacturer. For example, an Intel EtherExpress will be fxp0. The 3Com 3c90x will be xl0. (The system should figure this out for you.)

The IP address and any aliases will also be in rc.conf, rather than a completely separate file.

Those who are used to Fedora's GUI tools might find it confusing at first. Those who prefer to directly edit the various files will find it simpler. Rather than several different files for hostname, interfaces and the like, it's all in /etc/rc.conf.

Firewalls

FreeBSD has a few different firewalls available. At present, it seems that OpenBSD's pf is the most popular. Whether its syntax is simpler or more complex than iptables is another user opinion. However, its documentation is quite good. One can start with my own page which has links to the official documentation. It is usually configured by modifying a sample text file, though there may now be some GUI tools for it.

Documentation

People seldom argue that the BSD documentation tends to be better than Linux. Far too often, Linux man pages give the impression that the developer added some cursory documentation out of a sense of duty. (This is, of course, not always the case, and there are many excellent Linux man pages.) Many times, the BSD man page will be more clearly written and give several examples of a command's use. The different ifconfig man pages are an example--the BSD pages include examples, including that of creating an alias on an interface. The Linux ifconfig man page has no examples, and only gives a brief mention of creating an alias, with no indication of how it is done.

The BSDs also seem more diligent about their documentation in general. Not only is there a good man page for rc.conf, but each program that might be started through it has its own man page. In contrast, there is very little indication of what all those programs in Fedora's /etc/init.d, many of which run at startup by default, do. There may be a line or two in /usr/share/doc, but often, the user is forced to google for explanations of the various programs. Fortunately, there is the mjmwired site, which provides this missing information. However, that is a private effort.

Obviously, not all FreeBSD man pages are immediately clear to the beginner, nor all Linux man pages horrible, but in general, the BSD pages tend to be of higher quality.

Shells

The default Linux shell is bash. The default FreeBSD shell is either tcsh or sh. Net and OpenBSD also offer ksh as a default shell.

This can sometimes cause confusion to Linux users. A Linux shell script will often start with #!/bin/bash. This won't work on a BSD. Bash is a third party program, and if the user chooses to install it, will live in /usr/local. While /bin/sh is usually a link to bash in Linux, the BSD sh is a simpler version of the Bourne shell. Some bash syntax, such as the select loop, or using $UID to get the user ID, won't work in sh.

Many people choose to install bash or zsh. However, if you choose to do that, DO NOT CHANGE ROOT'S DEFAULT SHELL! As it is in /usr/local, if you have to boot up in single user mode, it won't be available at boot. For more details on this, there is an article on daemonforums.

Package and system management

FreeBSD offers both binary and source package management. Packages are more like using yum, installing binary versions of a package as well as handling dependencies. Ports are Makefiles which will download the sourcecode and compile it. With many ports, this is a relatively quick and painless operation, with some others, it can become quite involved. For example, the OpenOffice port's maintainer recommends having 9 gigs free to compile the source, as well as 2 gigs of RAM. That particular port can often take 8 hours to compile.

This is the exception. In general, one can go into a port's directory, type make install clean and be done with it in a few minutes.

Both ports and packages have their advantages. Packages, of course, are much quicker and easier. However, as there are over 16,000 ports, not all of them will have a package for your version, especially if you're running CURRENT. Ports also give the user greater flexibility--there are often many options that can be turned on or off when installing a port. Sometimes, one has to specify these options on the command line, but often a port will have a dialog, allowing you to choose which options you want.

Usually, if upgrades have a particular issue, it will be documented in /usr/ports/UPDATING. As mentioned above, this is one area where FreeBSD seems more conscientious than Fedora. This is also probably due, in part, to the clearer differentation between ports, which are third party packages, and the base system.

All ports go into /usr/local. (In FreeBSD--NetBSD for example, uses /usr/pkg.) Where Fedora's postfix, cups, or apache configuration files will be in /etc, FreeBSD will have them in /usr/local/etc. There will also, for those programs which can run as daemons at startup, be a script put into /usr/local/etc/rc.d. Whether or not this script will be run can be controlled by adding an entry to /etc/rc.conf. In practice, this isn't so different than deciding whether to enable a script in /etc/init.d with the service or chkconfig command. However, in general, Fedora will tend to automatically enable a new program in init.d by default, whereas in FreeBSD, you will have to deliberately choose to let it run at startup.

Upgrading the system is a bit more complex. The handbook's chapter, "The Cutting Edge," explains it rather well, though the handbook is sometimes out of date. I have my own page about it which is also slightly dated.

If one runs RELEASE with the GENERIC kernel, and only needs security updates, Colin Percival's freebsd-update is an excellent alternative. Otherwise, one basically downloads the source code, compiles it, recompiles the kernel, then installs it. This can be time consuming. On a PIII 500 with a gig of RAM, it can take hours. On a Quad Core with 4 gigs of RAM, it will usually run 20-30 minutes.

Upgrading the system is separate from upgrading ports. Though there are various programs to examine installed ports and see what needs updating, it's never a good idea to type portupgrade -a (for all) and walk away. There are often configuration dialogs that need filling in (though one can preconfigure the system to accept all defaults) and one port or another may fail to compile, bringing the operation to a halt. (This of course, is also true of yum.) It does require more work than keeping a binary system, such as Fedora or Debian, up to date.

Hardware support

Generally speaking if hardware works with either Linux or FreeBSD, it will work with the other one. If your hardware works with Fedora, it will usually work with FreeBSD.

However, with fairly new hardware, Linux is usually ahead of the BSDs. For example, the UX31E Asus Zenbook, as of early 2012, had a fairly new wireless card as well as a Mac Airbook like USB dongle for wired ethernet. Though both worked out of the box with Linux 3.x kernels, neither worked with FreeBSD. Note this is one person's experience with one machine's hardware, but Linux drivers, in my (not at all heavily researched) experience, tend to be a bit ahead of the ones for BSD.

Software

FreeBSD has over 16,000 ports, and will often have a port for a program Fedora doesn't have. However, Adobe does not make Flash for FreeBSD, and that, as well as some other programs, will have to be run in a Linux emulation layer. Although people get Flash 8 and 9 working with wine, in general, Flash 7 is probably the highest version that is relatively trivial to install.

The popular virtualization program, VMware doesn't support FreeBSD. There is a VMware workstation 3 port, but aside from being very outdated, it doesn't always build properly.

There is a relatively new VirtualBox port. I haven't used it myself, so don't know how well it works. A bounty has been placed on VMware workstation 6 at rsync.net and has been claimed by the person who ported VMware 3, so it is hoped that this will change.

Qemu does work on FreeBSD.

Performance

There are various benchmarks around, most of which contradict each other. As a default FreeBSD install is running far fewer programs than a default Fedora install, FreeBSD may be faster by default.

The owner of the Distrowatch site replaced a FreeBSD server with a Debian one. His stated reason was that it was a matter of time, and it was far quicker to set up a Debian server than it was for him, at least, to set up a FreeBSD machine. However, he did find that the Debian server ran a particular script more slowly than the FreeBSD installation had. Make of it what you will.

Both are used in mission critical, high load environments. For that matter, so are Windows and Mac servers.

One thing that might confuse a newcomer is that FreeBSD believes unused memory is wasted memory. Therefore, even if your machine is under light load, running the top command may show all memory being used. As long as swap isn't being used, there is no need to worry.

Forums

There are several forums for BSD users. There used to be bsdforums.org, but unfortunately, at time of writing, the administrator more or less abandoned the site, and it has been left to the spammers. It was never an official site. Some of its members started the rapidly growing daemonforums site to replace it.

There is also the smaller, but still excellent, bsdnexus site. Both of these focus on all of the BSDs. There is also the PCBSD forum and the DesktopBSD forums, both of which will often have useful tips for the newcomer to all BSDs.

Lastly, since this article was first written, freebsd.org now has its own forums, which seem to have become the main place to go.

Wrapping it up

If you're used to Fedora and its GUI configuration tools, you might be best off starting with PCBSD or DesktopBSD. If you're willing to do most of your configuration by command line, FreeBSD might be a good choice. It might be faster for you, but it might not.

There will be more work to configure it the way you want, but in most cases, it's not that difficult. There are various forums, mailing lists and the excellent documentation to help you.

There was a mailing list discussion, years ago, about the relative merits of mutt and pine. One of the participants commented that people were grabbing at all sorts of tehcnical reasons to justify what is, in the end, an emotional decision. Try FreeBSD. You'll like it or you won't. Both are fine.

One last note for any BSD-ers who see this. If you join a Linux forum and get into a discussion on BSD's merits vs. Linux, don't just join a forum to tell its users how horrible Linux is in comparision. All it does is annoy people. Would you like it if a Linux user joined a BSD forum and for their first post started with not only how much they liked Linux but how lacking BSD was in comparison?

There's nothing wrong with first stating that your preference is for BSD and then saying why you do. However, just because you feel that way doesn't mean that you're right. :). They both have good and bad points. Saying, "I prefer BSD because," is much different than saying, "BSD is much better than Linux because." Remember, as soon as you insult someone, you've gone a long way towards closing their mind.

There was a BSD thread on a Linux forum. I gave what I felt were the advantages of BSD, acknowledging that these were my opinions. I was a long time member of that forum.

Later in the thread, someone in their first few posts, basically restated most of my points, adding how terrible Linux was in comparison and was called a troll. The difference, even more than the fact that they were new to the forums, was that they had to add how horrible Linux is in comparison.

If you feel like doing that, go back to the beginning of this article and reread the official BSD opinion. It's user opinion only.