Last night I had a need to put together a new OpenBSD machine. Since I already use DigitalOcean for one of my public DNS servers I wanted to use them for this need but sadly like all too many of the cloud providers they don't support OpenBSD. Now they do support FreeBSD and I found a couple writeups that show how to use FreeBSD as a shim to install OpenBSD.
They are both sort of old at this point and with OpenBSD 6.6 out I ran into a bit of a snag. The default these days is to use a GPT partition table to enable EFI booting. This is generally pretty sane but it looks to me like the FreeBSD droplet doesn't support this. After the installer rebooted the VM failed to boot, being unable to find the bootloader.
Thankfully DigitalOcean has a recovery ISO that you can boot by simply switching to it and powering off and then on your Droplet.
This boots what appears to be an Ubuntu image with a menu of options that can help you fix your Linux based VM. In fact instead of using the FreeBSD install to shim your OpenBSD install you could do the following.
- Create a FreeBSD droplet (filesystem and version doesn't matter at this point).
- Once created, power it off.
- Select the recovery ISO.
- Once booted select option 6 for a shell.
- Fetch the OpenBSD installer, eg:
- Write that to the first harddisk, eg:
dd if=miniroot66.fs of=/dev/vda bs=512k
- Power off the Droplet.
- Go back to hard drive boot.
- Power on and install as per normal.
The key piece though is to make sure you partition the disk MBR. I went with
(W)hole disk MBR and then the default automatic disklabel layout, others
choose to label their disks differently but as long as the base partition table
is MBR your Droplet should boot ok.
It's probably worth noting that I still have this VM running happily in DigitalOcean. I have simply used sysupgrade(8) and syspatch(8) to keep it up to date and other than missing a change in the 6.9 release notes I've had no trouble with it.