OpenBSD as KVM guest
Written by Kirill Filatov, on 17 May 2024.
Tags:
#cloud
#openbsd
OpenBSD as KVM Guest
# Add guest agent package
pkg_add qemu-ga
# Add to autostart
rcctl enable qemu_ga
Qemu-ga reads its settings from /etc/qemu/qemu-ga.conf. I prefer to write logs to file instead of STDERR for reading logs after system start.
Config sample:
[general]
method=isa-serial
path=/dev/tty00
verbose=1
logfile=/var/log/qemu_ga.log
# Let boot logs go to serial console
echo "set tty com0" >> /etc/boot.conf
# Allow your serial console in /etc/ttys.
It’s where getty finds information about consoles for login prompt, so you can run virsh console.
Do not add “secure” at end of line if you don’t want cloud admins to bruteforce your root password. Final record should look something like this:
tty00 "/usr/libexec/getty std.9600" vt220 on
You can get and change serial console settings via stty stty -a -f /dev/tty00
See also this article.