Hi all,

I’m sharing my notes about installing OpenBSD on a VC1. Although OpenBSD doesn’t have NBD support, we can use the fact that the VC1 is a “virtual” machine to install and boot this operating system.

These instructions are mostly a group of quick/dirty hacks to get a vanilla OpenBSD machine working

Preparation

Create a new VC1 VPS in the Scaleway management console, and boot any Linux distribution (Alpine Linux for example). This is just to get the control plane happy so it doesn’t kill the server automatically.

Log onto your linux VPS (via SSH) and also via the console.

Installation

Reboot the VPS and focus on the console, when you see the following lines, press Ctrl+B to get the iPXE command line

iPXE 1.0.0+git-20131111.c3d1e78-2ubuntu1.1 -- Open Source Network Boot Firmware -- http://ipxe.org Features: HTTP HTTPS iSCSI DNS TFTP AoE bzImage ELF MBOOT PXE PXEXT Menu Press Ctrl-B for the iPXE command line...

From here, issue the following commands to get a DHCP address and boot from the OpenBSD ISO image (commands you have you type are after the iPXE> prompt)

iPXE> dhcp Configuring (net0 de:19:44:0d:20:04)...... ok iPXE> initrd http://ftp.ch.openbsd.org/pub/OpenBSD/5.8/amd64/install58.iso http://ftp.ch.openbsd.org/pub/OpenBSD/5.8/amd64/install58.iso... ok iPXE> chain http://boot.salstar.sk/memdisk iso raw http://boot.salstar.sk/memdisk... ok MEMDISK 6.03 0x56215aab Copyright 2001-2014 H. Peter Anvin et al e820: 0000000000000000 000000000009f800 1 e820: 000000000009f800 0000000000000800 2 e820: 00000000000f0000 0000000000010000 2 [...] disk: hd0+ sr0* cd0 >> OpenBSD/amd64 CDBOOT 3.23 boot>

At this point we are at the second stage bootstrap just prior loading the kernel, here we want to make sure that the installed uses com0 instead of the default pc0 tty and then press Enter to start the installer.

boot> set tty com0 switching console to com0 >> OpenBSD/amd64 CDBOOT 3.23 boot>

From here you can continue with encrypting the disk or with a standard OpenBSD installation

Post installation

With the system installed, we have some more work to do. Install curl and run it at boot-time to get the control plane happy and make sure it doesn’t kill the server.

As root

pkg_add curl

Edit/Create the /etc/rc.local file and put this little snippet in here

if [ -x /usr/local/bin/curl ]; then echo "Signalink server state: booted" && /usr/local/bin/curl http://169.254.42.42/state -X PATCH -H 'Content-Type: application/json' -d '{"state_detail": "booted"}' fi

You can now safely reboot your machine.

Note that everytime you reboot your server, you’ll have to press Ctrl+B and exit iPXE to start the VPS from the local disk. Otherwise it will load a Linux kernel from the network and it obviously won’t work.

This could be worked around by @Scaleway providing a “boot from disk” bootscript

Please let me know if this works for you, or if I missed some important parts.