Sunday, 30. March 2025

Installing *BSD in 2025 part 1 - A critical look at FreeBSD's installer

[This article has been bi-posted to Gemini and the Web]

In this article we'll take a look at FreeBSD's installer _bsdinstall_ which was introduced with FreeBSD 9.0 (2012), replacing the older sysinstall. The latter had a lot of advanced options which the new one lacked. More than a decade later, though, bsdinstall has evolved considerably. Time to take a closer look (using FreeBSD 14.2).

I like bsdinstall. So much actually that I'd say it is clearly one of the best ones among Open-Source operating systems. However this does not mean it couldn't be improved further. This is why I'm going to take a _critical look_ at it and comment on the various dialog screens, sharing my thoughts and ideas for refinement or improvement.

My approach here is to do a mostly default installation in a local VM on my home network. The focus here will be the flow, presented options and friendliness towards newcomers. In the second part I'm going to present a couple of additional dialogs which are missing from the path that I took.

Installing a (mostly) default FreeBSD system

Some years ago, Allan Jude joked on the BSDNow! podcast that basically even a woodpecker could install FreeBSD by repeatedly hitting the return key! While this is not entirely true (and for good reasons!), I still think that this is a great approach to organizing an installer: Whenever it's possible to just accept a default setting, let the user do that by simply pressing return.

Welcome, keymap and hostname

The welcome dialog (PNG)

The welcome screen does exactly what you'd expect from it: Greet the user and offer the choices to start an installation (default), to shell out or to go into a live system. My only nitpick here is that newcomers might be confused by what the difference is between the shell and live system options. My suggestion here would be to change the text in the box from "or use the live system?" to "or exit the installer and use the live system?".

Keymap selection (PNG)

The US keymap surely is a sensible default. My preferred keymap (one of the ergonomic variants) is not in the list - but that's not the installer's fault! I created a layout file for FreeBSD years ago but failed to ever submit it, so shame on me.

Hostname selection (PNG)

Next is an input dialog for the hostname. While this is seemingly as simple as it gets, I actually do have a suggestion: Mention that you can enter an FQDN here! It's pretty common in other installers that you are expected to enter the unqualified hostname and the domain name separately. So this is one of the possible pitfalls for newcomers.

System installation

Distribution set selection (PNG)

The first step of the actual installation is selecting which distribution sets to install. I admit not knowing the rationale for installing the kernel debug files by default but not the userland ones. But if we are any lucky, this dialog will become less important in the near(ish) future as _PkgBase_ matures!

Partitioning choices (PNG)

A central choice for the system to be installed is how to partition the drive(s). ZFS support has come a long way from experimental status in FreeBSD 7.0 to finally being the default since 13.0 if I remember correctly. And while UFS is still actively maintained (even new features land occasionally!) and is a solid filesystem in general, ZFS' nature of volume manager + filesystem simply is a killer combination that absolutely deserves to be the default.

If you really miss fixed partition sizes so you can run out of space and all the "fun" related to classic filesystems (or rather you're on an embedded system with very little RAM), the other options are still available. I also like the bottom line with the pointer to the tuning guide.

ZFS configuration (PNG)

On to configuring ZFS. I have only three minor comments here. The first is that I don't understand why encrypted swap is not the default. And the second is that it would be great to be able to press the down key on the last option to wrap around and get back to the top.

Yes, I'm aware that there are hotkeys, so I can press 'W', then 'T' and up to jump around (I've been unable to enter characters like '>' using VNC or IPMI since the mapping of my system keymap is regularly screwed up - which is not a FreeBSD problem at all but of course nevertheless affects installing this OS). Newcomers however might not notice the shortcuts and forcing them to go all the way back up to proceed is somewhat inconvenient.

Trying to proceed with the defaults here would result in an invalid selection as the "default" is a 0 disk wide stripe. It's interesting to note that this still works and the installer automatically displays the pool configuration dialog next! I didn't know this until I discovered it by accident a while ago.

ZFS pool configuration (PNG)

This dialog is fine as-is. The bottom line with extra explanations is excellent and should be really helpful for newcomers.

Drive selection (PNG)

