Reference

bhyve_config(5)

bhyve configuration variables

NAME

bhyve_config – bhyve configuration variables

DESCRIPTION

bhyve(8) uses a hierarchical tree of configuration variables to describe global and per-device settings. Internal nodes in this tree do not have a value, only leaf nodes have values. This manual describes the configuration variables understood by bhyve(8). If additional variables are defined, bhyve(8) will ignore them and will not emit errors for unknown variables. However, these additional variables can be referenced by other variables as described below.

VARIABLE VALUES

Configuration variable values are stored as strings. A configuration variable value may refer to one or more other configuration values by name. Instances of the pattern ‘%(var)’ are replaced by the value of the configuration variable var. To avoid unwanted expansion, ‘%’ characters can be escaped by a leading ‘%’. For example, if a configuration variable disk uses the value /dev/zvol/bhyve/%(name), then the final value of the disk variable will be set to the path of a ZFS volume whose name matches the name of the virtual machine on the pool bhyve.

Some configuration variables may be interpreted as a boolean value. For those variables the following case-insensitive values may be used to indicate true:

  • true

  • on

  • yes

  • 1

The following values may be used to indicate false:

  • false

  • off

  • no

  • 0

Some configuration variables may be interperted as an integer. For those variables, any syntax supported by strtol(3) may be used.

GLOBAL SETTINGS

Architecture Neutral Settings

NameFormatDefaultDescription
namestring
cpusinteger1
coresinteger1
threadsinteger1
socketsinteger1
memory.guest_in_coreboolfalse
memory.sizestring256M
memory.wiredboolfalse
bootrompath
bootvarspath
acpi_tablesbooltrue
acpi_tables_in_memorybooltrue
destroy_on_poweroffboolfalse
gdb.addressstringlocalhost
gdb.portinteger0
gdb.waitboolfalse
keyboard.layoutstring
pci.enable_barsbool
rtc.use_localtimebooltrue
uuidstring
virtio.msixbooltrue
config.dumpboolfalse
bios.vendorstringBHYVE
bios.versionstring14.0
bios.release_datestring10/17/2021
system.family_namestringVirtual Machine
system.manufacturerstringFreeBSD
system.product_namestringBHYVE
system.serial_numberstringNone
system.skustringNone
system.versionstring1.0
board.manufacturerstringFreeBSD
board.product_namestringBHYVE
board.versionstring1.0
board.serial_numberstringNone
board.asset_tagstringNone
board.locationstringNone
chassis.manufacturerstringFreeBSD
chassis.versionstring1.0
chassis.serial_numberstringNone
chassis.asset_tagstringNone
chassis.skustringNone
oemstring.Nstringnone
rundirString/var/run/bhyve/
monitor.enabledboolfalse
monitor.no_rebootboolfalse
vcpu.N.cpusetstringnone

x86-Specific Settings

NameFormatDefaultDescription
x86.mptablebooltrue
x86.x2apicboolfalse
x86.strictioboolfalse
x86.strictmsrbooltrue
x86.verbosemsrboolfalse
x86.vmexit_on_hltboolfalse
x86.vmexit_on_pauseboolfalse
domains.N.sizestring
domains.N.cpusstring
domains.N.domain_policystring

arm64 and RISC-V Specific Settings

NameFormatDefaultDescription
consolestring

DEVICE SETTINGS

Device settings are stored under a device node. The device node's name is set by the parent bus of the device.

PCI Device Settings

PCI devices are described by a device node named “pci.bus.slot.function” where each of bus, slot, and function are formatted as decimal values with no padding. All PCI device nodes must contain a configuration variable named “device” which specifies the device model to use. The following PCI device models are supported:

hostbridge

Provide a simple PCI-Host bridge device. This is usually configured at pci0:0:0 and is required by most guest operating systems.

ahci

AHCI storage controller.

e1000

Intel e82545 network interface.

fbuf

VGA framebuffer device attached to VNC server.

lpc

LPC PCI-ISA bridge with COM1-COM4 16550 serial ports, a boot ROM, and, optionally, a TPM module, a fw_cfg type, and a debug/test device. This device must be configured on bus 0.

hda

High Definition audio controller.

nvme

NVM Express (NVMe) controller.

passthru

PCI pass-through device.

uart

PCI 16550 serial device.

virtio-9p

VirtIO 9p (VirtFS) interface.

virtio-blk

VirtIO block storage interface.

virtio-console

VirtIO console interface.

virtio-input

VirtIO input interface.

virtio-net

VirtIO network interface.

virtio-rnd

VirtIO RNG interface.

virtio-scsi

VirtIO SCSI interface.

xhci

Extensible Host Controller Interface (XHCI) USB controller.

USB Device Settings

USB controller devices contain zero or more child USB devices attached to slots. Each USB device stores its settings in a node named “slot.N” under the controller's device node. N is the number of the slot to which the USB device is attached. Note that USB slot numbers begin at 1. All USB device nodes must contain a configuration variable named “device” which specifies the device model to use. The following USB device models are supported:

tablet

A USB tablet device which provides precise cursor synchronization when using VNC.

Block Device Settings

Block devices use the following settings to configure their backing store. These settings are stored in the configuration node of the respective device.

NameFormatDefaultDescription
pathstring
nocacheboolfalse
nodeleteboolfalse
syncboolfalse
directboolfalse
roboolfalse
sectorsizelogical[/physical]

