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