1. What problem am I solving here?
2. What does it do?
3. How does it work?
4. TODO
5. Tips and tricks when using vmm
5.1. Getting into a Linux installer
5.2. Getting out of the console/cu

Emiel Kollof
April 02, 2025 08:17:11

Yes, OpenBSD vmm is limited, but you can still do a lot with it. I’ve been using it for a while now, and I’ve written a script to manage VMs with it. It’s called vm_manager, and it’s available on my GitHub page. In this post, I’ll explain how to use it and what it can do.

1. What problem am I solving here?

By default, OpenBSD vmm is not set up. You have to enable stuff, create config files and start and manage VMs manually. This can be a bit of a hassle, so I created vm_manager to automate the setup op vmm itself, and the creation and management of VMs.

It’s available on my Youtube scripts page here: Github - vmmanager

I’ve showcased this script on my youtube channel and demonstrated it’s use, but I think it’s worthwhile to write a blog post about it as well. You can find the video here: YouTube - vmm hypervisor and vm_manager.sh

2. What does it do?

It does a couple of things when it starts up for the first time:

  • It will set up the vmm environment for you, including things like dhcpd
  • It will generate and maintain a vmd.conf
  • It will download an installation ISO (the latest one by default, for several Linux distributions). OpenBSD snapshots will never be cached. Using custom ISOs is being developed.
  • When creating a VM, it will start the VM with an installation ISO mounted and it will boot from that.
  • You can archive/delete/start/stop and clone VMs. You can also import existing qcow2 files (e.g. from other machines)
  • And probably more in the future.

3. How does it work?

Well, I hate to be the guy that says RTFM, but the README supplied with this script will tell you all that you need. If you have any issues with it, please create an issue on github and I’ll look into it. Patches welcome too.

4. TODO

  • Custom ISO support - boot/install from custom ISO
  • IPv6 - Should be optional, but it should support it if it’s used

5. Tips and tricks when using vmm

It’s not a surprise that vmm is targeted towards OpenBSD, but you can install Linux if you want. Not every linux distribution will work though, I’ve had success with debian variants and Alpine Linux. Fedora/Rocky/Alma and Arch don’t seem to like how vmm handles ACPI (which it doesn’t as of this writing)

5.1. Getting into a Linux installer

VMs in vmm are headless. Any console interactions with vmm VMs are serial. The vmctl will use cu(1) to connect to it. Try to get into a mode that lets you add kernel parameters. You want to add

console=ttyS0,115200n8

to the kernel parameters line since vmm does not implements a graphics device. You will have to treat it like a headless installation.

5.2. Getting out of the console/cu

You will always be able to get out of cu(1) by the tilde (~) and period (.) after each other. If it doesn’t work, hit enter first and try it again. As an offtopic side note, you can also use this sequence to exit a stuck ssh(1) session.