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