Network Backend Settings

Network devices use the following settings to configure their backend. The backend is responsible for passing packets between the device model and a desired destination. Configuring a backend requires setting the backend variable. The type of a backend can either be set explicitly via the type variable or it can be inferred from the value of backend.

The following types of backends are supported:

tap

Use the tap(4) interface named in backend as the backend.

netgraph

Use a netgraph(4) socket hook as the backend. This backend uses the following additional variables:

NameFormatDefaultDescription
pathstring
peerhookstring
socketstring
hookstringvmlink
netmap

Use netmap(4) either on a network interface or a port on a vale(4) bridge as the backend. The value of backend is passed to nm_open to connect to a netmap port.

slirp

Use the slirp backend to provide a userspace network stack. The hostfwd variable is used to configure how packets from the host are translated before being sent to the guest.

NameFormatDefaultDescription
hostfwdstring

If type is not specified explicitly, then it is inferred from backend based on the following patterns:

PatternType
tapNtap
vmnetNtap
netgraphnetgraph
netmap:interfacenetmap
valebridge:portnetmap

UART Device Settings

NameFormatDefaultDescription
pathpath
tcp

Host Bridge Settings

NameFormatDefaultDescription
pcireg.*integer

AHCI Controller Settings

AHCI controller devices contain zero or more ports each of which provides a storage device. Each port stores its settings in a node named “port.N” under the controller's device node. The N values are formatted as successive decimal values starting with 0. In addition to the block device settings described above, each port supports the following settings:

NameFormatDefaultDescription
typestring
nmrrinteger0
serstringgenerated
revstring001
modelstring

e1000 Settings

In addition to the network backend settings, Intel e82545 network interfaces support the following variables:

NameFormatDefaultDescription
macMAC addressgenerated

Frame Buffer Settings

NameFormatDefaultDescription
waitboolfalse
rfb
rfb
vgastringio
winteger1024
hinteger768
passwordstring

High Definition Audio Settings

NameFormatDefaultDescription
playpath
recpath

LPC Device Settings

The LPC bridge stores its configuration under a top-level lpc node rather than under the PCI LPC device's node. The following nodes are available under lpc:

NameFormatDefaultDescription
com1node
com2node
com3node
com4node
fwcfgstringbhyve
pc-testdevboolfalse
pcireg.*integer

TPM Device Settings

The TPM device stores its configuration under a top-level tpm node rather than under the LPC TPM device's node. Only one TPM device is supported. The following nodes are available under tpm:

NameFormatDefaultDescription
tpm.pathstring
tpm.typestring
tpm.versionstring2.0

NVMe Controller Settings

Each NVMe controller supports a single storage device. The device can be backed either by a memory disk described by the ram variable, or a block device using the block device settings described above. In addition, each controller supports the following settings:

NameFormatDefaultDescription
maxqinteger16
qszinteger2058
ioslotsinteger8
sectszinteger
serstring
eui64integer
dsmstringauto
raminteger

PCI Passthrough Settings

The ppt(4) device driver must be attached to the PCI device being passed through. The device to pass through can be identified either by name or its host PCI bus location.

NameFormatDefaultDescription
businteger
slotinteger
funcinteger
pptdevstring
rompath

VirtIO 9p Settings

Each VirtIO 9p device exposes a single filesystem from a host path.

NameFormatDefaultDescription
sharenamestring
pathpath
roboolfalse

VirtIO Block Device Settings

In addition to the block device settings described above, each VirtIO block device supports the following settings:

NameFormatDefaultDescription
serstringgenerated

VirtIO Console Device Settings

Each VirtIO Console device contains one or more console ports. Each port stores its settings in a node named “port.N” under the controller's device node. The N values are formatted as successive decimal values starting with 0. Each port supports the following settings:

NameFormatDefaultDescription
namestring
pathpath

VirtIO Input Interface Settings

Each VirtIO Input device contains one input event device. All input events of the input event device are send to the guest by VirtIO Input interface. VirtIO Input Interfaces support the following variables:

NameFormatDefaultDescription
pathpath

VirtIO Network Interface Settings

In addition to the network backend settings, VirtIO network interfaces support the following variables:

NameFormatDefaultDescription
macMAC addressgenerated
mtuinteger1500

VirtIO SCSI Settings

NameFormatDefaultDescription
backendstringctl
ctl_ringszinteger64
evt_ringszinteger64
req_ringszinteger64
num_queuesinteger1
seg_maxinteger64
thr_per_qinteger16
target[ID:]path/dev/cam/ctl

The target variable may be specified multiple times with different path arguments to configure multiple distinct SCSI targets. If not explicitly configured, the target IDs will be assigned sequentially beginning with the highest target ID configured so far, or 0 for the first target configured. The target IDs must be unique within each virtio-scsi instance.

The meaning of the path argument is specific to each backend:

BackendPathDescription
ctl/dev/cam/ctl[pp.vp]

The following backend-specific variables are supported for VirtIO SCSI:

BackendNameFormatDefaultDescription
ctliidinteger0

SEE ALSO

expand_number(3), getaddrinfo(3), strtol(3), netgraph(4), netmap(4), ng_socket(4), tap(4), vale(4), vmnet(4), bhyve(8)

History