xref: /illumos-gate/usr/src/man/man8/bhyve.8 (revision 6520eed593b6f28dfe76a9ad27bf2030d9af0a43)
1.\" Copyright (c) 2013 Peter Grehan
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" Portions Copyright 2022 OmniOS Community Edition (OmniOSce) Association.
26.\"
27.Dd May 5, 2023
28.Dt BHYVE 8
29.Os
30.Sh NAME
31.Nm bhyve
32.Nd "run a guest operating system inside a virtual machine"
33.Sh SYNOPSIS
34.Nm
35.Op Fl aCDdeHhPSuWwxY
36.Oo
37.Sm off
38.Fl c\~
39.Oo
40.Op Cm cpus=
41.Ar numcpus
42.Oc
43.Op Cm ,sockets= Ar n
44.Op Cm ,cores= Ar n
45.Op Cm ,threads= Ar n
46.Oc
47.Sm on
48.Oo Fl f
49.Sm off
50.Ar name Cm \&,
51.Oo
52.Cm string | file
53.Oc
54.Cm \&= Ar data
55.Sm on
56.Oc
57.Oo
58.Sm off
59.Fl G\~
60.Oo Ar w Oc
61.Oo Ar bind_address Cm \&: Oc
62.Ar port
63.Oc
64.Sm on
65.Oo Fl B
66.Sm off
67.Ar type Ns \&,
68.Op Ar key Ns = Ns Ar value
69.Oo \&, Ns Ar key Ns = Ns Ar value Ns Oc \&...
70.Oc
71.Sm on
72.Op Fl k Ar config_file
73.Op Fl K Ar layout
74.Oo Fl l
75.Sm off
76.Ar lpcdev Op Cm \&, Ar conf
77.Sm on
78.Oc
79.Sm off
80.Oo Fl m\~
81.Ar memsize
82.Oo
83.Cm K | k | M | m | G | g | T | t
84.Oc
85.Sm on
86.Oc
87.Op Fl o Ar var Ns Cm = Ns Ar value
88.Op Fl r Ar file
89.Sm off
90.Oo Fl s\~
91.Ar slot Cm \&, Ar emulation Op Cm \&, Ar conf
92.Sm on
93.Oc
94.Op Fl U Ar uuid
95.Ar vmname
96.Nm
97.Fl l Cm help
98.Nm
99.Fl s Cm help
100.Sh DESCRIPTION
101.Nm
102is a hypervisor that runs guest operating systems inside a
103virtual machine.
104.Pp
105Parameters such as the number of virtual CPUs, amount of guest memory, and
106I/O connectivity can be specified with command-line parameters.
107.Pp
108.Nm
109runs until the guest operating system reboots or an unhandled hypervisor
110exit is detected.
111.Sh OPTIONS
112.Bl -tag -width 10n
113.It Fl a
114The guest's local APIC is configured in xAPIC mode.
115The xAPIC mode is the default setting so this option is redundant.
116It will be deprecated in a future version.
117.It Xo
118.Fl B
119.Sm off
120.Ar type Ns \&,
121.Op Ar key Ns = Ns Ar value
122.Oo \&, Ns Ar key Ns = Ns Ar value Ns Oc \&...
123.Sm on
124.Xc
125Configure smbios data.
126.Ar type
127must be set to one of
128.Cm 0 , 1 , 2
129or
130.Cm 3 .
131Supported keys for each type are:
132.Bl -tag -width XXX -offset XXX
133.It Cm 0
134.Cm vendor , version , release_date .
135.It Cm 1
136.Cm manufacturer ,
137.Cm product_name Pq or Cm product ,
138.Cm version ,
139.Cm serial_number Pq or Cm serial ,
140.Cm sku ,
141.Cm family_name Pq or Cm family ,
142.Cm uuid .
143.It Cm 2
144.Cm manufacturer , product_name , version , serial_number , asset_tag ,
145.Cm location
146.It Ic 3
147.Cm manufacturer , version , serial_number , asset_tag, sku .
148.El
149.It Xo Fl c
150.Sm off
151.Op Oo Cm cpus= Oc Ar numcpus
152.Op Cm ,sockets= Ar n
153.Op Cm ,cores= Ar n
154.Op Cm ,threads= Ar n
155.Xc
156.Sm on
157Number of guest virtual CPUs
158and/or the CPU topology.
159The default value for each of
160.Ar numcpus ,
161.Ar sockets ,
162.Ar cores ,
163and
164.Ar threads
165is 1.
166The current maximum number of guest virtual CPUs is 32.
167If
168.Ar numcpus
169is not specified then it will be calculated from the other arguments.
170The topology must be consistent in that the
171.Ar numcpus
172must equal the product of
173.Ar sockets ,
174.Ar cores ,
175and
176.Ar threads .
177If a
178.Ar setting
179is specified more than once the last one has precedence.
180.It Fl C
181Include guest memory in core file.
182.It Fl D
183Destroy the VM on guest initiated power-off.
184.It Fl d
185Suspend CPUs at boot.
186.It Fl e
187Force
188.Nm
189to exit when a guest issues an access to an I/O port that is not emulated.
190This is intended for debug purposes.
191.It Fl f Ar name Ns Cm \&, Ns Oo Cm string Ns | Ns Cm file Ns Oc Ns Cm \&= Ns Ar data
192Add a fw_cfg file
193.Ar name
194to the fw_cfg interface.
195If a
196.Cm string
197is specified, the fw_cfg file contains the string as data.
198If a
199.Cm file
200is specified, bhyve reads the file and adds the file content as fw_cfg data.
201.It Fl G Xo
202.Sm off
203.Oo Ar w Oc
204.Oo Ar bind_address Cm \&: Oc
205.Ar port
206.Sm on
207.Xc
208Start a debug server that uses the GDB protocol to export guest state to a
209debugger.
210An IPv4 TCP socket will be bound to the supplied
211.Ar bind_address
212and
213.Ar port
214to listen for debugger connections.
215Only a single debugger may be attached to the debug server at a time.
216If the option begins with
217.Sq w ,
218.Nm
219will pause execution at the first instruction waiting for a debugger to attach.
220.It Fl H
221Yield the virtual CPU thread when a HLT instruction is detected.
222If this option is not specified, virtual CPUs will use 100% of a host CPU.
223.It Fl h
224Print help message and exit.
225.It Fl k Ar config_file
226Set configuration variables from a simple, key-value config file.
227Each line of the config file is expected to consist of a config variable
228name, an equals sign
229.Pq Sq = ,
230and a value.
231No spaces are permitted between the variable name, equals sign, or
232value.
233Blank lines and lines starting with
234.Sq #
235are ignored.
236See
237.Xr bhyve_config 5
238for more details.
239.It Fl K Ar layout
240Specify the keyboard layout.
241The value that can be specified sets the file name in
242.Pa /usr/share/bhyve/kbdlayout .
243This specification only works when loaded with UEFI mode for VNC.
244When using a VNC client that supports QEMU Extended Key Event Message
245.Pq e.g. TigerVNC ,
246this option isn't needed.
247When using a VNC client that doesn't support QEMU Extended Key Event Message
248.Pq e.g. tightVNC ,
249the layout defaults to the US keyboard unless specified otherwise.
250.It Fl l Cm help
251Print a list of supported LPC devices.
252.It Fl l Ar lpcdev Ns Op \&, Ns Ar conf
253Allow devices behind the LPC PCI-ISA bridge to be configured.
254The only supported devices are the TTY-class devices
255.Cm com1 , com2 , com3
256and
257.Cm com4 ,
258the TPM module
259.Cm tpm ,
260the boot ROM device
261.Cm bootrom ,
262the
263.Cm fwcfg
264type and the debug/test device
265.Cm pc-testdev .
266.Pp
267The possible values for the
268.Ar conf
269argument are listed in the
270.Fl s
271flag description.
272.It Xo
273.Fl m Ar memsize Ns Oo
274.Sm off
275.Cm K | k | M | m | G | g | T | t
276.Sm on
277.Oc
278.Xc
279Set the guest physical memory size.
280The size argument may be suffixed with one of
281.Cm K , M , G
282or
283.Cm T
284.Pq either upper or lower case
285to indicate a multiple of kibibytes, mebibytes, gibibytes, or tebibytes.
286If no suffix is given, the value is assumed to be in mebibytes.
287.Pp
288The default is 256MiB.
289.It Fl o Ar var Ns Cm = Ns Ar value
290Set the configuration variable
291.Ar var
292to
293.Ar value .
294.It Fl P
295Force the guest virtual CPU to exit when a PAUSE instruction is detected.
296.It Fl S
297Wire guest memory.
298.It Fl s Cm help
299Print a list of supported PCI devices.
300.It Fl s Ar slot Ns Cm \&, Ns Ar emulation Ns Op Cm \&, Ns Ar conf
301Configure a virtual PCI slot and function.
302.Pp
303.Nm
304provides PCI bus emulation and virtual devices that can be attached to
305slots on the bus.
306There are 32 available slots, with the option of providing up to 8 functions
307per slot.
308.Pp
309The
310.Ar slot
311can be specified in one of the following formats:
312.Pp
313.Bl -bullet -compact
314.It
315.Ar pcislot
316.It
317.Sm off
318.Ar pcislot Cm \&: Ar function
319.Sm on
320.It
321.Sm off
322.Ar bus Cm \&: Ar pcislot Cm \&: Ar function
323.Sm on
324.El
325.Pp
326The
327.Ar pcislot
328value is 0 to 31.
329The optional
330.Ar function
331value is 0 to 7.
332The optional
333.Ar bus
334value is 0 to 255.
335If not specified, the
336.Ar function
337value defaults to 0.
338If not specified, the
339.Ar bus
340value defaults to 0.
341.Pp
342The
343.Ar emulation
344argument can be one of the following:
345.Bl -tag -width "amd_hostbridge"
346.It Cm hostbridge
347A simple host bridge.
348This is usually configured at slot 0, and is required by most guest
349operating systems.
350.It Cm amd_hostbridge
351Emulation identical to
352.Cm hostbridge
353but using a PCI vendor ID of AMD.
354.It Cm passthru
355PCI pass-through device.
356.It Cm virtio-net-viona
357Accelerated Virtio network interface.
358.It Cm virtio-net
359Legacy Virtio network interface.
360.It Cm virtio-blk
361Virtio block storage interface.
362.It Cm virtio-9p
363Virtio 9p (VirtFS) interface.
364.It Cm virtio-rnd
365Virtio random number generator interface.
366.It Cm virtio-console
367Virtio console interface, which exposes multiple ports
368to the guest in the form of simple char devices for simple IO
369between the guest and host userspaces.
370.It Cm ahci
371AHCI controller attached to arbitrary devices.
372.It Cm ahci-cd
373AHCI controller attached to an ATAPI CD/DVD.
374.It Cm ahci-hd
375AHCI controller attached to a SATA hard drive.
376.It Cm e1000
377Intel e82545 network interface.
378.It Cm uart
379PCI 16550 serial device.
380.It Cm lpc
381LPC PCI-ISA bridge with COM1, COM2, COM3, and COM4 16550 serial ports,
382a boot ROM, and, optionally, a fwcfg type and the debug/test device.
383The LPC bridge emulation can only be configured on bus 0.
384.It Cm fbuf
385Raw framebuffer device attached to VNC server.
386.It Cm xhci
387eXtensible Host Controller Interface (xHCI) USB controller.
388.It Cm nvme
389NVM Express (NVMe) controller.
390.El
391.Pp
392The optional parameter
393.Ar conf
394describes the backend for device emulations.
395If
396.Ar conf
397is not specified, the device emulation has no backend and can be
398considered unconnected.
399.Pp
400.Sy Host Bridge Devices
401.Bl -tag -width 10n
402.It Cm model Ns = Ns Ar model
403Specify a hostbridge model to emulate.
404Valid model strings, and their associated vendor and device IDs are:
405.Sy amd Pq 0x1022/0x7432 ,
406.Sy netapp Pq 0x1275/0x1275 ,
407.Sy i440fx Pq 0x8086/0x1237
408and
409.Sy q35 Pq 0x8086/0x29b0 .
410The default value of
411.Ar model
412is
413.Cm netapp .
414.It Cm vendor Ns = Ns Ar vendor
415PCI vendor ID.
416.It Cm devid Ns = Ns Ar devid
417PCI device ID.
418.El
419.Pp
420Providing extra configuration parameters for a host bridge is optional, but if
421parameters are provided then either
422.Va model
423by itself, or both of
424.Va vendor
425and
426.Va devid
427must be specified.
428.Pp
429.Sy Accelerated Virtio Network Backends :
430.Bl -tag -width 10n
431.It Oo Cm vnic Ns = Oc Ns Ar vnic Ns Oo , Ns Cm feature_mask Ns = Ns Ar mask Oc
432.Pp
433.Ar vnic
434is the name of a configured virtual NIC on the system.
435.Ar mask
436is applied to the virtio feature flags which are advertised to the guest.
437Bits set in the
438.Ar mask
439value are removed from the advertised features.
440.El
441.Pp
442.Sy Other Network Backends :
443.Bl -tag -width 10n
444.It Oo Cm vnic Ns = Oc Ns Ar vnic Ns Oo , Ns Ar network-backend-options Oc
445.Pp
446.Ar vnic
447is the name of a configured virtual NIC on the system.
448.El
449.Pp
450The
451.Ar network-backend-options
452are:
453.Bl -tag -width 8n
454.It Cm promiscphys
455Enable promiscuous mode at the physical level (default: false)
456.It Cm promiscsap
457Enable promiscuous mode at the SAP level (default: true)
458.It Cm promiscmulti
459Enable promiscuous mode for all multicast addresses (default: true)
460.It Cm promiscrxonly
461The selected promiscuous modes are only enabled for received traffic
462(default: true).
463.El
464.Pp
465.Sy Block storage device backends :
466.Sm off
467.Bl -bullet
468.It
469.Pa /filename Op Cm \&, Ar block-device-options
470.It
471.Pa /dev/xxx Op Cm \&, Ar block-device-options
472.El
473.Sm on
474.Pp
475The
476.Ar block-device-options
477are:
478.Bl -tag -width 10n
479.It Cm nocache
480Open the file with
481.Dv O_DIRECT .
482.It Cm direct
483Open the file using
484.Dv O_SYNC .
485.It Cm ro
486Force the file to be opened read-only.
487.It Cm sectorsize= Ns Ar logical Ns Oo Cm \&/ Ns Ar physical Oc
488Specify the logical and physical sector sizes of the emulated disk.
489The physical sector size is optional and is equal to the logical sector size
490if not explicitly specified.
491.It Cm nodelete
492Disable emulation of guest trim requests via
493.Dv DIOCGDELETE
494requests.
495.It Cm bootindex= Ns Ar index
496Add the device to the bootorder at
497.Ar index .
498A fwcfg file is used to specify the bootorder.
499The guest firmware may ignore or not have support for this fwcfg file.
500In that case, this feature will not work as expected.
501.El
502.Pp
503.Sy 9P device backends :
504.Sm off
505.Bl -bullet
506.It
507.Ar sharename Cm = Ar /path/to/share Op Cm \&, Ar 9p-device-options
508.El
509.Sm on
510.Pp
511The
512.Ar 9p-device-options
513are:
514.Bl -tag -width 10n
515.It Cm ro
516Expose the share in read-only mode.
517.El
518.Pp
519.Sy TTY device backends :
520.Bl -tag -width 10n
521.It Cm stdio
522Connect the serial port to the standard input and output of
523the
524.Nm
525process.
526.It Pa /dev/xxx
527Use the host TTY device for serial port I/O.
528.El
529.Pp
530.Sy TPM device backends :
531.Bl -tag -width 10n
532.It Ar type Ns \&, Ns Ar path Ns Op Cm \&, Ns Ar tpm-device-options
533Emulate a TPM device.
534.El
535.Pp
536The
537.Ar tpm-device-options
538are:
539.Bl -tag -width 10n
540.It Cm version= Ns Ar version
541Version of the TPM device according to the TCG specification.
542Defaults to
543.Cm 2.0
544.El
545.Pp
546.Sy Boot ROM device backends :
547.Bl -tag -width 10n
548.It Pa romfile Ns Op Cm \&, Ns Ar varfile
549Map
550.Ar romfile
551in the guest address space reserved for boot firmware.
552If
553.Ar varfile
554is provided, that file is also mapped in the boot firmware guest
555address space, and any modifications the guest makes will be saved
556to that file.
557.El
558.Pp
559Fwcfg types:
560.Bl -tag -width 10n
561.It Ar fwcfg
562The fwcfg interface is used to pass information such as the CPU count or ACPI
563ables to the guest firmware.
564Supported values are
565.Ql bhyve
566and
567.Ql qemu .
568Due to backward compatibility reasons,
569.Ql bhyve
570is the default option.
571When
572.Ql bhyve
573is used, bhyve's fwctl interface is used.
574It currently reports only the CPU count to the guest firmware.
575The
576.Ql qemu
577option uses QEMU's fwcfg interface.
578This interface is widely used and allows user-defined information to be passed
579o the guest.
580It is used for passing the CPU count, ACPI tables, a boot order and many other
581things to the guest.
582Some operating systems such as Fedora CoreOS can be configured by qemu's fwcfg
583interface as well.
584.El
585.Pp
586.Sy Pass-through device backends :
587.Bl -tag -width 10n
588.It Pa /dev/ppt Ns Ar N
589Connect to a PCI device on the host identified by the specified path.
590.It Cm rom= Ns Ar romfile
591Add
592.Ar romfile
593as option ROM to the PCI device.
594The ROM will be loaded by firmware and should be capable of initialising the
595device.
596.It Cm bootindex= Ns Ar index
597Add the device to the bootorder at
598.Ar index .
599A fwcfg file is used to specify the bootorder.
600The guest firmware may ignore or not have support for this fwcfg file.
601In that case, this feature will not work as expected.
602.El
603.Pp
604Guest memory must be wired using the
605.Fl S
606option when a pass-through device is configured.
607.Pp
608The host device must have been previously attached to the
609.Sy ppt
610driver.
611.Pp
612.Sy Virtio console device backends :
613.Bl -bullet
614.Sm off
615.It
616.Cm port1= Ns Ar /path/to/port1.sock Ns
617.Op Cm ,port Ns Ar N Cm \&= Ns Ar /path/to/port2.sock No \~ Ar ...
618.Sm on
619.El
620.Pp
621A maximum of 16 ports per device can be created.
622Every port is named and corresponds to a UNIX domain socket created by
623.Nm .
624.Nm
625accepts at most one connection per port at a time.
626.Pp
627Limitations:
628.Bl -bullet
629.It
630Due to lack of destructors in
631.Nm ,
632sockets on the filesystem must be cleaned up manually after
633.Nm
634exits.
635.It
636There is no way to use the
637.Dq console port
638feature, nor the console port resize at present.
639.It
640Emergency write is advertised, but no-op at present.
641.El
642.Pp
643.Sy TPM devices :
644.Bl -tag -width 10n
645.It Ns Ar type
646Specifies the type of the TPM device.
647.Pp
648Supported types:
649.Bl -tag -width 10n
650.It Cm passthru
651.El
652.It Cm version= Ns Ar version
653The
654.Ar version
655of the emulated TPM device according to the TCG specification.
656.Pp
657Supported versions:
658.Bl -tag -width 10n
659.It Cm 2.0
660.El
661.El
662.Pp
663.Sy Framebuffer device backends :
664.Bl -bullet
665.Sm off
666.It
667.Op Cm rfb= Ar ip-and-port
668.Op Cm ,w= Ar width
669.Op Cm ,h= Ar height
670.Op Cm ,vga= Ar vgaconf
671.Op Cm ,wait
672.Op Cm ,password= Ar password
673.Sm on
674.El
675.Pp
676Configuration options are defined as follows:
677.Bl -tag -width 10n
678.It Cm rfb= Ns Ar ip-and-port Pq or Cm tcp= Ns Ar ip-and-port
679An IP address and a port VNC should listen on.
680There are two formats:
681.Pp
682.Bl -bullet -compact
683.It
684.Sm off
685.Op Ar IPv4 Cm \&:
686.Ar port
687.Sm on
688.It
689.Sm off
690.Cm \&[ Ar IPv6 Cm \&] Cm \&: Ar port
691.Sm on
692.El
693.Pp
694The default is to listen on localhost IPv4 address and default VNC port 5900.
695An IPv6 address must be enclosed in square brackets.
696.It Cm unix Ns = Ns Ar path
697The path to a UNIX socket which will be created and where
698.Nm
699will accept VNC connections.
700.It Cm w= Ns Ar width No and Cm h= Ns Ar height
701A display resolution, width and height, respectively.
702If not specified, a default resolution of 1024x768 pixels will be used.
703Minimal supported resolution is 640x480 pixels,
704and maximum is 1920x1200 pixels.
705.It Cm vga= Ns Ar vgaconf
706Possible values for this option are
707.Cm io
708(default),
709.Cm on
710, and
711.Cm off .
712PCI graphics cards have a dual personality in that they are
713standard PCI devices with BAR addressing, but may also
714implicitly decode legacy VGA I/O space
715.Pq Ad 0x3c0-3df
716and memory space
717.Pq 64KB at Ad 0xA0000 .
718The default
719.Cm io
720option should be used for guests that attempt to issue BIOS calls which result
721in I/O port queries, and fail to boot if I/O decode is disabled.
722.Pp
723The
724.Cm on
725option should be used along with the CSM BIOS capability in UEFI
726to boot traditional BIOS guests that require the legacy VGA I/O and
727memory regions to be available.
728.Pp
729The
730.Cm off
731option should be used for the UEFI guests that assume that
732VGA adapter is present if they detect the I/O ports.
733An example of such a guest is
734.Ox
735in UEFI mode.
736.It Cm wait
737Instruct
738.Nm
739to only boot upon the initiation of a VNC connection, simplifying the
740installation of operating systems that require immediate keyboard input.
741This can be removed for post-installation use.
742.It Cm password= Ns Ar password
743This type of authentication is known to be cryptographically weak and is not
744intended for use on untrusted networks.
745Many implementations will want to use stronger security, such as running
746the session over an encrypted channel provided by IPsec or SSH.
747.El
748.Pp
749.Sy xHCI USB device backends :
750.Bl -tag -width 10n
751.It Cm tablet
752A USB tablet device which provides precise cursor synchronization
753when using VNC.
754.El
755.Pp
756.Sy NVMe device backends :
757.Bl -bullet
758.Sm off
759.It
760.Ar devpath
761.Op Cm ,maxq= Ar #
762.Op Cm ,qsz= Ar #
763.Op Cm ,ioslots= Ar #
764.Op Cm ,sectsz= Ar #
765.Op Cm ,ser= Ar #
766.Op Cm ,eui64= Ar #
767.Op Cm ,dsm= Ar opt
768.Sm on
769.El
770.Pp
771Configuration options are defined as follows:
772.Bl -tag -width 10n
773.It Ar devpath
774Accepted device paths are:
775.Ar /dev/blockdev
776or
777.Ar /path/to/image
778or
779.Cm ram= Ns Ar size_in_MiB .
780.It Cm maxq
781Max number of queues.
782.It Cm qsz
783Max elements in each queue.
784.It Cm ioslots
785Max number of concurrent I/O requests.
786.It Cm sectsz
787Sector size (defaults to blockif sector size).
788.It Cm ser
789Serial number with maximum 20 characters.
790.It Cm eui64
791IEEE Extended Unique Identifier (8 byte value).
792.It Cm dsm
793DataSet Management support.
794Supported values are:
795.Cm auto , enable ,
796and
797.Cm disable .
798.El
799.Pp
800.Sy AHCI device backends :
801.Bl -bullet
802.It
803.Sm off
804.Op Oo Cm hd\&: | cd\&: Oc Ar path
805.Op Cm ,nmrr= Ar nmrr
806.Op Cm ,ser= Ar #
807.Op Cm ,rev= Ar #
808.Op Cm ,model= Ar #
809.Sm on
810.El
811.Pp
812Configuration options are defined as follows:
813.Bl -tag -width 10n
814.It Cm nmrr
815Nominal Media Rotation Rate, known as RPM.
816Value 1 will indicate device as Solid State Disk.
817Default value is 0, not report.
818.It Cm ser
819Serial Number with maximum 20 characters.
820.It Cm rev
821Revision Number with maximum 8 characters.
822.It Cm model
823Model Number with maximum 40 characters.
824.El
825.It Fl U Ar uuid
826Set the universally unique identifier
827.Pq UUID
828in the guest's System Management BIOS System Information structure.
829By default a UUID is generated from the host's hostname and
830.Ar vmname .
831.It Fl u
832RTC keeps UTC time.
833.It Fl W
834Force virtio PCI device emulations to use MSI interrupts instead of MSI-X
835interrupts.
836.It Fl w
837Ignore accesses to unimplemented Model Specific Registers (MSRs).
838This is intended for debug purposes.
839.It Fl x
840The guest's local APIC is configured in x2APIC mode.
841.It Fl Y
842Disable MPtable generation.
843.It Ar vmname
844Alphanumeric name of the guest.
845.El
846.Sh CONFIGURATION VARIABLES
847.Nm
848uses an internal tree of configuration variables to describe global and
849per-device settings.
850When
851.Nm
852starts,
853it parses command line options (including config files) in the order given
854on the command line.
855Each command line option sets one or more configuration variables.
856For example,
857the
858.Fl s
859option creates a new tree node for a PCI device and sets one or more variables
860under that node including the device model and device model-specific variables.
861Variables may be set multiple times during this parsing stage with the final
862value overriding previous values.
863.Pp
864Once all of the command line options have been processed,
865the configuration values are frozen.
866.Nm
867then uses the value of configuration values to initialize device models
868and global settings.
869.Pp
870More details on configuration variables can be found in
871.Xr bhyve_config 5 .
872.Sh SIGNAL HANDLING
873.Nm
874deals with the following signals:
875.Pp
876.Bl -tag -width SIGTERM -compact
877.It SIGTERM
878Trigger ACPI poweroff for a VM
879.El
880.Sh EXIT STATUS
881Exit status indicates how the VM was terminated:
882.Pp
883.Bl -tag -width indent -compact
884.It 0
885rebooted
886.It 1
887powered off
888.It 2
889halted
890.It 3
891triple fault
892.It 4
893exited due to an error
894.El
895.Sh EXAMPLES
896To run a virtual machine with 1GB of memory, two virtual CPUs, a virtio
897block device backed by the
898.Pa /my/image
899filesystem image, and a serial port for the console:
900.Bd -literal -offset indent
901bhyve -c 2 -s 0,hostbridge -s 1,lpc -s 2,virtio-blk,/my/image \e
902  -l com1,stdio -H -P -m 1G vm1
903.Ed
904.Pp
905Run a 24GB single-CPU virtual machine with three network ports.
906.Bd -literal -offset indent
907bhyve -s 0,hostbridge -s 1,lpc -s 2:0,virtio-net-viona,vmvnic0 \e
908  -s 2:1,virtio-net-viona,vmvnic1 -s 2:2,virtio-net-viona,vmvnic2 \e
909  -s 3,virtio-blk,/my/image -l com1,stdio \e
910  -H -P -m 24G bigvm
911.Ed
912.Pp
913Run an 8GB virtual machine with 2 quad core CPUs, 2 NVMe disks and one other
914disk attached as a Virtio block device, an AHCI ATAPI CD-ROM, a single viona
915network port, an i440fx hostbridge, and the console port connected to a socket.
916.Bd -literal -offset indent
917bhyve -c sockets=2,cores=4,threads=2 \e
918  -s 0,hostbridge,model=i440fx -s 1,lpc \e
919  -s 1:0,nvme,/dev/zvol/rdsk/tank/hdd0 \e
920  -s 1:1,nvme,/dev/zvol/rdsk/tank/hdd1 \e
921  -s 1:2,virtio-blk,/dev/zvol/rdsk/tank/hdd1 \e
922  -s 2:0,ahci,cd:/images/install.iso \e
923  -s 3,virtio-net-viona,vnic=vmvnic0 \e
924  -l com1,socket,/tmp/vm.com1,wait \e
925  -H -P -m 8G
926.Ed
927.Pp
928Run a UEFI virtual machine with a display resolution of 800 by 600 pixels
929that can be accessed via VNC at: 0.0.0.0:5900.
930.Bd -literal -offset indent
931bhyve -c 2 -m 4G -w -H \e
932  -s 0,hostbridge \e
933  -s 3,ahci-cd,/path/to/uefi-OS-install.iso \e
934  -s 4,nvme,/dev/zvol/rdsk/tank/hdd0 \e
935  -s 5,virtio-net-viona,vnic=vnmic0 \e
936  -s 29,fbuf,vga=off,rfb=0.0.0.0:5900,w=800,h=600,wait \e
937  -s 30,xhci,tablet \e
938  -s 31,lpc -l com1,stdio \e
939  -l bootrom,/usr/share/bhyve/firmware/BHYVE_UEFI.fd \e
940   uefivm
941.Ed
942.Pp
943Run a UEFI virtual machine with a VARS file to save EFI variables.
944Note that
945.Nm
946will write guest modifications to the given VARS file.
947Be sure to create a per-guest copy of the template VARS file from
948.Pa /usr/share/bhyve/firmware .
949.Bd -literal -offset indent
950bhyve -c 2 -m 4g -w -H \e
951  -s 0,hostbridge \e
952  -s 31,lpc -l com1,stdio \e
953  -l bootrom,/usr/share/bhyve/firmware/BHYVE_UEFI.fd,BHYVE_UEFI_VARS.fd \e
954   uefivm
955.Ed
956.Sh SEE ALSO
957.Xr bhyve_config 5 ,
958.Xr bhyvectl 8
959.Pp
960.Rs
961.%A Intel
962.%B 64 and IA-32 Architectures Software Developers' Manual
963.%V Volume 3
964.Re
965