---
name: "vmm"
section: "4"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd", "openbsd"]
url: "https://new.carta.tech/vmm/4"
---

# vmm(4)

bhyve virtual machine monitor

## NAME

**vmm.ko** – bhyve virtual machine monitor

## SYNOPSIS

In [loader.conf(5)](/loader.conf/5.md): **hw.vmm.maxcpu** **vmm\_load="YES"**

## DESCRIPTION

The **vmm.ko** module provides the kernel portion of the [bhyve(4)](/bhyve/4.md) hypervisor. The following platforms are supported:

- amd64: An Intel CPU with VT-x/EPT or AMD CPU with SVM support is required.

- arm64: The boot CPU must start in EL2 and the system must have a GICv3 interrupt controller. VHE support will be used if available.

- riscv: The CPUs must implement the H (hypervisor) RISC-V ISA extension.

PCI device passthrough to a virtual machine requires hardware with VT-d support and is available only on amd64.

## ACCESS CONTROL

Only the super-user and processes with write access to the */dev/vmmctl* device file may create and destroy virtual machines. By default, members of the *vmm* group have such access. Once created, a virtual machine may be destroyed only by that user or the super-user.

Unprivileged users must use “monitor mode” to run the virtual machine; in this mode, the virtual machine is automatically destroyed when its device file is closed. When running [bhyve(8)](/bhyve/8.md), this mode can be selected by specifying the **-M** flag.

Virtual machines can be created in a jail if the jail has the *allow.vmm* flag set.

## PCI PASSTHROUGH

On amd64 where the hardware supports VT-d, PCI devices can be reserved for use by the hypervisor. Entries consisting of the PCI *bus*/*slot*/*function* are added to the *pptdevs* [loader.conf(5)](/loader.conf/5.md) variable. Additional entries are separated by spaces. Host PCI devices that match an entry will be assigned to the hypervisor and will not be probed by FreeBSD device drivers. See the EXAMPLES section below for sample usage.

Note that **vmm** must be given first the right of refusal to all [pci(4)](/pci/4.md) devices it may need to claim. As a result, the **vmm** kernel module almost certainly needs to be loaded from [loader.conf(5)](/loader.conf/5.md) rather than by adding it to *kld\_list* *in* [rc.conf(5)](/rc.conf/5.md).

A large number of PCI device entries may require a string longer than the 128-character limit of [loader.conf(5)](/loader.conf/5.md) variables. The *pptdevs2* and *pptdevs3* variables can be used for additional entries.

In general, PCI passthrough cannot be used when running [bhyve(8)](/bhyve/8.md) as an unprivileged user or in a jail, as this feature requires write access to */dev/pci*.

## LOADER TUNABLES

Tunables can be set at the [loader(8)](/loader/8.md) prompt before booting the kernel or stored in [loader.conf(5)](/loader.conf/5.md).

- *hw.vmm.maxcpu*

  Maximum number of virtual CPUs. The default is the number of physical CPUs in the system.

## FILES

- */dev/vmmctl*

  control interface for creating and destroying virtual machines.

- */dev/vmm/\**

  device interface for individual virtual machines.

- */dev/vmm.io/\**

  device interface for device memory mapped into virtual machines.

## EXAMPLES

Reserve three PCI devices for use by the hypervisor: bus 10 slot 0 function 0, bus 6 slot 5 function 0, and bus 6 slot 5 function 1.

```
pptdevs="10/0/0 6/5/0 6/5/1"
```

It is possible to detach *ppt* from a PCI device without rebooting the host machine and then attach a host driver, using the [devctl(8)](/devctl/8.md) utility. Suppose *ppt* is currently attached to *pci0:0:1:0* and we want the host's [xhci(4)](/xhci/4.md) driver to be attached instead:

```
# devctl set driver -f pci0:0:1:0 xhci
```

The same can be applied to attach *ppt* back:

```
# devctl set driver -f pci0:0:1:0 ppt
```

## SEE ALSO

[bhyve(4)](/bhyve/4.md), [loader.conf(5)](/loader.conf/5.md), [bhyve(8)](/bhyve/8.md), [bhyvectl(8)](/bhyvectl/8.md), [bhyveload(8)](/bhyveload/8.md), [devctl(8)](/devctl/8.md), [jail(8)](/jail/8.md), [kldload(8)](/kldload/8.md)

## HISTORY

**vmm.ko** first appeared in FreeBSD 10.0. arm64 and riscv support first appeared in FreeBSD 15.0.

## AUTHORS

Neel Natu ⟨*neel@FreeBSD.org*⟩ Peter Grehan ⟨*grehan@FreeBSD.org*⟩
