OpenBSD Journal

VM owners can now override the boot kernel

Contributed by rueda on from the more VMs less root dept.

Dave Voutila (dv@) has added another feature to virtualisation on OpenBSD. Thanks to the following commit, it is now possible for the owners of virtual machines to override the boot kernel:

CVSROOT:	/cvs
Module name:	src
Changes by:	dv@cvs.openbsd.org	2023/04/28 13:46:42

Modified files:
	usr.sbin/vmctl : main.c vmctl.c 
	usr.sbin/vmd   : config.c control.c parse.y vm.c vmd.c vmd.h 

Log message:
vmd(8)/vmctl(8): allow vm owners to override boot kernel.

vmd allows non-root users to "own" a vm defined in vm.conf(5). While
the user can start/stop the vm, if they break their filesystem they
have no means of booting recovery media like a ramdisk kernel.

This change opens the provided boot kernel via vmctl and passes the
file descriptor through the control channel to vmd. The next boot
of the vm will use the provided file descriptor as boot kernel/bios.
Subsequent boots (e.g. a reboot) will return to using behavior
defined in vm.conf or the default bios image.

ok mlarkin@

… and there was much rejoicing!

(Comments are closed)


Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]