Overview #
OpenBSD’s native hypervisor stack includes:
For detailed guidance, see the Handbook’s Virtualization chapter .
Directory Layout #
This example uses /var/vmm/ for VM assets; choose a private location with sufficient space. Create its images and iso subdirectories with root ownership before use.
| Purpose | Path | Notes |
|---|---|---|
| Disk images | /var/vmm/images/<name>.img | Sparse raw files created by vmctl. |
| Installer ISOs | /var/vmm/iso/<file>.iso | Store official ISOs (OpenBSD, FreeBSD, etc.). |
| Configuration files | /var/vmm/conf/ | Optional: store install.conf, kickstart, etc. |
| Logs (host) | /var/log/daemon | vmd(8) logs for troubleshooting. |
Disk and Image Creation #
| Task | Command | Notes |
|---|---|---|
| Create 10G sparse disk image | doas vmctl create -s 10G /var/vmm/images/obsd.img | Grows on write up to specified size. |
| Download OpenBSD ISO | doas ftp https://cdn.openbsd.org/pub/OpenBSD/7.9/amd64/install79.iso -o /var/vmm/iso/install79.iso | Use ftp(1) or similar tool. |
Before starting guests, enable and start vmd with rcctl. Verify downloaded installation media using the release SHA256.sig and matching signify key as described in Installing OpenBSD .
Single OpenBSD VM (Interactive Install) #
doas vmctl create -s 10G /var/vmm/images/obsd.img
doas vmctl start -c -m 1G -r /var/vmm/iso/install79.iso -d /var/vmm/images/obsd.img obsd
-c: Connect to console.-m: Memory (1G = 1024M).-r: ISO for installation.-d: Disk image.- Last argument: VM name.
After installation, reboot without ISO:
doas vmctl stop -w obsd
doas vmctl start -c -m 1G -d /var/vmm/images/obsd.img obsd
Networking Options #
vmctl start -n name attaches to an existing named switch. It does not interpret local or tap0 as special network modes. The -L option creates local networking; Internet access still requires host forwarding and PF policy.
Example: Two VMs on Private NAT Network #
Use the complete Virtualization
procedure to configure local networking, forwarding, and NAT before starting guests with -L. Creating a disk does not install an operating system in it.
Example: Bridge VMs to Physical LAN #
Create /etc/hostname.bridge0, replacing em1 with the intended LAN interface:
add em1
up
Define the switch in /etc/vm.conf:
switch "lan" {
interface bridge0
}
Activate it and start an already installed guest:
doas sh /etc/netstart bridge0
doas rcctl enable vmd
doas rcctl start vmd
doas vmctl reload
doas vmctl start -c -m 1G -d /var/vmm/images/obsd.img -n lan obsd
The guest obtains addressing from the LAN or uses a matching static configuration. To expose a single VLAN, create a vlanN interface with parent and vnetid settings and bridge that interface. vether0.<vlan> is not OpenBSD interface syntax.
Non-OpenBSD Guests #
FreeBSD #
Do not assume compatibility from a generic amd64 ISO. The official virtualization FAQ documents OpenBSD and Linux guests; this handbook does not provide a verified FreeBSD installation procedure.
Linux (Debian Example) #
Use media with serial-console support and a kernel supporting the provided virtual devices. Follow the current guest-specific installer instructions in the official virtualization FAQ and verify the image’s signature before booting it.
Windows (Unsupported Guest) #
vmm/vmd does not provide a supported Windows desktop guest procedure or graphical console. Use a host or hypervisor with documented Windows support.
VM Management #
| Action | Command |
|---|---|
| List VMs | doas vmctl status |
| Connect to console | doas vmctl console <name> |
| Graceful shutdown | Guest: halt or OS-specific |
| Force stop | doas vmctl stop -f <name> |
| Pause/resume | doas vmctl pause <name> / doas vmctl unpause <name> |
For non-root access, configure doas(1) .
Troubleshooting #
- Check
vmdlogs:tail -f /var/log/daemon. - Verify network interfaces:
ifconfig -a. - Confirm paths:
/var/vmm/images/,/var/vmm/iso/. - Check
pf(4)rules for custom networking issues.