OpenBSD Guest on a KVM Host

Computer environments without virtualisation are not possible anymore. Theoretically all problems in this are should be solved by now. There are is an exception:

Running OpenBSD as a guest under KVM, unfortunately gives some headaches. ⇒SEPPmail, our preferred mail encryption gateway, is a prominent example. It was running for years without problems. It has no problems under VMware, neither as appliance. As a KVM guest it started to behave badly.

2 countermeasures are required to make it run smooth again:

The configuration of the virtual machine in ⇒Proxmox:

boot: c
bootdisk: virtio0
cores: 1
hotplug: 0
memory: 4096
name: <hostname>
net0: virtio=<mac-addresse>,bridge=vmbr0,tag=3
numa: 0
ostype: other
scsihw: virtio-scsi-pci
serial0: socket
smbios1: uuid=<uuid>
sockets: 1
tablet: 0
vga: serial0
virtio0: ceph:<disk>,size=30G

Important are sockets: 1 and serial0: socket.

Using a VGA console, the CPU starts using 100% and the machine freezes. Use a serial console as the solution for this problem.

On current Proxmox versions, the synchronisation of the time does not work anymore.

Running the command:

time sleep 1

I expect a duration of 1 second. Not so with OpenBSD and KVM (Proxmox). After a few hours uptime the duration of this command takes several seconds. After a reboot everything is fine for a short time period.

This problem can be solved:

On the host system (Proxmox) you execute the command:

echo options kvm-intel preemption_timer=N >>/etc/modprobe.d/kvm-intel.conf

Reboot the host system.

Then check the values:

cat /sys/module/kvm_intel/parameters/preemption_timer

If it returns “N”, the problem is solved.

It seems, on later versions of KVM, at least the ones used in Proxmox 6.4 and 7, this setting is no longer required.