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