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