Reinstalling OS with VMM

WARNING: Reinstalling the operating system may delete all files on the disk you install it on (and any other disks you edit). Make sure to backup any critical system files.

First, the user should power off the virtual machine, either by logging in to the guest machine and running:

$ doas shutdown -p now

Or, by logging in to the host machine:

$ ssh username@host.example.com

Replace username and host.example.com.

and forcibly shutting down the virtual machine:

$ vmctl stop username

Once the virtual machine is shut down, log in to the host machine (host.example.com) and continue the remaining steps:

$ ssh username@host.example.com

If you would like to make a backup of the disk for the virtual machine, you can make a backup copy as follows:

$ cp username.qcow2 username.qcow2.bak

Replace username.qcow2 with the name of your qcow2 image file.

In case you need to restore the virtual machine disk, simply rename username.qcow2.bak to username.qcow2:

$ mv username.qcow2.bak username.qcow2

Deleting the qcow2 image

You will want to delete (or move) the qcow2 image of your virtual machine disk.

WARNING: Deleting the qcow2 image below will erase all of your data. Are you sure you want to do this?! Make backups or backup your qcow2 image first!

$ rm username.qcow2

Next, we need to create a new disk for a virtual machine inside OpenBSD VMM:

$ vmctl create -s 20G username.qcow2

Replace 20G with the disk size you need, and replace username.qcow2. By convention, the disk name for the virtual machine will be the same as your username.

Finally, restart your virtual machine and log in to serial console:

$ vmctl start -c username

See the VMM Install guide for OpenBSD installation instructions.