This episode covers virtualization on DragonFlyBSD: the nvmm(4) type-2 hypervisor, QEMU integration, VM management, networking with tap and bridge, plus VM installation and snapshot practices.

In episode 17 you controlled the scheduler and tuned kernel performance. Now we put all that power to one big purpose: running another operating system inside DragonFlyBSD. Episode 18 covers virtualization with NVMM — the built-in type-2 hypervisor that sets DragonFlyBSD apart among modern BSDs.
Remember from episode 0: the safest way to learn is in a VM. Now your position is reversed — you're not the guest, but the host. You'll provide virtual homes for other OSes, give them networking, and create snapshots for their protection.
NVMM is a type-2 hypervisor integrated into the DragonFlyBSD kernel. It provides the CPU and memory virtualization primitives used by emulators like QEMU. The advantage: hardware-assisted virtualization with low overhead, without relying on third-party modules like KVM or bhyve.
Checking whether nvmm is available and loaded:
kldstat | grep nvmm
sysctl kern.nvmmIf it's not loaded yet, load the module:
kldload nvmm
echo 'nvmm_load="YES"' >> /boot/loader.confnvmm_load in loader.conf loads the module automatically at every boot.
QEMU is the emulator that uses NVMM as its accelerator. Install QEMU from pkg:
pkg install qemuA QEMU built with NVMM support will use the accelerator when the -accel variable is specified.
An example of running a Linux image with NVMM acceleration:
qemu-system-x86_64 -accel nvmm \
-m 1024 -smp 2 \
-drive file=/vm/debian.qcow2,format=qcow2 \
-netdev user,id=net0 -device virtio-net-pci,netdev=net0-accel nvmm enables acceleration; -m 1024 -smp 2 gives 1 GB of RAM and 2 vCPUs; the disk uses the qcow2 format; networking uses user mode (QEMU's internal NAT).
Info
Use virtio devices for disk and NIC inside the VM — they have the lowest overhead. For high-performance storage, place your qcow2 files on a HAMMER2 filesystem: HAMMER2 snapshots and deduplication will protect and save space for your entire VM images.
The user mode is practical for experiments, but for a VM that should appear as a normal host on the network, use tap + bridge:
ifconfig tap0 create
ifconfig bridge0 add em0 add tap0 up
qemu-system-x86_64 -accel nvmm \
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no \
-device virtio-net-pci,netdev=net0 \
-drive file=/vm/debian.qcow2,format=qcow2A tap interface acts like a virtual cable plugged into the bridge, so the VM gets an address directly from the physical network — the standard pattern for VM servers in a data center.
QEMU VMs are managed through the monitor. Run with the monitor active:
qemu-system-x86_64 -accel nvmm -monitor stdio \
-drive file=/vm/debian.qcow2,format=qcow2Inside the monitor, commands like info status, system_reset, and quit give you full control over the VM without closing the host.
Just like HAMMER2, VMs can also be snapshotted. There are two levels:
savevm snap-2026-08-03
loadvm snap-2026-08-03hammer2 snapshot /vmCombining both gives layered protection: the qcow2 snapshot for VM state (including memory), the HAMMER2 snapshot for the whole directory.
Warning
A HAMMER2 snapshot of a qcow2 file that a VM has open can be application-inconsistent. For the best results, shut down the VM (or at least flush) before a filesystem-level snapshot, or rely on savevm at the QEMU level, which understands internal state.
In this episode 18 you ran virtualization on DragonFlyBSD: understanding the type-2 hypervisor nvmm(4) and how to load it, integrating QEMU with -accel nvmm, managing VMs with the monitor, setting up networking via tap and bridge, and creating snapshots at both the QEMU and HAMMER2 levels.
Key takeaways:
kldload nvmm and persist it in loader.conf.-accel nvmm; install it with pkg install qemu.savevm/loadvm for VM state, hammer2 snapshot for the directory.In the next episode, episode 19, we combine all your storage knowledge: storage engineering: HAMMER2 production. You'll design a NAS/storage server with multi-volume HAMMER2, manage dedup and encryption, schedule snapshots with cron, monitor with hammer2 status, and use growfs for resizing in 6.2+.