The drive selection works well enough. There is no sensible default other than listing all the available drives without selecting any so the user needs to pick the right one(s). One little detail here is that this dialog unlike the previous one does not contain any usage information in the line between the buttons and the window shadow. I think putting "[Press SPACE to select / deselect]" there would not hurt and make the installer yet another bit friendlier towards newcomers.

Warning about writing disk changes (PNG)

This dialog is perfect as-is. I especially like how two different background colors are utilized that are not used anywhere else in the installer. You cannot be expected to be more vocal about destroying disk contents if proceeding. Also the NO button is the logical default here even if it violates the "woodpecker rule". A destructive operation requires deliberate affirmation.

Installation progress (PNG)

The next screen is the progress meter of the actual installation process. It has seen improvements over the years like the green colored bars for the finished sets. The only thing I can think of that could possibly make sense is a 'cancel' button. Then again changing your mind at this stage is somewhat weird and FreeBSD is a rather lean OS that installs pretty quickly compared to others. It might give the user a slightly better feeling of still "being in control" and maybe just in this moment somebody might notice having picked the wrong distribution sets! I don't think it's particular important, though.

Root user and network configuration

Setting the root password (PNG)

The first action of configuring the system is setting the root password. While the current way of shelling out to 'passwd' works well enough, it breaks the consistency of the workflow which the installer had up to this point. Offering a TUI dialog window instead would be a mostly cosmetic improvement, but I of course have to make this obvious suggestion.

Network configuration: NIC selection (PNG)

The NIC selection menu simply does the job: It lists available interfaces and lets the user select one to configure. There's just one enhancement that I would propose here: Also displaying the MAC address could be useful. If you have your hardware organized in a DCIM / IPAM tool like NetBox and servers with multiple network cables attached are the norm, it is quite useful to be able to reliably map them to the respective NICs. Especially since people who only install FreeBSD occasionally might not be too familiar with the BSD style interface naming.

