OpenBSD on a Lenovo Thinkpad X220

TL;DR: This is going to be yet another post about installing / running OpenBSD on an old Thinkpad X220. It’s not going to be different than all of the other guides that are already out there, but my motivation and what came of it afterwards might be interesting for some folks.

When cleaning up my flat and re-ordering my belongings I stumbled upon the Lenovo Thinkpad X220 I bought last year in a fit of “I loved this computer back when I owned it and it’s only 150 Euros”, only for it to gather dust pretty much ever since it arrived. I have an uncomfortable habit of that happening.

Finding it did remind me of the last time I used my first X220 before gifting it to a friend in around 2016, 2017. I was running OpenBSD on it, and I distinctly remember taking it with me on a work trip because my work-issued laptop had broken down days before. And funnily enough this was the only time in my professional career so far where I was unexpectedly confronted with the need to open a PowerPoint slide.

I have been struggling with enjoying computers as of lately, something that I plan on going into detail about in another post, so the idea to just install and tinker with OpenBSD again for the fun of it was appealing. That is exactly what I ended up doing, having a lot of fun in the process. I decided to write down and publish my notes and describe roughly what I did.

I know that there are a ton of blog posts and tutorials about OpenBSD on that specific machine already. But still, my notes might be useful to some. Everything that you are reading is based off of the excellent work of other people, including the OpenBSD documentation and countless blog posts.


After downloading, verifying and burning the image to a thumbdrive I booted up the machine. Because I want full disk encryption I need to do some manual work before running the installer.

First I found out the name of the SSD through sysctl hw.disknames and initialized an MBR (fdisk -iy sd0) on it and created a softraid-device in preparation for the encryption:

disklabel -E sd0
	a a
	offset: [64]
	size: [125829120] *
	FS type: [4.2BSD] RAID
	w
	q
	

Adding the encryption and going back to the installer:

bioctl -c C -l sd0a softraid0
	exit
	

From there on it was simply a matter of dutifully answering the questions posed by the installer and waiting for everything to be finished.

The only ‘challenge’ I encountered was my misconception that the built-in wireless chip would be supported out of the box, but I forgot that it required non-free firmware. So I had to do most of the install while standing on a chair to be able to reach the laptop while it was placed on top of a shelf next to my router. That was a good reminder to order / ‘borrow’ a long network cable from work.

With the firmware being automatically installed via fw_update during the setup, the first thing I did after booting the system was configuring it to connect to my wireless network. That required adding the following lines to /etc/hostname.iwn0:

join $my_wireless_network_ssid wpakey '$my_wireless_network_password'
	inet autoconf
	

followed by a /bin/sh /etc/netstart. I have to say that I’m impressed with the development of iwm(4). I remember that the performance was, to put it mildly, sub-par a few years ago - now I can utilize the chip to the fullest extent.

Closely behind was running syspatch to apply outstanding binary patches - from my hobbyist point of view, this tool was one of the greatest developments coming to OpenBSD in the last few years.

I ended up taking it a step further, switching over from a -release .. well, release, over to a snapshot of OpenBSD-current. I don’t remember how difficult this was to achieve in the past, but it’s as simple as the following now:

sysupgrade -s # Be warned, this will reboot your machine *without* any warning
	pkg_add -u # it is recommended to upgrade all installed packages afterwards
	

Afterwards I proceeded to enable apmd, with it hopefully increasing the the amount of time the battery lasts me. I added the following line to /etc/rc.conf.local:

apmd_flags="-A"
	

This ensured that, once I ran rcctl start apmd, it would start in automatic performance adjustment mode, dynamically in- and decreasing the CPU-frequency as needed. Speaking of processor, OpenBSD disables HyperThreading per default.

It can be re-enabled via sysctl; to make this change permanent I added it to /etc/sysctl.conf:

hw.smt=1 
	

Last but not least I gave myself permission to escalate privileges, if needed, via doas:

permit nolog gmmi as root
	

I forgot how pleasant doas is when compared to sudo, in every regard.

And that was about everything that needed to be done to get going with the user-centric parts, such as installing packages and, most importantly (/s) ricing the desktop experience.


Now I have (another) working computer at home that I can grab at any given point and do my things with. Getting there was almost trivial, I’d say that including ironing out a few issues here and there it took me less than an hour to have the system in a satisfying state.

But most of all: I had fun, sometimes a warm, fuzzy feeling even. Because it reminded me of how I felt years ago, as a teenager. I’m not going to pretend that I don’t feel some kind of lounging for when the Internet was, or at least felt like, a simple, happier place.

It’s (with relative certainty) nothing but nostalgia, and the Internet is most definitely not the place I remember it to be (given that I grew up during the most toxic time in online videogames I’m almost guaranteed to romanticize a lot of stuff). But tinkering with and using OpenBSD evokes the same emotional response that using a computer when I was a teenager gave me. The pure joy of discovering and learning.

And because of my preference of ‘low eye candy .. things’ OpenBSD strongly appeals to me. There is no Discourse, Discord or any of the other - depending on who you ask - amenities of online communication. Mailing lists in plain text are the main mode of communication surrounding the project, using IRC is not the exception, but the norm.

There’s also no fluff on the websites, no unnecessary promoting of the system. As a relative outsider it looks like there’s a culture of factualness and excellency surrounding the project in a lot of ways.

And this, for a lack of a better way to put it, ‘positive approach to professional rationalism’ is appealing. Despite the unlikeliness of me being able to contribute in any other meaningful way except financially it’s still something that I want to support. Even if it’s only by using the operating system.

Maybe it’s that feeling, maybe it’s some ‘rose-tinted computing glasses’ that allow me to blend out existing issues that would otherwise bother me. But what started out as the result of a fun exercise for an afternoon seems to have become my daily driver for now.

The only time I grab my Macbook is when my partner wants me to watch something while she falls asleep. Technically she wants to watch something while she falls asleep, but in practice she’s gone in minutes and I’ll still be there, wide awake three hours later. The speakers are plain and simply significantly better.

Everything else I perform on the X220. The only things that’s bothering me for now is that, for obvious reasons, I can’t use it with my desk setup, which relies on USB-C. Which is a shame, but for the time being not something that’s too much of an inconvenience for me.

I’m convinced that I still have a docking station somewhere around this flat. I’ll surely find it by the time 2023 rolls around ..


If you are interested in these things: I updated my dotfiles, my ~/.Xresources and ~/.i3status.conf / ~/.config/i3/config are on Github. Credits where credits are due, at one point or the other during the installation I utilized tidbits from the following sites: