Installing OpenBSD on Oracle Cloud
It finally works in 7.2!
I’ve been trying to get OpenBSD to install on OCI since early last year. As described in my email to misc@, my intial method of installation was rather unconventional:
- Download the install image to tmpfs
- dd it onto the host boot device (/dev/sda)
- Reboot
This works perfectly for Alpine, I’ll have you know but not so much for OpenBSD. I don’t know why. Anyway, with that rather useless preface aside, OpenBSD now supports booting on amd64 OCI instances:
Allowed bsd.rd and bsd/bsd.mp to boot on Oracle Cloud amd64 instances.
This time around, I decided to try a somewhat less nuclear approach to booting it. The steps I followed were from a kind internet stranger’s article, coincedentally ranting about how they failed to boot OpenBSD on OCI.1
It’s fairly straight forward, and you’ll be fine simply following the steps in the article I linked above; but since you’re here, let’s run through them real quick:
Download the
install72.img
onto an OpenBSD machine. Trust me, dealing with loopback mounts is not fun on Linux.“Mount” the install image using vnconfig(8):
vnconfig vnd0 install72.img mount /dev/vnd0a /mnt
Configure booting over serial:
echo 'set tty com0' > /mnt/etc/boot.conf
Convert the modified
install72.img
to qcow2 usingqemu-img
. We will be uploading this to OCI as a custom image.qemu-img convert -O qcow2 install72.img install.qcow2
Uploading the image requires creating an object storage bucket first. Navigate to Storage â Buckets and create one. Call it whatever.
Upload the qcow2 from step 4.
Head to Compute â Custom Images and click Import Image. Choose your bucket and qcow2 and select image type as QCOW2. We’ll stick to Paravirtualized mode. Give it a bit.
Once it’s done importing, create a new amd64 instance like you normally would, and choose your newly created custom image. Don’t bother with SSH keys.
Launch a console connection to access the serial boot. You should hopefully see the OpenBSD installer. You might have to hit Enter once. Hit ‘I’ and start the install.
There should only be one disk available. Choose that. Everything else should just work like in any other OpenBSD install.
That’s about it. I for one am super excited to move all my instances to OpenBSD. As always, donate to the OpenBSD project to ensure the continued development of our beloved puffy.
- I pinged them on the fedi to let them know it works now: https://h.icyphox.sh/u/icy/h/3NGd59X2d6Kr958Nt2 âŠī¸
Questions or comments? Send an email.