1b13e60daSPeter Grehan.\" Copyright (c) 2013 Peter Grehan 2b13e60daSPeter Grehan.\" All rights reserved. 3b13e60daSPeter Grehan.\" 4b13e60daSPeter Grehan.\" Redistribution and use in source and binary forms, with or without 5b13e60daSPeter Grehan.\" modification, are permitted provided that the following conditions 6b13e60daSPeter Grehan.\" are met: 7b13e60daSPeter Grehan.\" 1. Redistributions of source code must retain the above copyright 8b13e60daSPeter Grehan.\" notice, this list of conditions and the following disclaimer. 9b13e60daSPeter Grehan.\" 2. Redistributions in binary form must reproduce the above copyright 10b13e60daSPeter Grehan.\" notice, this list of conditions and the following disclaimer in the 11b13e60daSPeter Grehan.\" documentation and/or other materials provided with the distribution. 12b13e60daSPeter Grehan.\" 13b13e60daSPeter Grehan.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 14b13e60daSPeter Grehan.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15b13e60daSPeter Grehan.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16b13e60daSPeter Grehan.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 17b13e60daSPeter Grehan.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18b13e60daSPeter Grehan.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19b13e60daSPeter Grehan.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20b13e60daSPeter Grehan.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21b13e60daSPeter Grehan.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22b13e60daSPeter Grehan.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23b13e60daSPeter Grehan.\" SUCH DAMAGE. 24b13e60daSPeter Grehan.\" 25b13e60daSPeter Grehan.\" $FreeBSD$ 26b13e60daSPeter Grehan.\" 27*77d208a3SMateusz Piotrowski.Dd April 22, 2020 28b13e60daSPeter Grehan.Dt BHYVE 8 29b13e60daSPeter Grehan.Os 30b13e60daSPeter Grehan.Sh NAME 31b13e60daSPeter Grehan.Nm bhyve 32b13e60daSPeter Grehan.Nd "run a guest operating system inside a virtual machine" 33b13e60daSPeter Grehan.Sh SYNOPSIS 34b13e60daSPeter Grehan.Nm 35*77d208a3SMateusz Piotrowski.Op Fl AabCeHhPSuWwxY 3601d822d3SRodney W. Grimes.Oo 37*77d208a3SMateusz Piotrowski.Sm off 38*77d208a3SMateusz Piotrowski.Fl c\~ 3901d822d3SRodney W. Grimes.Oo 40*77d208a3SMateusz Piotrowski.Op Cm cpus= 41*77d208a3SMateusz Piotrowski.Ar numcpus 4201d822d3SRodney W. Grimes.Oc 43*77d208a3SMateusz Piotrowski.Op Cm ,sockets= Ar n 44*77d208a3SMateusz Piotrowski.Op Cm ,cores= Ar n 45*77d208a3SMateusz Piotrowski.Op Cm ,threads= Ar n 46*77d208a3SMateusz Piotrowski.Oc 47*77d208a3SMateusz Piotrowski.Sm on 48cd377eb3SJohn Baldwin.Op Fl G Ar port 49*77d208a3SMateusz Piotrowski.Op Fl g Ar gdbport 50*77d208a3SMateusz Piotrowski.Oo Fl l 51*77d208a3SMateusz Piotrowski.Sm off 52*77d208a3SMateusz Piotrowski.Cm help | Ar lpcdev Op Cm \&, Ar conf 53*77d208a3SMateusz Piotrowski.Sm on 54*77d208a3SMateusz Piotrowski.Oc 55*77d208a3SMateusz Piotrowski.Oo Fl m 56*77d208a3SMateusz Piotrowski.Sm off 57*77d208a3SMateusz Piotrowski.Ar memsize 58*77d208a3SMateusz Piotrowski.Oo 59*77d208a3SMateusz Piotrowski.Cm K No | Cm k No | Cm M No | Cm m No | Cm G No | Cm g No | Cm T No | Cm t 60*77d208a3SMateusz Piotrowski.Oc 61*77d208a3SMateusz Piotrowski.Sm on 62*77d208a3SMateusz Piotrowski.Oc 63*77d208a3SMateusz Piotrowski.Op Fl p Ar vcpu Ns Cm \&: Ns Ar hostcpu 64*77d208a3SMateusz Piotrowski.Oo Fl s 65*77d208a3SMateusz Piotrowski.Sm off 66*77d208a3SMateusz Piotrowski.Cm help | Ar slot Cm \&, Ar emulation Op Cm \&, Ar conf 67*77d208a3SMateusz Piotrowski.Sm on 68*77d208a3SMateusz Piotrowski.Oc 695749449dSJohn Baldwin.Op Fl U Ar uuid 70b13e60daSPeter Grehan.Ar vmname 71b13e60daSPeter Grehan.Sh DESCRIPTION 72b13e60daSPeter Grehan.Nm 737fca1ad5SGlen Barberis a hypervisor that runs guest operating systems inside a 74b13e60daSPeter Grehanvirtual machine. 75b13e60daSPeter Grehan.Pp 76b13e60daSPeter GrehanParameters such as the number of virtual CPUs, amount of guest memory, and 77b13e60daSPeter GrehanI/O connectivity can be specified with command-line parameters. 78b13e60daSPeter Grehan.Pp 795c3ec676SGleb SmirnoffIf not using a boot ROM, the guest operating system must be loaded with 8084fe889cSChristian Brueffer.Xr bhyveload 8 81b13e60daSPeter Grehanor a similar boot loader before running 825c3ec676SGleb Smirnoff.Nm , 835c3ec676SGleb Smirnoffotherwise, it is enough to run 845c3ec676SGleb Smirnoff.Nm 855c3ec676SGleb Smirnoffwith a boot ROM of choice. 86b13e60daSPeter Grehan.Pp 87b13e60daSPeter Grehan.Nm 88b13e60daSPeter Grehanruns until the guest operating system reboots or an unhandled hypervisor 89b13e60daSPeter Grehanexit is detected. 90b13e60daSPeter Grehan.Sh OPTIONS 91b13e60daSPeter Grehan.Bl -tag -width 10n 92b13e60daSPeter Grehan.It Fl a 939777ca20SNeel NatuThe guest's local APIC is configured in xAPIC mode. 9484fe889cSChristian BruefferThe xAPIC mode is the default setting so this option is redundant. 9584fe889cSChristian BruefferIt will be deprecated in a future version. 96b13e60daSPeter Grehan.It Fl A 97b13e60daSPeter GrehanGenerate ACPI tables. 98b13e60daSPeter GrehanRequired for 99b13e60daSPeter Grehan.Fx Ns /amd64 100b13e60daSPeter Grehanguests. 1015749449dSJohn Baldwin.It Fl b 1025749449dSJohn BaldwinEnable a low-level console device supported by 103aca4343cSEdward Tomasz Napierala.Fx 104aca4343cSEdward Tomasz Napieralakernels compiled with 1055749449dSJohn Baldwin.Cd "device bvmconsole" . 1065749449dSJohn BaldwinThis option will be deprecated in a future version. 10701d822d3SRodney W. Grimes.It Fl c Op Ar setting ... 10801d822d3SRodney W. GrimesNumber of guest virtual CPUs 10901d822d3SRodney W. Grimesand/or the CPU topology. 11001d822d3SRodney W. GrimesThe default value for each of 11101d822d3SRodney W. Grimes.Ar numcpus , 11201d822d3SRodney W. Grimes.Ar sockets , 11301d822d3SRodney W. Grimes.Ar cores , 11401d822d3SRodney W. Grimesand 11501d822d3SRodney W. Grimes.Ar threads 11601d822d3SRodney W. Grimesis 1. 11701d822d3SRodney W. GrimesThe current maximum number of guest virtual CPUs is 16. 11801d822d3SRodney W. GrimesIf 11901d822d3SRodney W. Grimes.Ar numcpus 12001d822d3SRodney W. Grimesis not specified then it will be calculated from the other arguments. 12101d822d3SRodney W. GrimesThe topology must be consistent in that the 12201d822d3SRodney W. Grimes.Ar numcpus 12301d822d3SRodney W. Grimesmust equal the product of 12401d822d3SRodney W. Grimes.Ar sockets , 12501d822d3SRodney W. Grimes.Ar cores , 12601d822d3SRodney W. Grimesand 12701d822d3SRodney W. Grimes.Ar threads . 12801d822d3SRodney W. GrimesIf a 12901d822d3SRodney W. Grimes.Ar setting 13001d822d3SRodney W. Grimesis specified more than once the last one has precedence. 1310dd10c00SNeel Natu.It Fl C 1320dd10c00SNeel NatuInclude guest memory in core file. 133cde1f5b8SJohn Baldwin.It Fl e 134cde1f5b8SJohn BaldwinForce 135cde1f5b8SJohn Baldwin.Nm 136cde1f5b8SJohn Baldwinto exit when a guest issues an access to an I/O port that is not emulated. 137cde1f5b8SJohn BaldwinThis is intended for debug purposes. 138b13e60daSPeter Grehan.It Fl g Ar gdbport 139b13e60daSPeter GrehanFor 1405749449dSJohn Baldwin.Fx 1415749449dSJohn Baldwinkernels compiled with 1425749449dSJohn Baldwin.Cd "device bvmdebug" , 143b13e60daSPeter Grehanallow a remote kernel kgdb to be relayed to the guest kernel gdb stub 144b13e60daSPeter Grehanvia a local IPv4 address and this port. 145b13e60daSPeter GrehanThis option will be deprecated in a future version. 146cd377eb3SJohn Baldwin.It Fl G Ar port 147cd377eb3SJohn BaldwinStart a debug server that uses the GDB protocol to export guest state to a 148cd377eb3SJohn Baldwindebugger. 149cd377eb3SJohn BaldwinAn IPv4 TCP socket will be bound to the supplied 150cd377eb3SJohn Baldwin.Ar port 151cd377eb3SJohn Baldwinto listen for debugger connections. 152cd377eb3SJohn BaldwinOnly a single debugger may be attached to the debug server at a time. 153cd377eb3SJohn BaldwinIf 154cd377eb3SJohn Baldwin.Ar port 155cd377eb3SJohn Baldwinbegins with 156cd377eb3SJohn Baldwin.Sq w , 157cd377eb3SJohn Baldwin.Nm 158cd377eb3SJohn Baldwinwill pause execution at the first instruction waiting for a debugger to attach. 159cde1f5b8SJohn Baldwin.It Fl h 160cde1f5b8SJohn BaldwinPrint help message and exit. 161cde1f5b8SJohn Baldwin.It Fl H 162cde1f5b8SJohn BaldwinYield the virtual CPU thread when a HLT instruction is detected. 163cde1f5b8SJohn BaldwinIf this option is not specified, virtual CPUs will use 100% of a host CPU. 1641aa56353SMarcelo Araujo.It Fl l Op Ar help|lpcdev Ns Op , Ns Ar conf 165cde1f5b8SJohn BaldwinAllow devices behind the LPC PCI-ISA bridge to be configured. 1669b1aa8d6SNeel NatuThe only supported devices are the TTY-class devices 1679b1aa8d6SNeel Natu.Ar com1 168cde1f5b8SJohn Baldwinand 1699b1aa8d6SNeel Natu.Ar com2 1709b1aa8d6SNeel Natuand the boot ROM device 1719b1aa8d6SNeel Natu.Ar bootrom . 1721aa56353SMarcelo Araujo.Pp 1731aa56353SMarcelo Araujo.Ar help 1741aa56353SMarcelo Araujoprint a list of supported LPC devices. 1756ee52c65SRoman Bogorodskiy.It Fl m Ar memsize Ns Op Ar K|k|M|m|G|g|T|t 176cde1f5b8SJohn BaldwinGuest physical memory size in bytes. 177cde1f5b8SJohn BaldwinThis must be the same size that was given to 178cde1f5b8SJohn Baldwin.Xr bhyveload 8 . 179cde1f5b8SJohn Baldwin.Pp 180cde1f5b8SJohn BaldwinThe size argument may be suffixed with one of K, M, G or T (either upper 181cde1f5b8SJohn Baldwinor lower case) to indicate a multiple of kilobytes, megabytes, gigabytes, 182cde1f5b8SJohn Baldwinor terabytes. 183cde1f5b8SJohn BaldwinIf no suffix is given, the value is assumed to be in megabytes. 1846ee52c65SRoman Bogorodskiy.Pp 1856ee52c65SRoman Bogorodskiy.Ar memsize 1866ee52c65SRoman Bogorodskiydefaults to 256M. 1879b6155a2SNeel Natu.It Fl p Ar vcpu:hostcpu 1889b6155a2SNeel NatuPin guest's virtual CPU 1899b6155a2SNeel Natu.Em vcpu 1909b6155a2SNeel Natuto 1919b6155a2SNeel Natu.Em hostcpu . 192b13e60daSPeter Grehan.It Fl P 193b13e60daSPeter GrehanForce the guest virtual CPU to exit when a PAUSE instruction is detected. 1941aa56353SMarcelo Araujo.It Fl s Op Ar help|slot,emulation Ns Op , Ns Ar conf 195b13e60daSPeter GrehanConfigure a virtual PCI slot and function. 196b13e60daSPeter Grehan.Pp 19784fe889cSChristian Brueffer.Nm 198b13e60daSPeter Grehanprovides PCI bus emulation and virtual devices that can be attached to 199b13e60daSPeter Grehanslots on the bus. 200b13e60daSPeter GrehanThere are 32 available slots, with the option of providing up to 8 functions 201b13e60daSPeter Grehanper slot. 202b13e60daSPeter Grehan.Bl -tag -width 10n 2031aa56353SMarcelo Araujo.It Ar help 2041aa56353SMarcelo Araujoprint a list of supported PCI devices. 205b13e60daSPeter Grehan.It Ar slot 20606db1b4aSNeel Natu.Ar pcislot[:function] 20706db1b4aSNeel Natu.Ar bus:pcislot:function 208b13e60daSPeter Grehan.Pp 209b13e60daSPeter GrehanThe 210b13e60daSPeter Grehan.Ar pcislot 21184fe889cSChristian Brueffervalue is 0 to 31. 21284fe889cSChristian BruefferThe optional 21384fe889cSChristian Brueffer.Ar function 21484fe889cSChristian Brueffervalue is 0 to 7. 21584fe889cSChristian BruefferThe optional 21606db1b4aSNeel Natu.Ar bus 21706db1b4aSNeel Natuvalue is 0 to 255. 21884fe889cSChristian BruefferIf not specified, the 21984fe889cSChristian Brueffer.Ar function 22084fe889cSChristian Brueffervalue defaults to 0. 22184fe889cSChristian BruefferIf not specified, the 22284fe889cSChristian Brueffer.Ar bus 22384fe889cSChristian Brueffervalue defaults to 0. 224b13e60daSPeter Grehan.It Ar emulation 225b13e60daSPeter Grehan.Bl -tag -width 10n 226b13e60daSPeter Grehan.It Li hostbridge | Li amd_hostbridge 227b13e60daSPeter Grehan.Pp 228b13e60daSPeter GrehanProvide a simple host bridge. 229b13e60daSPeter GrehanThis is usually configured at slot 0, and is required by most guest 230b13e60daSPeter Grehanoperating systems. 231b13e60daSPeter GrehanThe 232b13e60daSPeter Grehan.Li amd_hostbridge 233b13e60daSPeter Grehanemulation is identical but uses a PCI vendor ID of 234b13e60daSPeter Grehan.Li AMD . 235b13e60daSPeter Grehan.It Li passthru 236b13e60daSPeter GrehanPCI pass-through device. 237b13e60daSPeter Grehan.It Li virtio-net 238b13e60daSPeter GrehanVirtio network interface. 239a8be8e5eSRemko Lodder.It Li virtio-blk 240b13e60daSPeter GrehanVirtio block storage interface. 241f9c005a1SMarcelo Araujo.It Li virtio-scsi 242f9c005a1SMarcelo AraujoVirtio SCSI interface. 2439d0c4e17SPeter Grehan.It Li virtio-rnd 2449d0c4e17SPeter GrehanVirtio RNG interface. 2455121b6ccSRoman Bogorodskiy.It Li virtio-console 2465121b6ccSRoman BogorodskiyVirtio console interface, which exposes multiple ports 2475121b6ccSRoman Bogorodskiyto the guest in the form of simple char devices for simple IO 2485121b6ccSRoman Bogorodskiybetween the guest and host userspaces. 249098f5155SAlexander Motin.It Li ahci 250d6099860SMaxim KonovalovAHCI controller attached to arbitrary devices. 251b13e60daSPeter Grehan.It Li ahci-cd 252b13e60daSPeter GrehanAHCI controller attached to an ATAPI CD/DVD. 253b13e60daSPeter Grehan.It Li ahci-hd 254b13e60daSPeter GrehanAHCI controller attached to a SATA hard-drive. 2559e749f25SAlexander Motin.It Li e1000 2569e749f25SAlexander MotinIntel e82545 network interface. 257b13e60daSPeter Grehan.It Li uart 258b13e60daSPeter GrehanPCI 16550 serial device. 259b13e60daSPeter Grehan.It Li lpc 2609b1aa8d6SNeel NatuLPC PCI-ISA bridge with COM1 and COM2 16550 serial ports and a boot ROM. 2619b1aa8d6SNeel NatuThe LPC bridge emulation can only be configured on bus 0. 2626c87a2c0SGleb Smirnoff.It Li fbuf 2636c87a2c0SGleb SmirnoffRaw framebuffer device attached to VNC server. 2646c87a2c0SGleb Smirnoff.It Li xhci 2655c3ec676SGleb SmirnoffeXtensible Host Controller Interface (xHCI) USB controller. 266c066c68cSMarcelo Araujo.It Li nvme 267c066c68cSMarcelo AraujoNVM Express (NVMe) controller. 26836f9f044SWarner Losh.It Li hda 26936f9f044SWarner LoshHigh Definition Audio Controller. 270b13e60daSPeter Grehan.El 271b13e60daSPeter Grehan.It Op Ar conf 272b13e60daSPeter GrehanThis optional parameter describes the backend for device emulations. 273b13e60daSPeter GrehanIf 274b13e60daSPeter Grehan.Ar conf 275b13e60daSPeter Grehanis not specified, the device emulation has no backend and can be 276b13e60daSPeter Grehanconsidered unconnected. 277b13e60daSPeter Grehan.Pp 278b13e60daSPeter GrehanNetwork devices: 279b13e60daSPeter Grehan.Bl -tag -width 10n 280b13e60daSPeter Grehan.It Ar tapN Ns Op , Ns Ar mac=xx:xx:xx:xx:xx:xx 281b13e60daSPeter Grehan.It Ar vmnetN Ns Op , Ns Ar mac=xx:xx:xx:xx:xx:xx 282b13e60daSPeter Grehan.Pp 283b13e60daSPeter GrehanIf 284b13e60daSPeter Grehan.Ar mac 285b13e60daSPeter Grehanis not specified, the MAC address is derived from a fixed OUI and the 286b13e60daSPeter Grehanremaining bytes from an MD5 hash of the slot and function numbers and 287b13e60daSPeter Grehanthe device name. 288b13e60daSPeter Grehan.Pp 289b13e60daSPeter GrehanThe MAC address is an ASCII string in 290b13e60daSPeter Grehan.Xr ethers 5 291b13e60daSPeter Grehanformat. 292b13e60daSPeter Grehan.El 293b13e60daSPeter Grehan.Pp 294b13e60daSPeter GrehanBlock storage devices: 295b13e60daSPeter Grehan.Bl -tag -width 10n 2964e43c1e8SNeel Natu.It Pa /filename Ns Oo , Ns Ar block-device-options Oc 2974e43c1e8SNeel Natu.It Pa /dev/xxx Ns Oo , Ns Ar block-device-options Oc 2984e43c1e8SNeel Natu.El 2994e43c1e8SNeel Natu.Pp 3004e43c1e8SNeel NatuThe 3014e43c1e8SNeel Natu.Ar block-device-options 3024e43c1e8SNeel Natuare: 303b13e60daSPeter Grehan.Bl -tag -width 8n 304b13e60daSPeter Grehan.It Li nocache 305b13e60daSPeter GrehanOpen the file with 306b13e60daSPeter Grehan.Dv O_DIRECT . 307b13e60daSPeter Grehan.It Li direct 308b13e60daSPeter GrehanOpen the file using 309b13e60daSPeter Grehan.Dv O_SYNC . 310b13e60daSPeter Grehan.It Li ro 311b13e60daSPeter GrehanForce the file to be opened read-only. 3124e43c1e8SNeel Natu.It Li sectorsize= Ns Ar logical Ns Oo / Ns Ar physical Oc 3134e43c1e8SNeel NatuSpecify the logical and physical sector sizes of the emulated disk. 3144e43c1e8SNeel NatuThe physical sector size is optional and is equal to the logical sector size 3154e43c1e8SNeel Natuif not explicitly specified. 316b13e60daSPeter Grehan.El 317b13e60daSPeter Grehan.Pp 318f9c005a1SMarcelo AraujoSCSI devices: 319f9c005a1SMarcelo Araujo.Bl -tag -width 10n 32049f87822SAlexander Motin.It Pa /dev/cam/ctl Ns Oo Ar pp . Ns Ar vp Oc Ns Oo , Ns Ar scsi-device-options Oc 32149f87822SAlexander Motin.El 32249f87822SAlexander Motin.Pp 32349f87822SAlexander MotinThe 32449f87822SAlexander Motin.Ar scsi-device-options 32549f87822SAlexander Motinare: 32649f87822SAlexander Motin.Bl -tag -width 10n 32749f87822SAlexander Motin.It Li iid= Ns Ar IID 32849f87822SAlexander MotinInitiator ID to use when sending requests to specified CTL port. 32949f87822SAlexander MotinThe default value is 0. 330f9c005a1SMarcelo Araujo.El 331f9c005a1SMarcelo Araujo.Pp 332b13e60daSPeter GrehanTTY devices: 333b13e60daSPeter Grehan.Bl -tag -width 10n 334b13e60daSPeter Grehan.It Li stdio 335b13e60daSPeter GrehanConnect the serial port to the standard input and output of 33684fe889cSChristian Bruefferthe 33784fe889cSChristian Brueffer.Nm 33884fe889cSChristian Bruefferprocess. 339b13e60daSPeter Grehan.It Pa /dev/xxx 340b13e60daSPeter GrehanUse the host TTY device for serial port I/O. 341b13e60daSPeter Grehan.El 342b13e60daSPeter Grehan.Pp 3439b1aa8d6SNeel NatuBoot ROM device: 3449b1aa8d6SNeel Natu.Bl -tag -width 10n 3459b1aa8d6SNeel Natu.It Pa romfile 3469b1aa8d6SNeel NatuMap 3479b1aa8d6SNeel Natu.Ar romfile 3489b1aa8d6SNeel Natuin the guest address space reserved for boot firmware. 3499b1aa8d6SNeel Natu.El 3509b1aa8d6SNeel Natu.Pp 351b13e60daSPeter GrehanPass-through devices: 352b13e60daSPeter Grehan.Bl -tag -width 10n 353b13e60daSPeter Grehan.It Ns Ar slot Ns / Ns Ar bus Ns / Ns Ar function 354b13e60daSPeter GrehanConnect to a PCI device on the host at the selector described by 355b13e60daSPeter Grehan.Ar slot , 356b13e60daSPeter Grehan.Ar bus , 357b13e60daSPeter Grehanand 358b13e60daSPeter Grehan.Ar function 359b13e60daSPeter Grehannumbers. 360b13e60daSPeter Grehan.El 361b13e60daSPeter Grehan.Pp 3629b1aa8d6SNeel NatuGuest memory must be wired using the 3639b1aa8d6SNeel Natu.Fl S 3649b1aa8d6SNeel Natuoption when a pass-through device is configured. 3659b1aa8d6SNeel Natu.Pp 366b13e60daSPeter GrehanThe host device must have been reserved at boot-time using the 367a9258f9bSWarren Block.Va pptdevs 368b13e60daSPeter Grehanloader variable as described in 369b13e60daSPeter Grehan.Xr vmm 4 . 3705121b6ccSRoman Bogorodskiy.Pp 3715121b6ccSRoman BogorodskiyVirtio console devices: 3725121b6ccSRoman Bogorodskiy.Bl -tag -width 10n 3735121b6ccSRoman Bogorodskiy.It Li port1= Ns Pa /path/to/port1.sock Ns ,anotherport= Ns Pa ... 3745121b6ccSRoman BogorodskiyA maximum of 16 ports per device can be created. 3755121b6ccSRoman BogorodskiyEvery port is named and corresponds to a Unix domain socket created by 3765121b6ccSRoman Bogorodskiy.Nm . 3775121b6ccSRoman Bogorodskiy.Nm 3785121b6ccSRoman Bogorodskiyaccepts at most one connection per port at a time. 3795121b6ccSRoman Bogorodskiy.Pp 3805121b6ccSRoman BogorodskiyLimitations: 3815121b6ccSRoman Bogorodskiy.Bl -bullet -offset 2n 3825121b6ccSRoman Bogorodskiy.It 3835121b6ccSRoman BogorodskiyDue to lack of destructors in 3845121b6ccSRoman Bogorodskiy.Nm , 3855121b6ccSRoman Bogorodskiysockets on the filesystem must be cleaned up manually after 3865121b6ccSRoman Bogorodskiy.Nm 3875121b6ccSRoman Bogorodskiyexits. 3885121b6ccSRoman Bogorodskiy.It 3895121b6ccSRoman BogorodskiyThere is no way to use the "console port" feature, nor the console port 3900ee3a4b4SRoman Bogorodskiyresize at present. 3915121b6ccSRoman Bogorodskiy.It 3920ee3a4b4SRoman BogorodskiyEmergency write is advertised, but no-op at present. 3935121b6ccSRoman Bogorodskiy.El 3945121b6ccSRoman Bogorodskiy.El 3956c87a2c0SGleb Smirnoff.Pp 3965c3ec676SGleb SmirnoffFramebuffer devices: 3975c3ec676SGleb Smirnoff.Bl -tag -width 10n 3988d56c805SYuri Pankov.It Xo 3998d56c805SYuri Pankov.Oo rfb= Ns Oo Ar IP\&: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= Ns 4008d56c805SYuri Pankov.Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc Ns Oo ,password= Ns 4018d56c805SYuri Pankov.Ar password Oc 4028d56c805SYuri Pankov.Xc 4035c3ec676SGleb Smirnoff.Bl -tag -width 8n 4048883128bSBjoern A. Zeeb.It Ar IPv4:port No or Ar [IPv6%zone]:port 4055c3ec676SGleb SmirnoffAn 4065c3ec676SGleb Smirnoff.Ar IP 4075c3ec676SGleb Smirnoffaddress and a 4085c3ec676SGleb Smirnoff.Ar port 4095c3ec676SGleb SmirnoffVNC should listen on. 4106c87a2c0SGleb SmirnoffThe default is to listen on localhost IPv4 address and default VNC port 5900. 4118883128bSBjoern A. ZeebAn IPv6 address must be enclosed in square brackets and may contain an 4127d9545fcSRodney W. Grimesoptional zone identifier. 4135c3ec676SGleb Smirnoff.It Ar width No and Ar height 4145c3ec676SGleb SmirnoffA display resolution, width and height, respectively. 4155c3ec676SGleb SmirnoffIf not specified, a default resolution of 1024x768 pixels will be used. 4165c3ec676SGleb SmirnoffMinimal supported resolution is 640x480 pixels, 4175c3ec676SGleb Smirnoffand maximum is 1920x1200 pixels. 4185c3ec676SGleb Smirnoff.It Ar vgaconf 4195c3ec676SGleb SmirnoffPossible values for this option are 4205c3ec676SGleb Smirnoff.Dq io 4215c3ec676SGleb Smirnoff(default), 4225c3ec676SGleb Smirnoff.Dq on 4235c3ec676SGleb Smirnoff, and 4245c3ec676SGleb Smirnoff.Dq off . 4255c3ec676SGleb SmirnoffPCI graphics cards have a dual personality in that they are 4265c3ec676SGleb Smirnoffstandard PCI devices with BAR addressing, but may also 4275c3ec676SGleb Smirnoffimplicitly decode legacy VGA I/O space 4285c3ec676SGleb Smirnoff.Pq Ad 0x3c0-3df 4295c3ec676SGleb Smirnoffand memory space 4305c3ec676SGleb Smirnoff.Pq 64KB at Ad 0xA0000 . 4315c3ec676SGleb SmirnoffThe default 4325c3ec676SGleb Smirnoff.Dq io 4338d56c805SYuri Pankovoption should be used for guests that attempt to issue BIOS calls which result 4348d56c805SYuri Pankovin I/O port queries, and fail to boot if I/O decode is disabled. 4355c3ec676SGleb Smirnoff.Pp 4365c3ec676SGleb SmirnoffThe 4375c3ec676SGleb Smirnoff.Dq on 4385c3ec676SGleb Smirnoffoption should be used along with the CSM BIOS capability in UEFI 4395c3ec676SGleb Smirnoffto boot traditional BIOS guests that require the legacy VGA I/O and 4405c3ec676SGleb Smirnoffmemory regions to be available. 4415c3ec676SGleb Smirnoff.Pp 4425c3ec676SGleb SmirnoffThe 4435c3ec676SGleb Smirnoff.Dq off 4445c3ec676SGleb Smirnoffoption should be used for the UEFI guests that assume that 4455c3ec676SGleb SmirnoffVGA adapter is present if they detect the I/O ports. 4465c3ec676SGleb SmirnoffAn example of such a guest is 4475c3ec676SGleb Smirnoff.Ox 4485c3ec676SGleb Smirnoffin UEFI mode. 4495c3ec676SGleb Smirnoff.Pp 4505c3ec676SGleb SmirnoffPlease refer to the 4515c3ec676SGleb Smirnoff.Nm 4525c3ec676SGleb Smirnoff.Fx 4535c3ec676SGleb Smirnoffwiki page 4545c3ec676SGleb Smirnoff.Pq Lk https://wiki.freebsd.org/bhyve 4555c3ec676SGleb Smirnofffor configuration notes of particular guests. 4565c3ec676SGleb Smirnoff.It wait 4575c3ec676SGleb SmirnoffInstruct 4585c3ec676SGleb Smirnoff.Nm 4598d56c805SYuri Pankovto only boot upon the initiation of a VNC connection, simplifying the 4608d56c805SYuri Pankovinstallation of operating systems that require immediate keyboard input. 4615c3ec676SGleb SmirnoffThis can be removed for post-installation use. 462f4d34383SMarcelo Araujo.It password 463f4d34383SMarcelo AraujoThis type of authentication is known to be cryptographically weak and is not 464f4d34383SMarcelo Araujointended for use on untrusted networks. 465f4d34383SMarcelo AraujoMany implementations will want to use stronger security, such as running 466f4d34383SMarcelo Araujothe session over an encrypted channel provided by IPsec or SSH. 4675c3ec676SGleb Smirnoff.El 4686c87a2c0SGleb Smirnoff.El 4696c87a2c0SGleb Smirnoff.Pp 4705c3ec676SGleb SmirnoffxHCI USB devices: 4715c3ec676SGleb Smirnoff.Bl -tag -width 10n 4725c3ec676SGleb Smirnoff.It Li tablet 4735c3ec676SGleb SmirnoffA USB tablet device which provides precise cursor synchronization 4745c3ec676SGleb Smirnoffwhen using VNC. 4756c87a2c0SGleb Smirnoff.El 476c066c68cSMarcelo Araujo.Pp 477c066c68cSMarcelo AraujoNVMe devices: 478c066c68cSMarcelo Araujo.Bl -tag -width 10n 479c066c68cSMarcelo Araujo.It Li devpath 480c066c68cSMarcelo AraujoAccepted device paths are: 481c066c68cSMarcelo Araujo.Ar /dev/blockdev 482c066c68cSMarcelo Araujoor 483c066c68cSMarcelo Araujo.Ar /path/to/image 484c066c68cSMarcelo Araujoor 485c066c68cSMarcelo Araujo.Ar ram=size_in_MiB . 486c066c68cSMarcelo Araujo.It Li maxq 487c066c68cSMarcelo AraujoMax number of queues. 488c066c68cSMarcelo Araujo.It Li qsz 489c066c68cSMarcelo AraujoMax elements in each queue. 490c066c68cSMarcelo Araujo.It Li ioslots 491c066c68cSMarcelo AraujoMax number of concurrent I/O requests. 492c066c68cSMarcelo Araujo.It Li sectsz 493c066c68cSMarcelo AraujoSector size (defaults to blockif sector size). 494c066c68cSMarcelo Araujo.It Li ser 495c066c68cSMarcelo AraujoSerial number with maximum 20 characters. 496c066c68cSMarcelo Araujo.El 49736f9f044SWarner Losh.Pp 49836f9f044SWarner LoshHD Audio devices: 49936f9f044SWarner Losh.Bl -tag -width 10n 50036f9f044SWarner Losh.It Li play 50136f9f044SWarner LoshPlayback device, typically 50236f9f044SWarner Losh.Ar /dev/dsp0 . 50336f9f044SWarner Losh.It Li rec 50436f9f044SWarner LoshRecording device, typically 50536f9f044SWarner Losh.Ar /dev/dsp0 . 50636f9f044SWarner Losh.El 507b13e60daSPeter Grehan.El 5089b1aa8d6SNeel Natu.It Fl S 5099b1aa8d6SNeel NatuWire guest memory. 510c9747678SNeel Natu.It Fl u 511c9747678SNeel NatuRTC keeps UTC time. 5125749449dSJohn Baldwin.It Fl U Ar uuid 5135749449dSJohn BaldwinSet the universally unique identifier 5145749449dSJohn Baldwin.Pq UUID 5155749449dSJohn Baldwinin the guest's System Management BIOS System Information structure. 5165749449dSJohn BaldwinBy default a UUID is generated from the host's hostname and 5175749449dSJohn Baldwin.Ar vmname . 518851d84f1SNeel Natu.It Fl w 51984fe889cSChristian BruefferIgnore accesses to unimplemented Model Specific Registers (MSRs). 52084fe889cSChristian BruefferThis is intended for debug purposes. 521cde1f5b8SJohn Baldwin.It Fl W 522cde1f5b8SJohn BaldwinForce virtio PCI device emulations to use MSI interrupts instead of MSI-X 523cde1f5b8SJohn Baldwininterrupts. 5249777ca20SNeel Natu.It Fl x 5259777ca20SNeel NatuThe guest's local APIC is configured in x2APIC mode. 526b100acf2SNeel Natu.It Fl Y 527b100acf2SNeel NatuDisable MPtable generation. 528b13e60daSPeter Grehan.It Ar vmname 529b13e60daSPeter GrehanAlphanumeric name of the guest. 530b13e60daSPeter GrehanThis should be the same as that created by 531b13e60daSPeter Grehan.Xr bhyveload 8 . 532b13e60daSPeter Grehan.El 533cd377eb3SJohn Baldwin.Sh DEBUG SERVER 534cd377eb3SJohn BaldwinThe current debug server provides limited support for debuggers. 535cd377eb3SJohn Baldwin.Ss Registers 536cd377eb3SJohn BaldwinEach virtual CPU is exposed to the debugger as a thread. 537cd377eb3SJohn Baldwin.Pp 538cd377eb3SJohn BaldwinGeneral purpose registers can be queried for each virtual CPU, but other 539cd377eb3SJohn Baldwinregisters such as floating-point and system registers cannot be queried. 540cd377eb3SJohn Baldwin.Ss Memory 541976ba8c6SJohn BaldwinMemory (including memory mapped I/O regions) can be read and written by the debugger. 5428d56c805SYuri PankovMemory operations use virtual addresses that are resolved to physical addresses 5438d56c805SYuri Pankovvia the current virtual CPU's active address translation. 544cd377eb3SJohn Baldwin.Ss Control 545cd377eb3SJohn BaldwinThe running guest can be interrupted by the debugger at any time 546cd377eb3SJohn Baldwin.Pq for example, by pressing Ctrl-C in the debugger . 547cd377eb3SJohn Baldwin.Pp 548cd377eb3SJohn BaldwinSingle stepping is only supported on Intel CPUs supporting the MTRAP VM exit. 549cd377eb3SJohn Baldwin.Pp 550cbd03a9dSJohn BaldwinBreakpoints are supported on Intel CPUs that support single stepping. 551cbd03a9dSJohn BaldwinNote that continuing from a breakpoint while interrupts are enabled in the 552cbd03a9dSJohn Baldwinguest may not work as expected due to timer interrupts firing while single 553cbd03a9dSJohn Baldwinstepping over the breakpoint. 554c2202d41SRoman Bogorodskiy.Sh SIGNAL HANDLING 555c2202d41SRoman Bogorodskiy.Nm 556c2202d41SRoman Bogorodskiydeals with the following signals: 557c2202d41SRoman Bogorodskiy.Pp 558c2202d41SRoman Bogorodskiy.Bl -tag -width indent -compact 559c2202d41SRoman Bogorodskiy.It SIGTERM 560c2202d41SRoman BogorodskiyTrigger ACPI poweroff for a VM 561c2202d41SRoman Bogorodskiy.El 562c2202d41SRoman Bogorodskiy.Sh EXIT STATUS 563c2202d41SRoman BogorodskiyExit status indicates how the VM was terminated: 564c2202d41SRoman Bogorodskiy.Pp 565c2202d41SRoman Bogorodskiy.Bl -tag -width indent -compact 566c2202d41SRoman Bogorodskiy.It 0 567c2202d41SRoman Bogorodskiyrebooted 568c2202d41SRoman Bogorodskiy.It 1 569c2202d41SRoman Bogorodskiypowered off 570c2202d41SRoman Bogorodskiy.It 2 571c2202d41SRoman Bogorodskiyhalted 572c2202d41SRoman Bogorodskiy.It 3 573c2202d41SRoman Bogorodskiytriple fault 574989e062bSMarcelo Araujo.It 4 575989e062bSMarcelo Araujoexited due to an error 576c2202d41SRoman Bogorodskiy.El 577b13e60daSPeter Grehan.Sh EXAMPLES 5785c3ec676SGleb SmirnoffIf not using a boot ROM, the guest operating system must have been loaded with 57984fe889cSChristian Brueffer.Xr bhyveload 8 580b13e60daSPeter Grehanor a similar boot loader before 581b13e60daSPeter Grehan.Xr bhyve 4 582b13e60daSPeter Grehancan be run. 5835c3ec676SGleb SmirnoffOtherwise, the boot loader is not needed. 584b13e60daSPeter Grehan.Pp 585b13e60daSPeter GrehanTo run a virtual machine with 1GB of memory, two virtual CPUs, a virtio 586b13e60daSPeter Grehanblock device backed by the 587b13e60daSPeter Grehan.Pa /my/image 588b13e60daSPeter Grehanfilesystem image, and a serial port for the console: 589b13e60daSPeter Grehan.Bd -literal -offset indent 590b13e60daSPeter Grehanbhyve -c 2 -s 0,hostbridge -s 1,lpc -s 2,virtio-blk,/my/image \\ 591b13e60daSPeter Grehan -l com1,stdio -A -H -P -m 1G vm1 592b13e60daSPeter Grehan.Ed 593b13e60daSPeter Grehan.Pp 594b13e60daSPeter GrehanRun a 24GB single-CPU virtual machine with three network ports, one of which 595b13e60daSPeter Grehanhas a MAC address specified: 596b13e60daSPeter Grehan.Bd -literal -offset indent 597b13e60daSPeter Grehanbhyve -s 0,hostbridge -s 1,lpc -s 2:0,virtio-net,tap0 \\ 598b13e60daSPeter Grehan -s 2:1,virtio-net,tap1 \\ 599b13e60daSPeter Grehan -s 2:2,virtio-net,tap2,mac=00:be:fa:76:45:00 \\ 600b13e60daSPeter Grehan -s 3,virtio-blk,/my/image -l com1,stdio \\ 601b13e60daSPeter Grehan -A -H -P -m 24G bigvm 602b13e60daSPeter Grehan.Ed 603b13e60daSPeter Grehan.Pp 604b13e60daSPeter GrehanRun an 8GB quad-CPU virtual machine with 8 AHCI SATA disks, an AHCI ATAPI 605b13e60daSPeter GrehanCD-ROM, a single virtio network port, an AMD hostbridge, and the console 606b13e60daSPeter Grehanport connected to an 607b13e60daSPeter Grehan.Xr nmdm 4 60884fe889cSChristian Brueffernull-modem device. 609b13e60daSPeter Grehan.Bd -literal -offset indent 610a7ab1463SAlexander Motinbhyve -c 4 \\ 611b13e60daSPeter Grehan -s 0,amd_hostbridge -s 1,lpc \\ 612098f5155SAlexander Motin -s 1:0,ahci,hd:/images/disk.1,hd:/images/disk.2,\\ 613098f5155SAlexander Motinhd:/images/disk.3,hd:/images/disk.4,\\ 614098f5155SAlexander Motinhd:/images/disk.5,hd:/images/disk.6,\\ 615098f5155SAlexander Motinhd:/images/disk.7,hd:/images/disk.8,\\ 616098f5155SAlexander Motincd:/images/install.iso \\ 617b13e60daSPeter Grehan -s 3,virtio-net,tap0 \\ 618b13e60daSPeter Grehan -l com1,/dev/nmdm0A \\ 619b13e60daSPeter Grehan -A -H -P -m 8G 620b13e60daSPeter Grehan.Ed 6215c3ec676SGleb Smirnoff.Pp 6225c3ec676SGleb SmirnoffRun a UEFI virtual machine with a display resolution of 800 by 600 pixels 6235c3ec676SGleb Smirnoffthat can be accessed via VNC at: 0.0.0.0:5900. 6245c3ec676SGleb Smirnoff.Bd -literal -offset indent 6255c3ec676SGleb Smirnoffbhyve -c 2 -m 4G -w -H \\ 6265c3ec676SGleb Smirnoff -s 0,hostbridge \\ 6275c3ec676SGleb Smirnoff -s 3,ahci-cd,/path/to/uefi-OS-install.iso \\ 6285c3ec676SGleb Smirnoff -s 4,ahci-hd,disk.img \\ 6295c3ec676SGleb Smirnoff -s 5,virtio-net,tap0 \\ 6305c3ec676SGleb Smirnoff -s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \\ 6315c3ec676SGleb Smirnoff -s 30,xhci,tablet \\ 6325c3ec676SGleb Smirnoff -s 31,lpc -l com1,stdio \\ 6335c3ec676SGleb Smirnoff -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\ 6345c3ec676SGleb Smirnoff uefivm 6355c3ec676SGleb Smirnoff.Ed 6368883128bSBjoern A. Zeeb.Pp 6378883128bSBjoern A. ZeebRun a UEFI virtual machine with a VNC display that is bound to all IPv6 6388883128bSBjoern A. Zeebaddresses on port 5900. 6398883128bSBjoern A. Zeeb.Bd -literal -offset indent 6408883128bSBjoern A. Zeebbhyve -c 2 -m 4G -w -H \\ 6418883128bSBjoern A. Zeeb -s 0,hostbridge \\ 6428883128bSBjoern A. Zeeb -s 4,ahci-hd,disk.img \\ 6438883128bSBjoern A. Zeeb -s 5,virtio-net,tap0 \\ 6448883128bSBjoern A. Zeeb -s 29,fbuf,tcp=[::]:5900,w=800,h=600 \\ 6458883128bSBjoern A. Zeeb -s 30,xhci,tablet \\ 6468883128bSBjoern A. Zeeb -s 31,lpc -l com1,stdio \\ 6478883128bSBjoern A. Zeeb -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\ 6488883128bSBjoern A. Zeeb uefivm 6498883128bSBjoern A. Zeeb.Ed 650b13e60daSPeter Grehan.Sh SEE ALSO 651b13e60daSPeter Grehan.Xr bhyve 4 , 652b13e60daSPeter Grehan.Xr nmdm 4 , 653b13e60daSPeter Grehan.Xr vmm 4 , 654b13e60daSPeter Grehan.Xr ethers 5 , 65505f7cd8bSJoel Dahl.Xr bhyvectl 8 , 65605f7cd8bSJoel Dahl.Xr bhyveload 8 6578d56c805SYuri Pankov.Pp 6588d56c805SYuri Pankov.Rs 6598d56c805SYuri Pankov.%A Intel 6608d56c805SYuri Pankov.%B 64 and IA-32 Architectures Software Developer’s Manual 6618d56c805SYuri Pankov.%V Volume 3 6628d56c805SYuri Pankov.Re 663b13e60daSPeter Grehan.Sh HISTORY 664b13e60daSPeter Grehan.Nm 665b13e60daSPeter Grehanfirst appeared in 666b13e60daSPeter Grehan.Fx 10.0 . 667b13e60daSPeter Grehan.Sh AUTHORS 66801c2b8acSBaptiste Daroussin.An Neel Natu Aq Mt neel@freebsd.org 66901c2b8acSBaptiste Daroussin.An Peter Grehan Aq Mt grehan@freebsd.org 670