NetBSD Virtual Machine Monitor
NVMM is a hypervisor that provides hardware-accelerated virtualization support for NetBSD. It is made of an ~MI frontend, to which MD backends can be plugged. A virtualization API is shipped via libnvmm, that allows to easily create and manage virtual machines via NVMM. Two additional components are shipped as demonstrators, toyvirt and smallkern: the former is a toy virtualizer, that executes in a VM the 64bit ELF binary given as argument, the latter is an example of such binary.
NetBSD.org: From Zero to NVMM.
The kernel code: browse.
The libnvmm API: browse.
The demonstrators: download.
The man page: open.
The regression tests: browse.
Make sure you have the latest NVMM headers installed. If you don't:
# cp /usr/src/sys/dev/nvmm/nvmm.h /usr/include/dev/nvmm/Make sure you have the latest version of libnvmm installed. If you don't:
# cp /usr/src/sys/dev/nvmm/nvmm_ioctl.h /usr/include/dev/nvmm/
# cp /usr/src/sys/dev/nvmm/x86/nvmm_x86.h /usr/include/dev/nvmm/x86/
# cd /usr/src/lib/libnvmm/Load the NVMM kernel driver:
# make install
# cd /usr/src/sys/modules/nvmm/You may want to run the NVMM tests to confirm that your setup is correct:
# modload ./nvmm.kmod
# cd /usr/src/tests/lib/libnvmm/Install the qemu-nvmm package from pkgsrc-wip. Note that this will conflict with any previous Qemu package that you installed. Configure the permissions:
# chown root:nvmm /usr/pkg/bin/qemu-system-x86_64Once this is done, you can finally launch Qemu with NVMM acceleration, by adding "-accel nvmm" to your usual Qemu command line. For example:
# chmod g+s /usr/pkg/bin/qemu-system-x86_64
$ qemu-system-x86_64 -cdrom NetBSD-8.1-amd64.iso -m 256M -accel nvmmTested guest OSes:
|Win95 32bit||Doesn't work|
|Win98 32bit||Doesn't work|
|Win8 64bit||Works||On Intel CPUs only for now|
|Win10 64bit||Works||On Intel CPUs only for now|
|Fedora 64bit||Works||Pass "no_timer_check" in grub|
|ArchLinux 64bit||Works||Pass "no_timer_check" in grub|
Linux performs timer checks at boot time which fail under hypervisors. To work around this, on certain distributions, you must pass "no_timer_check" in grub.
NetBSD 8 (top left), Fedora 29 (top right), Windows XP (bottom left), Windows 10 (bottom right),
all running via Qemu+NVMM on NetBSD.
NVMM can support up to 128 virtual machines, each having a maximum of 256 VCPUs and 128GB of RAM. It works with both x86 AMD CPUs and x86 Intel CPUs.
NVMM has unique design properties, not currently found in other hypervisor solutions. A detailed analysis is available on this blog post.