Can I do my job with OpenBSD?
Introduction
Why not be normal and use a Mac or Windows PC? Windows is horrible to use and Macs are too expensive1. Neither are Open Source. I’m not a fanatic about this, but it is something I’m passionate about, and will always default to FOSS where possible. I found it very easy to do my job with linux, so why not try using a *BSD? I know I probably can, but I want to find out.
It is about 18 months since I switched to using Linux full time; having used it on and off as a hobby on a spare laptop or dual-boot for about 15 years. I was at that point in time, a windows user, largely because of gaming. I can’t remember what the final trigger to switch was, but it involved OneDrive, Office365, and some important work files not loading correctly. I had a spare SSD lying around, quickly installed Fedora, LibreOffice, copied the files over from a USB backup and everything just worked. I quickly discovered that with proton, 99% of my steam library worked perfectly, modded minecraft was a breeze, and KDE/GS Connect paired with my phone fantastically. I couldn’t believe I didn’t switch sooner. I never booted back into my Windows install.
At this point in the article, I’d describe myself as a relatively intermediate user. Not scared of using the terminal, able to troubleshoot most issues, happy with TUIs. I do not however have a background in programming, sysadmin or any sort of technical training.
I’d first been introduced to *BSDs by my cousin who taught me about UNIX after asking them about their job. My introduction to Linux was around the same time, early teens, with the eye candy of Compiz, running on Ubuntu 6.06 on a friend’s laptop.
So I found myself at the beginning of 2022, on a beach holiday, with a copy of Michael Lucas’ (2019) Absolute FreeBSD 3rd Edition2 from the library, pouring over the pages, curious about something that I’d heard of many years ago, but never explored, with a VM running. Clearly I’m a nerd.
So here I am now with a bit of free time heading into summer holidays and the Christmas shutdown, wondering to myself, could I do my fast approaching next contract with OpenBSD? I’m pretty sure I could.
Inspired by a discussion I saw on /r/freebsd a few months ago, I have been curious about how hard it would be for me to do my job on an OpenBSD box. I chose OpenBSD over FreeBSD on basically a coin flip. I’ve heard great things about both. I’ve successfully built working systems in VMs but bare metal is something else entirely.
I am going to write a short series about my experiences. Linux & then BSDs were in the past, for me, this arcane world where I could never belong. Instead I’ve found great communities and learnt a lot on the way. Hopefully this will help others on the same path. You don’t need to be a sysadmin or programmer.
I’ll be doing this ‘challenge’ on a ex-govt Dell Optiplex, which I picked up for a little over 200 dollarydoos. i5-4690, 240gb ssd, and 8gb of RAM. I know hardware comparability is a real limitation of *BSDs so we’ll see how we go. Not expecting any issues here.
I would like to have a functioning workstation within a couple of days but I have my linux laptop as a backup.
Objectives
- A functioning, reliable system that requires little to no maintenance. Set and forget. I want everything to be functioning in a single afternoon to be ready to start after the weekend.
- Distraction free. This has to be done quickly. No needing to mess around with .dotfiles, no checking logs, no dealing with bugs and superfluous configurations.
- A simple to use system of backup methods, 3-2-1 model being applied. Ideally this would integrate with my existing systems. Borg Backup is available so this shouldn’t be an issue.
- Having a functional workstation which will be used in designing, testing and implementing a new set of workflows for a client, this will involve a lot of file management, SSH, setting up some basic security and file permissions for them and their staff3; and of most importantly writing all the documentation.
- Ultimately build a viable replacement for work, allowing me to keep my existing devices, purely personal.
Other things.
- Potentially gaming4. I know there is no chance of me getting my steam library on OpenBSD. But I am curious if I can get some old games running; Dosbox is in ports, so if we have energy at the end of this process we’ll try that too.
- A few other small utilites, such as an RSS reader and video player that can handle streams.
Part 1: The ‘Install and Configure’ Process.
-
Downloaded the install72.img and flashed it to a USB drive using Gnome Disks - I was thinking I may have to attempt this again using
DD(8), but it seems all went well first attempt. -
Boot the usb - no issues here. Followed the install script though, the installer picking up the PCI Intel NIC. Autoconf for IPv4… and then the first snag. The SSD I wished to install it on was not detected. Okay then. ctrl-c down to a shell and then, as my linux experience has taught me,
lsblk(8)… which is not a binary in OpenBSD.Fdisk(8)was there however, but being very new to BSD, I was not sure of the disk label that I was after.GoogleDuckduckgo to the rescue! The OpenBSD FAQ taught me that the drive I wish to install to is likelywd0. Success! Or at least I thought. fdisk wd0 results in the errordevice not configured. Drat.At this point I’ve already hit a bit of a snag and feeling quite dumb. Surely I’d get further than this?
So I do what any sane troubleshooter would do at this point and run
reboot. There is a weird hang but it still rebooted.The next sanity check before trying the install process again was booting the already installed slackware system. Well that booted fine, and all my files are there, so back into the OpenBSD usb… well the installer is still not finding my ssd.
At this point I’m feeling quite lost. Just a few minutes into my afternoon and we’ve hit a point of failure already.
" If at first you don’t succeed, try, try again "
I work on the assumption that if I could boot into Slackware, and login with my user account, chances are the drive is working fine. So lets try again.
Back to DDG, and a stack exchange answer suggested that I check the SATA operation in the BIOS, changing ‘Raid On’ to ‘AHCI’ if needed. I needed to. No idea what it means, but done.
It is at this point, someone much more patient than me, would immediately go look up what AHCI is. Knowing that this entire endeavour is supposed to be also be a learning exercise, I do. The Wikipedia page highlights that OpenBSD does have support for AHCI.
I then boot up the install USB again. Success! My SSD is now recognised, as sd0 and not wd0. I continue through the install program, with (W)hole disk GPT [default]. (Step 2 is taking quite some time isn’t it? We’re about 30min in at this point.)
Disk partitioning is quite different to my usual experience here. On my linux installs I usually just have a /boot/efi, and leave the rest of the disk as a giant / partition.
The OpenBSD handbook provides a solid primer on the reasoning behind having a more complicated setup by default here. Michael W Lucas (2013) suggests that we follow the (A)uto layout, however before I sally forth, I have a look at the layout and the amount of space I have to play with. I get a /home of ~140gb, and sizeable /usr & /usr/local too. /usr/local is apparently needed for wxallowed, a security feature. For those curious, as I was, about what exactly is wxallowed is, Wikipedia is again useful.
As for space, I’m happy with the default partition layout. One of the reasons I tend to just make a large / is the worry that I’ll somehow run out of space. With a 240gb SSD however, I doubt that will happen. The default layout appears more targeted for a server, rather than a workstation.
We go with (A)uto.
-
We made it though the disk process. Now to install the sets. I’ve got a great internet connection, and a local mirror, so lets install via HTTP to ensure everything is fresh. Mirror selection 1, all sets selected; enter. This process is extremely quick. Less than two minutes in total.
base72in 21 seconds. Much faster than most linux installs. -
I’ve elected not to use
xenodm(1)at this point; I can always enable it later. The installer detects that this is a multiprocessor machine so the bsd.mp kernel is automatically selected. fw_update is run, and I see some a line about Intel & inteldrm, and less than a minute later I’m greeted with “CONGRATULATIONS!” I feel I’ve achieved something today.(R)ebootand we’re off to start configuring our system.It’s about an hour at this point since I started. That includes the various troubleshooting steps, and a diversion or two to read Wikipedia. The process here wasn’t too daunting, and I’d expected a bit of a challenge. I’d say it was easier than the first time I installed Arch. If I was setting this up on my laptop I’d be looking into full disk encryption. Something to consider in the future.
Part 2: First boot and configuration.
- Booting into the system was painless. I did have to change the boot order in my bios, but that was expected. I login to my user account and run
mail(8). A welcome letter greets me. I’ll give that a read later. - Before I go any further, I login to my router and set up a static IP. I enabled SSHD during the install process, and want to configure this now. I normally use zerotier for SSH, but we’ve not got time for that at the moment.
- Time to install vim. doas isn’t configured yet, so
su root, and then pkg_add vim-no_x11. - Time to setup
doas.conf(5). I’ve had a bit of experience with this, and it’s pretty straight forward, just one line needed for a single user. OpenBSD by default places my user into the wheel group. Soecho permit persist :wheel as root > /etc/doas.confis all that is needed. I could of course use Vim if needed. I thensu $userto get back to my own account. - This system will be using X11 and I’ll be trying out
cwm(1). To get this setup, runwhereis cwm, and then piping that to ~/.xinitrc (whereis cwm > ~/.xinitrc). Time to runstartx. - At this point I take some time to configure
~/.cwmrc. One of the great things about OpenBSD are the excellent manpages,cwmrc(5). I’ve not used CWM before so I thought I’d give it a go. This is a learning exercise too. - After I’ve got a setup I’m happy with, I’m going to install the remaining desired packages, with
doas pkg_add.
Thoughts
-
At this point we’re running at a little under two hours since this entire process started, and I’m pretty happy with what I’ve accomplished. Everything is setup, I’ve got a firefox window open with the bitwarden extension and ublock origin installed. Time for a well-deserved cup of coffee.
-
I’m going to play around a bit with CWM as I’ve heard great things. The primary reason I use Gnome on my main desktop and laptop, is that it ‘just works’ and I don’t get distracted for hours with .dotfiles and tweaks. There is plenty of choice (inc Gnome!) if I don’t stick with CWM
-
The process was straightforward aside from the AHCI hiccup, there are so many excellent resources out there to help. The install process was excellent, much easier than installing and configuring Slackware 15.0 on the same PC.
-
My work requirements aren’t hard. I know from past experience that I can do much of my writing with vim and plugins. Firefox + a text editor is 95% of my workload covered. I am currently using Apostrophe to write all of my documents.
-
Much of a modern workload can be accomplished with Firefox. Indeed the everyperson just uses a computer to open a web browser and a handful of electron apps.
Resources
Notes
-
Actually I think they’re reasonably priced, Apple Silicon is awesome, battery life is fantastic and I can walk into a number of Apple stores and get proper tech support for free, even out of warranty. ↩︎
-
I can’t remember what first introduced me to Michael Lucas’ work, but he’s a fantastic writer. Both his Absolute FreeBSD 3rd Edition and Absolute OpenBSD 2nd edition were available for an excellent price in a recent humble bundle. ↩︎
-
It is fair to say that the client nor their staff possess a great deal of technical acumen. They all happily admit this, which is why I’m doing all of it. ↩︎
-
The complete opposite of distraction free naturally. ↩︎
-
As a ’newbie’ Man pages are amazing and I can’t believe new Linux users aren’t taught or encouraged to use them. ↩︎