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