Running OpenBSD 4.5 in KVM on Ubuntu Linux 9.04

Here’s a quick post on how to get OpenBSD 4.5 working as a KVM guest on kvm-84, the version that ships with Jaunty.

Unlike OpenBSD 4.4, which worked out of the box, 4.5 made some changes in their kernel with respect to interrupts that may have exposed bugs in KVM/QEMU. The workaround is to disable mpbios within the OpenBSD kernel. This will affect SMP guests adversely, so it isn’t for everyone.

Your kernel is affected by this if you boot and it hangs at:

1
setting tty flags

Credit goes to Todd Fries of Free Daemon Consulting, LLC for figuring this out and passing down the wisdom onto me.

Note: I’m using a 64-bit host as well as the 64-bit version of OpenBSD as the guest.

Step 1

Boot the OpenBSD 4.5 install CD within your blank VM and proceed through the entire install normally. Then, reboot from the hard disk but stop at the boot prompt

Step 2

At the boot prompt, perform the following:

1
2
3
4
5
6
boot> bsd -c
...
UKC> disable mpbios
 54 mpbios0 disabled
UKC> quit
...

System will now boot normally.

This has temporarily disabled mpbios and will not persist across reboots. You now have to make this change permanent in the OpenBSD kernel, as illustrated in the next step.

Step 3

Login to your new system as root and perform:

1
2
3
4
5
6
7
8
9
# config -ef /bsd
OpenBSD 4.5 (GENERIC) #2052: Sat Feb 28 14:55:24 MST 2009
    deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
Enter 'help' for information
ukc> disable mpbios
 54 mpbios0 disabled
ukc> quit
Saving modified kernel.
#

Now your system will boot up normally from this point onward.

Comments