More on Open Source Software
FreeBSD is a UNIX-like OS that has been around since 1993. If you’re familiar with Linux or other UNIXes, you have most of the knowledge required to try it out, but you will also notice a
few differences. Those familiar with the underpinnings of Mac OSX know that it, too, is based on BSD.
FreeBSD may not be as popular or as well known as other operating systems, but that doesn’t mean it’s not reliable or robust enough for most enterprise tasks. See how it fares when taken out for a spin.
FreeBSD isn’t as popular as the better-known Linux distros, but it has a strong reputation for reliability and robustness, and it’s still in active development. For my first foray into FreeBSD, I tried out the latest stable version (8.1), which was released mid-July.
Installation and Setup
The homepage has a handful of install images, including a small net install and a full DVD. I had some difficulty with the net install, but I was successful with the DVD. (Note that if you’re trying out FreeBSD on a virtual
machine, there is a known bug with VirtualBox; Parallels seems to be OK.)
The install wasn’t as straightforward a process as it is with a modern Linux distro; it reminded me a bit of Linux installs a decade or so ago. I had some initial problems with the install process, and there weren’t many helpful error messages. On a couple of occasions I got no message at all, indicating that the install had failed (it just didn’t find the kernel on reboot), which was frustrating and made the problem hard to solve. Using the “custom” rather than the “standard” installation option seemed to provide more helpful error information. When I finally got the install to run successfully, the process was more informative, which is of course when you need the information least! The install docs seem to have very little troubleshooting information, unfortunately, although Google is helpful, as there’s a significant FreeBSD community out there.
Once the install was running correctly, I was asked how to set up my Ethernet card (and given the option to do this via DHCP) and whether I wanted to set the machine up for SSH login, as an NFS server or client, for FTP, and a few other questions. This was all pretty straightforward, but I did find that when I rebooted, the Ethernet connection wasn’t brought up automatically. Running dhclient as root brought it up. This may have been a human or hardware error on my end, but it was certainly a nuisance. Beyond these few initial questions, very little system setup is done
automatically, and the basic system is pretty minimal. To get much done you’ll need to check out the available ports.
You can browse the ports system before the install ends: This is a package collection that exists semi-independent of the base system and contains more than 21,000 ports. The post-install mechanics of port management are discussed below, but note that very few packages are installed by default (bash isn’t, for example), so it’s worth having a look through what’s available at install.
There are several ways of interacting with the ports system. To install packages manually, go to /usr/ports and use make search -name=packagename to find the path of the package you want. Then go to that directory and type make (as root) to build the package. This will both install the package and deal with dependencies.
The quicker method is to use pkg_add -r packagename, which will download (if necessary) and install a package for you (again, dependencies are handled). Using both methods, executables will be installed into /usr/local/bin/, which should be in your $PATH as a regular user, but it wasn’t in root’s $PATH for me. Only the most basic system tools are installed in /bin or /sbin. Check out man hier for further information on FreeBSD’s directory structure.
To get security updates, you can install the portaudit tool with pkg_add -r portaudit. Then run /usr/local/sbin/portaudit -Fda to check your current packages. (This should also happen as part of the daily security check, run from /etc/periodic/security/.) To upgrade ports, you’ll need to install portupgrade. Run pkgdb -F to check for and fix inconsistencies; then run portupgrade -a to upgrade all the outdated ports on your system. You can also use the portmanager or portmaster utilities to do the same job.
My default ‘user’ install didn’t include any X server or desktop. However, Gnome, KDE, and Xfce are all available for FreeBSD in the ports system, so I tried installing Gnome. Unlike an install on a Debian/Ubuntu system, the X server won’t automatically be set up to run Gnome during installation, so you’ll have to do it manually by adding:
to /etc/rc.conf. You’ll also need to install the xorg port to get utilities, such as startx. (These don’t get installed automatically with Gnome.) Once installed, however, it works exactly as you’d expect,
providing a full X desktop system. Packages such as openoffice are also available for install, so you shouldn’t have any problem setting up a fully functional user desktop. I liked that there is a lot of package independence on FreeBSD, and dependencies are minimal. However, you must put in more effort to make sure you get the packages you want, but equally, you don’t end up with a huge stack of installed packages that you don’t want.
As far as server software goes, there’s plenty available via the ports system,
and FreeBSD servers are known for their reliability. Again, however, I found
setup less intuitive than on recent Linuxes, partly because of the differences
in setup (e.g., try /usr/local/etc/rc.d/apache22 start to start Apache),
and partly because various settings are off by default and must be fixed. My
experience with recent Linuxes has been that installing a package also gives
you a basic working setup; with FreeBSD, you must do a bit more work to get
things running. Of course, from a security point of view, this is arguably
preferable, as on a FreeBSD system, you’re much less likely to end up running
services by accident.
You’re also closer to the system. There are fewer layers of setup tools between you and the software. This, obviously, has both advantages and disadvantages. It’s great if you want a very clear idea of what you’ve installed and are happy engaging directly with config files; it’s less great if you want quick default setups and to be up and running fast, or if you prefer graphical interfaces.
FreeBSD is definitely not as user friendly as modern Linuxes — you’ll need to be a lot more familiar with what’s going on under the hood and perhaps more prepared to have a couple of goes at the installation. The packaging
system works well, however, and the number of available packages is comparable with, for example, Debian.
If you want close control over your system and the software you install, FreeBSD is a decent choice. But be aware that if you’re a current Linux user, you’ll have a bit of a learning curve in front of you. This is not to say either style is better or worse, just different, and adjusting to differences takes time. Having said that, I got a working desktop system and a couple of server applications up and running within a few hours, and a lot of that was download time. It’s a powerful and functional member of the UNIX-like family, and reviewing it has certainly interested me enough to keep on experimenting with it.
Juliet Kemp has been messing around with Linux systems, for financial reward and otherwise, for about a decade. She is also the author of “Linux System Administration Recipes: A Problem-Solution Approach” (Apress, 2009).