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