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