NetBSD vs. OpenBSD: out-of-box experience

I was tinkering with NetBSD over the past weekend because I was trying to see how a certain feature works on NetBSD, and see if it can be ported over to OpenBSD. I work with OpenBSD every single day, but this is the first time I've touched NetBSD in a long time; the last time I fired up NetBSD was in my grad school years, which now seems like eons ago. The NetBSD version I tried was 4.0.

Compared to OpenBSD, I noticed a few differences about NetBSD's "out-of-box experience", to borrow a favorite Microsoft term. Of course, both NetBSD and OpenBSD do not actually have a "box" to come out of, but you catch my drift. :) I just want to document them in this blog for anyone in a similar situation, i.e. you have been using OpenBSD for years, but are looking to try NetBSD for whatever reason.

Now a lot of things that I'm about to point out will be due to my past experience and background as an OpenBSD user. I'm sure I'll hit on a lot of items that are probably done differently in NetBSD which I haven't found out how to do yet. So, seasoned NetBSD users: please remember you're reading a blog post written by a seasoned OpenBSD user but a complete NetBSD n00b. :) If I say something silly, please feel free to drop a comment and show me and other readers how to do something or work around something.

Menu-driven vs. shell script installer

Since we're dealing with OOBE here, I guess we should begin with the installer. NetBSD's installer is menu-driven, while OpenBSD's is basically a shell script that asks you questions.

NetBSD's menu-driven system is probably much better suited for newcomers because it seems friendlier, but there were certain things that confused me even as a seasoned BSD user. For example, the installer asks about where to install bootblocks and how to touch the MBR, which would have certainly confused a NetBSD newcomer. I think it could be easily improved by tweaking the verbiage a little bit.

In contrast, the OpenBSD script-based installer will seem confusing to a newcomer. I think the biggest hurdle for newbies is the disk partitioning tool, but once you get the hang of it (especially with some explanation from an experienced OpenBSD user), you can pretty much set up your disk partitions on autopilot.

Another advantage of a script-based installer over a menu-driven one is that you don't have to use arrow keys at all to install the system. You might be wondering, what's the big deal with using arrow keys? Well, at Calyptix we have to install OpenBSD systems all the time, since they're the foundation of AccessEnforcer. A script-based installer that doesn't require arrow keys helps a ton because we can easily script the installation process (well, sort of -- Calyptix insiders will know what I'm talking about :)).

The other thing about the menu system is that the screen always refreshes after a command is run. For example, during the disk partitioning process, after each partition is formatted, the menu clears the screen and you don't know the results of the partitioning process. A script based installer never clears the screen, so it always leaves the results of the previous command visible to you. Nothing wrong with menu-driven systems clearing the screen; this is strictly a matter of taste.

Other differences

Apart from the menu-driven system, here are a few things that caught me by surprise on NetBSD:

  1. No option to set up the network interface during the install. What I mean by this is that the menu-driven system did not (as far as I can remember) allow me to set up the network interface completely, e.g. tell the network interface to obtaining a DHCP lease. To do this, I had to wait until the first boot after installation, edit /etc/rc.conf to set dhclient=YES, and reboot again (or run "dhclient $ifname"). To be fair, the NetBSD installer does advise you to edit /etc/rc.conf and refer to /etc/defaults/rc.conf after install.
  2. sshd is not started by default. This was a big surprise for me. After the first boot, I was left on a system without sshd, and I had to manually edit rc.conf again before I could log in.
  3. sudo is not installed by default. Okay, I'm spoilt by the fact that sudo is installed by default on OpenBSD. :) My brain is hardwired to run visudo after the first boot in order to let my regular user run some commands as root. I was a bit disappointed that it was not there.
  4. No adduser script. Speaking of setting up regular users, which is advised by NetBSD's motd (message of the day), there's no adduser script. To add a user you have to run "usermod -m -G wheel joe" followed by "passwd joe". Now, this is strictly a nit. It just means more post-install commands to remember for a NetBSD user. On OpenBSD, all you need to remember is that the "adduser" command adds a new user. :)

I guess what I'm saying is that, on OpenBSD, right after the first reboot, your system is pretty much networked and ready to go; you can SSH right in and do your post-install settings immediately (because its network interface is already set up, and sshd runs by default). On NetBSD, you'll have to set up the network interface after the first boot, and then only are you ready to ssh in.

