xref: /illumos-gate/usr/src/man/man5/bhyve_config.5 (revision 1aa1f41fe10c6220a7fbef328fac1b72a8355a01)
1.\" SPDX-License-Identifier: BSD-2-Clause
2.\"
3.\" Copyright (c) 2021 John H. Baldwin <jhb@FreeBSD.org>
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.\" Portions Copyright 2022 OmniOS Community Edition (OmniOSce) Association.
27.\"
28.Dd February 26, 2022
29.Dt BHYVE_CONFIG 5
30.Os
31.Sh NAME
32.Nm bhyve_config
33.Nd "bhyve configuration variables"
34.Sh DESCRIPTION
35.Xr bhyve 8
36uses a hierarchical tree of configuration variables to describe global and
37per-device settings.
38Internal nodes in this tree do not have a value,
39only leaf nodes have values.
40This manual describes the configuration variables understood by
41.Xr bhyve 8 .
42If additional variables are defined,
43.Xr bhyve 8
44will ignore them and will not emit errors for unknown variables.
45However, these additional variables can be referenced by other
46variables as described below.
47.Sh VARIABLE VALUES
48Configuration variable values are stored as strings.
49A configuration variable value may refer to one or more other
50configuration values by name.
51Instances of the pattern
52.Sq % Ns Pq Ar var
53are replaced by the value of the configuration variable
54.Va var .
55To avoid unwanted expansion,
56.Sq %
57characters can be escaped by a leading
58.Sq % .
59For example,
60if a configuration variable
61.Va disk
62uses the value
63.Pa /dev/zvol/bhyve/%(name) ,
64then the final value of the
65.Va disk
66variable will be set to the path of a ZFS volume whose name matches
67the name of the virtual machine on the pool
68.Pa bhyve .
69.Pp
70Some configuration variables may be interpreted as a boolean value.
71For those variables the following case-insensitive values may be used to
72indicate true:
73.Pp
74.Bl -bullet -offset indent -compact
75.It
76true
77.It
78on
79.It
80yes
81.It
821
83.El
84.Pp
85The following values may be used to indicate false:
86.Pp
87.Bl -bullet -offset indent -compact
88.It
89false
90.It
91off
92.It
93no
94.It
950
96.El
97.Pp
98Some configuration variables may be interpreted as an integer.
99For those variables,
100any syntax supported by
101.Xr strtoul 3C
102may be used.
103.Sh GLOBAL SETTINGS
104.Ss Architecture Neutral Settings
105.Bl -column "memory.guest_in_core" "integer" "Default"
106.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description
107.It Va name Ta string Ta Ta
108The name of the VM.
109.It Va cpus Ta integer Ta 1 Ta
110The total number of virtual CPUs.
111.It Va cores Ta integer Ta 1 Ta
112The number of virtual cores in each virtual socket.
113.It Va threads Ta integer Ta 1 Ta
114The number of virtual CPUs in each virtual core.
115.It Va sockets Ta integer Ta 1 Ta
116The number of virtual sockets.
117.It Va memory.size Ta string Ta 256M Ta
118Guest physical memory size.
119The size argument may be suffixed with one of K, M, G or T (either upper
120or lower case) to indicate a multiple of kibibytes, mebibytes, gibibytes,
121or tebibytes.
122If no suffix is given, the value is assumed to be in mebibytes.
123.It Va memory.wired Ta bool Ta false Ta
124Wire guest memory.
125.It Va acpi_tables Ta bool Ta false Ta
126Generate ACPI tables; these tables are
127.Em not
128used on illumos.
129.It Va destroy_on_poweroff Ta bool Ta false Ta
130Destroy the VM on guest-initiated power-off.
131.It Va gdb.address Ta string Ta localhost Ta
132Hostname, IP address, or IPv6 address for the debug server.
133.It Va gdb.port Ta integer Ta 0 Ta
134TCP port number for the debug server.
135If this is set to a non-zero value, a debug server
136will listen for connections on this port.
137.It Va gdb.wait Ta bool Ta false Ta
138If the debug server is enabled, wait for a debugger to connect
139before starting the guest.
140.It Va rtc.use_localtime Ta bool Ta true Ta
141The real time clock uses the local time of the host.
142If this is set to false, the real time clock uses UTC.
143.It Va uuid Ta string Ta Ta
144The universally unique identifier (UUID) to use in the guest's
145System Management BIOS System Information structure.
146If an explicit value is not set, a valid UUID is generated from
147the host's hostname and the VM name.
148.It Va virtio_msix Ta bool Ta true Ta
149Use MSI-X interrupts for PCI VirtIO devices.
150If set to false, MSI interrupts are used instead.
151.It Va config.dump Ta bool Ta false Ta
152If this value is set to true then, after parsing command line options,
153.Xr bhyve 8
154will write all of its configuration variables to
155.Dv stdout
156and exit.
157No VM will be started.
158.It Va privileges.debug Ta bool Ta false Ta
159Enable debug messages relating to privilege management.
160These messages are sent to
161.Dv stdout .
162.It Va rfb.debug Ta bool Ta false Ta
163Enable debug messages relating to the RFB
164.Pq VNC
165server.
166These messages are sent to
167.Dv stderr .
168.El
169.Ss x86-Specific Settings
170.Bl -column "x86.vmexit_on_pause" "integer" "Default"
171.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description
172.It Va x86.mptable Ta bool Ta true Ta
173Generate an MPTable.
174.It Va x86.x2apic Ta bool Ta false Ta
175Configure guest's local APICs in x2APIC mode.
176.It Va x86.strictio Ta bool Ta false Ta
177Exit if a guest accesses an I/O port that is not emulated.
178By default, writes are ignored and reads return all bits set.
179.It Va x86.strictmsr Ta bool Ta true Ta
180Inject a general protection fault if a guest accesses a Model Specific
181Register (MSR) that is not emulated.
182If this is false, writes are ignored and reads return zero.
183.It Va x86.vmexit_on_hlt Ta bool Ta false Ta
184Force a VM exit when a guest CPU executes the
185.Dv HLT
186instruction.
187This allows idle guest CPUs to yield the host CPU.
188.It Va x86.vmexit_on_pause Ta bool Ta false Ta
189Force a VM exit when a guest CPU executes the
190.Dv PAUSE
191instruction.
192.El
193.Sh DEVICE SETTINGS
194Device settings are stored under a device node.
195The device node's name is set by the parent bus of the device.
196.Ss PCI Device Settings
197PCI devices are described by a device node named
198.Dq pci . Ns Ar bus . Ns Ar slot . Ns Ar function
199where each of
200.Ar bus ,
201.Ar slot ,
202and
203.Ar function
204are formatted as decimal values with no padding.
205All PCI device nodes must contain a configuration variable named
206.Dq device
207which specifies the device model to use.
208The following PCI device models are supported:
209.Bl -tag -width indent
210.It Li hostbridge
211Provide a simple PCI-Host bridge device.
212This is usually configured at pci0:0:0 and is required by most guest
213operating systems.
214.It Li ahci
215AHCI storage controller.
216.It Li e1000
217Intel e82545 network interface.
218.It Li fbuf
219VGA framebuffer device attached to VNC server.
220.It Li lpc
221LPC PCI-ISA bridge with COM1-COM4 16550 serial ports,
222a boot ROM,
223and an optional debug/test device.
224This device must be configured on bus 0.
225.It Li nvme
226NVM Express (NVMe) controller.
227.It Li passthru
228PCI pass-through device.
229.It Li uart
230PCI 16550 serial device.
231.It Li virtio-9p
232VirtIO 9p (VirtFS) interface.
233.It Li virtio-blk
234VirtIO block storage interface.
235.It Li virtio-console
236VirtIO console interface.
237.It Li virtio-net-viona
238Accelerated VirtIO network interface.
239.It Li net-viona
240Legacy VirtIO network interface.
241.It Li virtio-rnd
242VirtIO random number generator interface.
243.It Li xhci
244Extensible Host Controller Interface (XHCI) USB controller.
245.El
246.Ss USB Device Settings
247USB controller devices contain zero or more child USB devices
248attached to slots.
249Each USB device stores its settings in a node named
250.Dq slot. Ns Va N
251under the controller's device node.
252.Va N
253is the number of the slot to which the USB device is attached.
254Note that USB slot numbers begin at 1.
255All USB device nodes must contain a configuration variable named
256.Dq device
257which specifies the device model to use.
258The following USB device models are supported:
259.Bl -tag -width indent
260.It Li tablet
261A USB tablet device which provides precise cursor synchronization
262when using VNC.
263.El
264.Ss Block Device Settings
265Block devices use the following settings to configure their backing store.
266These settings are stored in the configuration node of the respective device.
267.Bl -column "sectorsize" "logical[/physical]" "Default"
268.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description
269.It path Ta string Ta Ta
270The path of the file or disk device to use as the backing store.
271.It nocache Ta bool Ta false Ta
272Disable caching on the backing file by opening the backing file with
273.Dv O_DIRECT .
274.It nodelete Ta bool Ta false Ta
275Disable emulation of guest trim requests via
276.Dv DIOCGDELETE
277requests.
278.It sync Ta bool Ta false Ta
279Write changes to the backing file with synchronous writes.
280.It direct Ta bool Ta false Ta
281An alias for
282.Va sync .
283.It ro Ta bool Ta false Ta
284Disable writes to the backing file.
285.It sectorsize Ta Va logical Ns Op / Ns Va physical Ta Ta
286Specify the logical and physical sector size of the emulated disk.
287If the physical size is not specified, it is set to be equal to the logical
288size.
289.El
290.Ss virtio-net-viona Network Backend Settings
291Viona network devices use the following settings to configure their backend.
292.Bl -column "feature_flags" "string" "Default"
293.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description
294.It vnic Ta string Ta Ta
295The VNIC to use for the network connection.
296.It feature_mask Ta integer Ta 0 Ta
297Specify a mask to apply to the virtio features advertised to the guest.
298.El
299.Ss Other Network Backend Settings
300Other network devices use the following settings to configure their backend.
301.Bl -column "feature_flags" "string" "Default"
302.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description
303.It vnic Ta string Ta Ta
304The VNIC to use for the network connection.
305.It promiscphys Ta bool Ta false Ta
306Enable promiscuous mode at the physical level.
307.It promiscsap Ta bool Ta true Ta
308Enable promiscuous mode at the SAP level.
309.It promiscmulti Ta bool Ta true Ta
310Enable promiscuous mode for all multicast addresses.
311.It promiscrxonly Ta bool Ta true Ta
312The selected promiscuous modes are only enabled for received traffic.
313.El
314.Ss UART Device Settings
315.Bl -column "Name" "Format" "Default"
316.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description
317.It Va path Ta path Ta Ta
318Backend device for the serial port.
319Either the pathname of a character device or
320.Dq stdio
321to use standard input and output of the
322.Xr bhyve 8
323process.
324.El
325.Ss Host Bridge Settings
326Host Bridge devices use the following settings.
327When configuring parameters, either the
328.Va model
329by itself, or both of
330.Va vendor
331and
332.Va devid
333must be specified.
334.Bl -column "vendor" "integer" "Default"
335.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description
336.It Va model Ta string Ta netapp Ta
337Specify a hostbridge model to emulate.
338Valid model strings, and their associated vendor and device IDs are:
339.Sy amd Pq 0x1022/0x7432 ,
340.Sy netapp Pq 0x1275/0x1275 ,
341.Sy i440fx Pq 0x8086/0x1237
342and
343.Sy q35 Pq 0x8086/0x29b0 .
344.It Va vendor Ta integer Ta 0x1275 Ta
345PCI vendor ID.
346.It Va devid Ta integer Ta 0x1275 Ta
347PCI device ID.
348.El
349.Ss AHCI Controller Settings
350AHCI controller devices contain zero or more ports each of which
351provides a storage device.
352Each port stores its settings in a node named
353.Dq port. Ns Va N
354under the controller's device node.
355The
356.Va N
357values are formatted as successive decimal values starting with 0.
358In addition to the block device settings described above, each
359port supports the following settings:
360.Bl -column "model" "integer" "generated"
361.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description
362.It Va type Ta string Ta Ta
363The type of storage device to emulate.
364Must be set to either
365.Dq cd
366or
367.Dq hd .
368.It Va nmrr Ta integer Ta 0 Ta
369Nominal Media Rotation Rate, also known as RPM.
370A value 1 of indicates a device with no rate such as a Solid State Disk.
371.It Va ser Ta string Ta generated Ta
372Serial number of up to twenty characters.
373A default serial number is generated using a hash of the backing
374store's pathname.
375.It Va rev Ta string Ta 001 Ta
376Revision number of up to eight characters.
377.It Va model Ta string Ta Ta
378Model number of up to forty characters.
379Separate default model strings are used for
380.Dq cd
381and
382.Dq hd
383device types.
384.El
385.Ss Frame Buffer Settings
386.Bl -column "password" "[IP:]port" "127.0.0.1:5900"
387.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description
388.It Va wait Ta bool Ta false Ta
389Wait for a remote connection before starting the VM.
390.It Va rfb Ta Oo Ar IP Ns \&: Oc Ns Ar port Ta 127.0.0.1:5900 Ta
391TCP address to listen on for remote connections.
392The IP address must be given as a numeric address.
393IPv6 addresses must be enclosed in square brackets and
394support scoped identifiers as described in
395.Xr getaddrinfo 3SOCKET .
396A bare port number may be given in which case the IPv4
397localhost address is used.
398.It Va unix Ta string Ta Ta
399UNIX socket to listen on for VNC connections.
400.It Va vga Ta string Ta io Ta
401VGA configuration.
402More details are provided in
403.Xr bhyve 8 .
404.It Va w Ta integer Ta 1024 Ta
405Frame buffer width in pixels.
406.It Va h Ta integer Ta 768 Ta
407Frame buffer height in pixels.
408.It Va password Ta string Ta Ta
409Password to use for VNC authentication.
410This type of authentication is known to be cryptographically weak and is not
411intended for use on untrusted networks.
412.El
413.Ss LPC Device Settings
414The LPC bridge stores its configuration under a top-level
415.Va lpc
416node rather than under the PCI LPC device's node.
417The following nodes are available under
418.Va lpc :
419.Bl -column "pc-testdev" "Format" "Default"
420.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description
421.It Va bootrom Ta path Ta Ta
422Path to a boot ROM.
423The contents of this file are copied into the guest's
424memory ending just before the 4GB physical address.
425If a boot ROM is present, a firmware interface device is
426also enabled for use by the boot ROM.
427.It Va com1 Ta node Ta Ta
428Settings for the COM1 serial port device.
429.It Va com2 Ta node Ta Ta
430Settings for the COM2 serial port device.
431.It Va com3 Ta node Ta Ta
432Settings for the COM3 serial port device.
433.It Va com4 Ta node Ta Ta
434Settings for the COM4 serial port device.
435.It Va pc-testdev Ta bool Ta false Ta
436Enable the PC debug/test device.
437.El
438.Ss NVMe Controller Settings
439Each NVMe controller supports a single storage device.
440The device can be backed either by a memory disk described by the
441.Va ram
442variable, or a block device using the block device settings described above.
443In addition, each controller supports the following settings:
444.Bl -column "ioslots" "Format" "Default"
445.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description
446.It Va maxq Ta integer Ta 16 Ta
447Maximum number of I/O submission and completion queue pairs.
448.It Va qsz Ta integer Ta 2058 Ta
449Number of elements in each I/O queue.
450.It Va ioslots Ta integer Ta 8 Ta
451Maximum number of concurrent I/O requests.
452.It Va sectsz Ta integer Ta Ta
453Sector size.
454Can be one of 512, 4096, or 8192.
455Devices backed by a memory disk use 4096 as the default.
456Devices backed by a block device use the block device's sector size
457as the default.
458.It Va ser Ta string Ta Ta
459Serial number of up to twenty characters.
460A default serial number is generated using a hash of the device's PCI address.
461.It Va eui64 Ta integer Ta Ta
462IEEE Extended Unique Identifier.
463If an EUI is not provided, a default is generated using a checksum of the
464device's PCI address.
465.It Va dsm Ta string Ta auto Ta
466Whether or not to advertise Dataset Management (DSM) support.
467One of
468.Dq auto ,
469.Dq enable ,
470or
471.Dq disable .
472The
473.Dq auto
474setting only advertises support if the backing store supports
475resource freeing, for example via TRIM.
476.It Va ram Ta integer Ta Ta
477If set, allocate a memory disk as the backing store.
478The value of this variable is the size of the memory disk in megabytes.
479.El
480.Ss PCI Passthrough Settings
481.Bl -column "Name" "integer" "Default"
482.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description
483.It Va path Ta string Ta Ta
484Path to a PCI passthrough device in the form
485.Pa /dev/ppt Ns Ar N
486where
487.Ar N
488is the device number.
489.El
490.Ss VirtIO 9p Settings
491Each VirtIO 9p device exposes a single filesystem from a host path.
492.Bl -column "sharename" "Format" "Default"
493.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description
494.It Va sharename Ta string Ta Ta
495The share name exposed to the guest.
496.It Va path Ta path Ta Ta
497The path of a directory on the host to export to the guest.
498.It Va ro Ta bool Ta false Ta
499If true, the guest filesystem is read-only.
500.El
501.Ss VirtIO Block Device Settings
502In addition to the block device settings described above, each
503VirtIO block device supports the following settings:
504.Bl -column "model" "integer" "generated"
505.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description
506.It Va ser Ta string Ta generated Ta
507Serial number of up to twenty characters.
508A default serial number is generated using a hash of the backing
509store's pathname.
510.El
511.Ss VirtIO Console Device Settings
512Each VirtIO Console device contains one or more console ports.
513Each port stores its settings in a node named
514.Dq port. Ns Va N
515under the controller's device node.
516The
517.Va N
518values are formatted as successive decimal values starting with 0.
519Each port supports the following settings:
520.Bl -column "Name" "Format" "Default"
521.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description
522.It Va name Ta string Ta Ta
523The name of the port exposed to the guest.
524.It Va path Ta path Ta Ta
525The path of a UNIX domain socket providing the host connection for the port.
526.El
527.Sh SEE ALSO
528.Xr strtoul 3C ,
529.Xr getaddrinfo 3SOCKET ,
530.Xr bhyve 8
531