It could look something like this (example from one of my home PCs - of course I don't have an _re_ in a server!):

re0 [00:13:3b:0f:e2:1a] RealTek 8168/8111 B/C/CP/D/DP/E/F/G PCIe Gigabit Ethernet

Network configuration: IPv4 address? (PNG)

Network configuration: DHCP? (PNG)

The two previous dialog menus are fine in general. FreeBSD is doing the right thing here: Unlike some other operating systems which will happily assume you want DHCP and only offer manual configuration if it fails, the installer asks whether or not to attempt DHCP configuration!

The only suggestion that I have is that the currently two steps could be merged into one, saving one keypress. The single IPv4 configuration window could simply have the following three buttons to further streamline things:

[ DHCP ] [ Static ] [ No IPv4 ]

Manual IPv4 configuration (PNG)

This window does just what you'd expect: It lets the user enter a static IPv4 address and subnet mask as well as the default router address. The only remark I have on this is that I've seen people trying to use CIDR (aka. "slash notation") in the subnet mask field. Doing this confuses the installer and takes you back to selecting the NIC for configuring which could in turn puzzle the user. The same is true for any kind of invalid input.

Having an error window with even just a message like "invalid IP address", "invalid network mask" or "default gateway not in subnet" would be much better. Of course a more helpful explanation (e. g. mentioning that CIDR is not allowed and the format is either hex or dotted decimal with the equivalents of CIDR /24 being 0xffff00 or 255.255.255.0) might actually make more sense.

IPv6 address? (PNG)

SLAAC? (PNG)

Same thing here: The decision on whether to use IPv6 for the interface and on using SLAAC or not would fit pretty well into one dialog window:

[ SLAAC ] [ Static ] [ No IPv6 ]

Manual IPv6 configuration (PNG)

What I wrote about manual IPv4 configuration applies to v6 as well of course.

Resolver configuration (PNG)

The resolver configuration once again does exactly what it should: It allows for setting a search domain and nameserver(s) for IPv4 and v6. The menu is variable of course, so if in the previous menus no IPv6 was selected, the resolver configuration would look like this:

Resolver configuration (on an IPv4-only system) (PNG)

What I particularly like in FreeBSD's installer is that it lets you configure two nameservers and not just one.

Date and time configuration

Region selection (PNG)

Timezone selection works well in bsdinstall. The first menu lets the user select the continent / region. Offering UTC as the default is as close to a sensible default as can be in this case.

Country selection (PNG)

Unless you picked _UTC_, the installer offers a sub-menu with countries located in the region you chose before.

Timezone selection (PNG)

Since some countries have multiple timezones, there's another sub-menu, depending on which country you picked. My country is weird here; while we have only _one_ timezone, you can choose between two in bsdinstall - which is a testament to how carefully the authors of the installer did their job! The story behind this oddity is that Büsingen is a German exclave in Switzerland. Over 4 decades ago there has been a one-time situation where the rest of Germany used summer time but Switzerland didn't - and Büsingen chose to stick to Swiss time.

It's a bit annoying that this historic oddity is the default, though! I'd prefer to rename 'most of Germany' to 'Berlin', which would solve it.

Timezone confirmation (PNG)

The next menu basically asks the user to confirm if the abbreviation of their timezone looks familiar, providing an option to double-check. Since time is crucial with IT systems this is not a bad idea.

Date settings (PNG)

After setting the time zone, the installer gives the user the option to select the correct date. Definitely useful in case the current values are off! I don't remember when this was added, but together with the next one, it's one of the latter additions to bsdinstall.

Making 'skip' the default here is a good choice since usually the machine's clock is correct.

Time settings (PNG)

Of course being able the set not only the date but also the actual time is useful. Again the default makes perfect sense.

Services and hardening

Service configuration (PNG)

The next menu is for enabling additional services at system start. There's no right or wrong here as the selection largely depends on what the installed system is meant to do. Except for desktop systems (which are unfortunately rare with FreeBSD), enabling the _sshd_ is a sensible default, though.

System hardening (PNG)

There has been some discussion on whether or not introducing the hardening menu was a good idea. For me it was a pleasant surprise when it was added and I still think it's a good idea. IMO it's pointing newcomers in the right direction as they are more likely to investigate what the various option do (and thus get to learn about other system settings they should consider for hardening).

I would in fact prefer if some of these were to be set by default in the future. For example there are very few sensible use cases where _not_ randomizing PIDs is necessary. Also every sane *nix system clears /tmp on startup, anyway, right?

Firmware installation (PNG)

This is a very recent addition and certainly a good one. My test VM doesn't need it, but on real hardware it is not too unlikely that firmware needs to be installed to be able to properly use all the devices.

Add user accounts? (PNG)

The option to add more users is important. Since you definitely don't want to allow SSH'ing in as _root_, the system should have at least one user so you can connect remotely.

And if FreeBSD were to follow OpenBSD's lead and import _doas_ into base (one can hope, eh?), that user might even allow for easier provisioning of the new system using salt or ansible for example! But I digress.

Adding more users (PNG)

The actual adding of the user(s) happens outside of bsdinstall's menu-driven workflow. Sure, that works. It doesn't leave the most polished impression on the newcomer, though.

However my major complaint here is that the installer doesn't do anything to point out that a membership in group _wheel_ is required if the user should be able to _su_ to root. People coming to FreeBSD from various Linux distros might simply no know this and su's laconic "Sorry" in that case is notoriously unhelpful! Other operating system installers do a _much_ better job at this than FreeBSD's.

Wrapping up

Final configuration (PNG)

Providing a menu to re-visit previous steps at the end of the installation makes sense. Perhaps you changed your mind on something or made a mistake previously that you need to correct (since the installer doesn't always let you go back one step during the installation process)?

Being able to install the handbook from here is a bit hidden among the steps that were previously completed. Maybe moving it up, just below 'Exit' (the logical default option) and then drawing a line like this might help:

----- Revisit previous steps -----

Chroot for manual configuration? (PNG)

This option is probably not used by most people but for those who do need it, it's incredibly helpful. Need to tune /etc/sshd.conf before the first boot? Want to use _freebsd-update_ right now so you don't have to reboot twice? Here's your chance. Having it default to 'no' makes sense, though.

Installation complete! (PNG)

Of course a final dialog is needed to inform the user of the installation's completion and present the choice how to proceed. Rebooting is certainly what most people will want to do at this point, so once again it's the perfect default.

Alternative installation: Using UFS

Unix' traditional filesystem, UFS, is still a thing. Even though above I made fun of the traditional partitioning, there's valid use cases for UFS. It's still a solid choice and even it's original creator, Dr. McKusick, is still around.

Manual partitioning (PNG)

If you don't select 'Manual' partitioning rather than 'Auto (ZFS)' or 'Auto UFS', you get the partition editor menu. It shows my 20 GB virtual hard disk and offers various options like manually adding partitions or having the installer propose a layout.

Entire disk or not? (PNG)

If you select 'Auto', you're asked whether you want to use the entire disk or partition it first. Since you rarely run systems in production where not the whole drive is dedicated to one OS, 'Entire Disk' is a good default choice.

Partitioning scheme selection (PNG)

The installer then asks which partitioning scheme to use. The default depends on the platform; if you try to make a problematic choice, a message window is displayed warning you that the system may not be bootable using that option - which is a nice feature.

Auto layout (PNG)

This is how the proposed auto layout looks on my test VM: The required EFI boot partition, a single UFS partition for the system mounted on / as well as a small swap partition.

Modifying entries (PNG)

It's possible to modify entries. You can for example add a GPT label to the partitions or edit the mount points. While it also lets you edit the size, I've found that this does not work: The size simply doesn't change when you hit 'OK'! There's no error message, either, so this is weird. This is probably a bug.

Adding partitions (PNG)

Of course it's always possible to remove suggested partitions and add new ones. You have to know the partition types like 'freebsd-ufs', but since we're in the expert part of the installer, that's fair. Creating new partitions also lets you also change UFS options.

UFS filesystem options (PNG)

Soft updates and journaling are enabled by default for new UFS filesystems, but enabling TRIM might be something that you could be interested in. The installer lets you select it here.

Custom layout (PNG)

Finally, when you're happy with your custom layout, you can select 'Finish' which leads to one more dialog (which informs you that you're about to lose data on your drive if you proceed). Afterwards the installer follows the same path as we've taken above.

Installation over serial

FreeBSD - like any serious OS - can be installed over a serial console. Whether you want to install it on a headless device or use SoL (Serial over LAN) with your servers, it's of course helpful if the installer supports this.

Terminal type selection (PNG)

If you connect via serial, FreeBSD's loader has been able to conveniently set serial as the primary console in the menu for some years now. If the installer detects a serial console, it will ask about your terminal's capabilities before going into menu mode. Unless you're doing something really special, your terminal emulator definitely supports XTerm - but VT100 is there in case you need something more compatible with reeealy old devices (and should you actually have to install in ANSI mode, ask yourself what you did seriously wrong in your last life!).

Welcome dialog: XTerm (PNG)

The welcome menu looks pretty much like it did in the EFI console, too. The reason for this is that in XTerm mode, color output is supported.

Installation progress: Xterm (PNG)

The rest of the installer also looks familiar as you can see.

Welcome dialog: VT100 (PNG)

Picking the more compatible option means installation without colors. It doesn't look too pretty but you still get the standard dialog-based installer which is very nice!

Keymap selection: VT100 (PNG)

It's all basically the same as usual, just without color.

Welcome dialog: ANSI (PNG)

If you're installing in ANSI mode, better know your hotkeys since they cannot be highlighted. And don't even try to use cursor keys and such overrated bric-a-brac! Now don't you claim that bsdinstall doesn't have a heart for masochists (or maybe people doing mindblowing things for which it _might_ somehow be useful - but such scenarios go way beyond my creativity).

Conclusion

FreeBSD's installer obviously had quite a bit of thought put into it. While it initially was lacking some features, it is very mature at this point. Installing FeeBSD with bsdinstall is both easy to do and allows for a variety of choices to be made.

But things are almost never _perfect_ - and bsdinstall is not an exception here. Even though I'm fairly familiar with it, taking a closer look at it revealed a surprisingly large amount of things that could potentially be improved further. Most of them are minor details, though, some even just cosmetics. The most significant shortcoming that might irritate newcomers is that in many places there's no 'Back' button. But even that's less of a problem due to the ability to get back to the respective dialog windows via the menu at the end.

I'm fairly sure that the installer will continue to evolve in the future and maybe this article can spark a discussion about a couple of things.

What's next?

In the next article I'll take a closer look at OpenBSD's installer.

Installing *BSD in 2025 part 2 - A critical look at OpenBSD's installer

BACK TO NEUNIX INDEX