To me, having an ssh-ready box right after installation is a great advantage. If you're installing system in an "inconvenient spot", like a cramped freezing server room facing an ancient CRT monitor whose refresh rates will make you blind, it is very nice to have an ssh-ready box that you can ssh into over the network from a more comfortable spot to do the post-install setup.

Closing thoughts

At this point, I should pause and remind readers that this is not a NetBSD-bashing post. :) It's strictly about documenting the differences between NetBSD and OpenBSD OOBE experience, from the viewpoint of a seasoned OpenBSD user.

OpenBSD has plenty of quirks too. And moving from one platform you're very familiar with to a new one will always bring frustration and surprises. I remember a friend of mine who moved from Linux to OpenBSD, and was extremely frustrated with how things were laid out differently. I had similar frustrations moving from Linux to Mac OS X on my desktop. I think it just depends on you're "wired" -- you like Chevys with automatic transmission, I like stick-shift Hondas. It always takes time to shed old habits and learn new ones if we swap cars. :)

And in case anyone out there misunderstands -- we're not moving the AccessEnforcer from OpenBSD to NetBSD. :) As I mentioned earlier in my post, I was just trying to see how a certain feature works in NetBSD, and assess whether it's feasible to port that feature over to OpenBSD.

8 comments:

Eric Schnoebelen said...

You comment that the NetBSD install didn't ask for network setup.

I would guess that you did a CD based install. If you do a network based install (one that grabs the files of the net) it will walk you through setting up the network, and then once the installation is complete, ask if it should record those settings for the next boot.

Lawrence Teo said...

Thanks Eric!

Yes I did do a CD-based install, because I was installing it onto a new machine with a blank hard drive.

I'll poke around the docs some more to see how to do a network based install.. thanks!

david said...

I know this is off topic but I am a seasoned OpenBSD user myself, and am only moving to NetBSD for three reasons, 1. To test NetBSD, I have never used it before, 2. To get my radeon hd 3650 card to work from pkg'ed drivers so I can have true blue media center PC running on a *bsd and 3. to run an ice-cast server (which I have successfully done with OpenBSD) on this media center pc. The main reason being the drivers for my ATI Radeon HD card. I know this sounds like a whack reason to switch over to NetBSD oh yeah and also I have never got USB audio to work with OpenBSD, I also didnt spend enough time on it as well.

Anonymous said...

I really wish they would re-merge the two projects (OpenBSD & NetBSD). Combining the best of both projects would be great. They are both well suited to embedded use because they are small, yet complete systems.

For an embedded installation on compact flash where you have to set C/H/S, OpenBSD has no option for setting these values directly, you enter values using different terms and have to enter some as calculations that are not documented. This could easily be scripted (which NetBSD does quite well). In fact NetBSD will boot even without setting these values, and with the wrong file system in /etc/fstab (/dev/sd1a versus /etc/wd0a) which makes life easier if installing on a different system than the target which is typical for embedded systems. Of course both systems know where the kernel lives without /etc/fstab, NetBSD can actually use it though.

OpenBSD and NetBSD both have nice memory file system options, but OpenBSD has a built in option to easily and quickly populate it from disk on mount (you just sync it to disk every so often while running).

I also like having Apache/SSL all ready to go with OpenBSD.

No a la Expo Zaragoza 2008 said...

I've been a GNU/Linux user for many years, but now I feel curiosity about the BSD systems... I just don't know yet which one to try...

FreeBSD seems to focus on performance and ease to use, NetBSD on portability and OpenBSD on security (but apparently also on portability, standardization, and correctness).

This will look like a troll question, but anyway: does NetBSD offer any advantage over OpenBSD when running on common hardware (i386/amd64)?

Thanks.

Anonymous said...

You can configure networking from the CD. On the main screen choose the option to "Configure" maybe the fourth item in the main install list. You can setup your networking and then continue the regular install. This will edit the correct files in /etc to reflect how you configured it.

marc said...

I am a seasoned OpenBSD user and I was also quite shocked when using NetBSD for test purposes. You know, I don't want to sound ignorant, or anything, but NetBSD seems quite messy to me. Some of the things are quite illogicaly placed, like /etc/defaults/*, but - as you've already mentioned - it seems to be a matter of taste. I think I'll stick to OpenBSD for its clarity, logic and stability.
Also, why NBSD has any leftovers of alsa ... ? that's really beyond me, guys.

Anonymous said...

Maybe things have changed, but my last NetBSD install seemed clunky whereas installing OpenBSD seemed like a journey into Zen setting it all up. My choice? Slackware Linux.