1 .\" Copyright (c) 2013 Peter Grehan
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
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.
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
32 .Nd "run a guest operating system inside a virtual machine"
52 .Ar lpcdev Op Cm \&, Ar conf
59 .Cm K No | Cm k No | Cm M No | Cm m No | Cm G No | Cm g No | Cm T No | Cm t
63 .Op Fl p Ar vcpu Ns Cm \&: Ns Ar hostcpu
66 .Ar slot Cm \&, Ar emulation Op Cm \&, Ar conf
77 is a hypervisor that runs guest operating systems inside a
80 Parameters such as the number of virtual CPUs, amount of guest memory, and
81 I/O connectivity can be specified with command-line parameters.
83 If not using a boot ROM, the guest operating system must be loaded with
85 or a similar boot loader before running
87 otherwise, it is enough to run
89 with a boot ROM of choice.
92 runs until the guest operating system reboots or an unhandled hypervisor
102 The guest's local APIC is configured in xAPIC mode.
103 The xAPIC mode is the default setting so this option is redundant.
104 It will be deprecated in a future version.
106 Enable a low-level console device supported by
108 kernels compiled with
109 .Cd "device bvmconsole" .
110 This option is deprecated and will be removed in
113 Include guest memory in core file.
114 .It Fl c Op Ar setting ...
115 Number of guest virtual CPUs
116 and/or the CPU topology.
117 The default value for each of
124 The current maximum number of guest virtual CPUs is 16.
127 is not specified then it will be calculated from the other arguments.
128 The topology must be consistent in that the
130 must equal the product of
137 is specified more than once the last one has precedence.
139 Destroy the VM on guest initiated power-off.
143 to exit when a guest issues an access to an I/O port that is not emulated.
144 This is intended for debug purposes.
146 Start a debug server that uses the GDB protocol to export guest state to a
148 An IPv4 TCP socket will be bound to the supplied
150 to listen for debugger connections.
151 Only a single debugger may be attached to the debug server at a time.
157 will pause execution at the first instruction waiting for a debugger to attach.
161 kernels compiled with
162 .Cd "device bvmdebug" ,
163 allow a remote kernel kgdb to be relayed to the guest kernel gdb stub
164 via a local IPv4 address and this port.
165 This option is deprecated and will be removed in
168 Yield the virtual CPU thread when a HLT instruction is detected.
169 If this option is not specified, virtual CPUs will use 100% of a host CPU.
171 Print help message and exit.
173 Set configuration variables from a simple, key-value config file.
174 Each line of the config file is expected to consist of a config variable
178 No spaces are permitted between the variable name, equals sign, or
180 Blank lines and lines starting with
184 Print a list of supported LPC devices.
185 .It Fl l Ar lpcdev Ns Op Cm \&, Ns Ar conf
186 Allow devices behind the LPC PCI-ISA bridge to be configured.
187 The only supported devices are the TTY-class devices
193 and the debug/test device
196 The possible values for the
198 argument are listed in the
202 .Fl m Ar memsize Ns Oo
204 .Cm K | k | M | m | G | g | T | t
208 Set the guest physical memory size
209 This must be the same size that was given to
212 The size argument may be suffixed with one of
216 (either upper or lower case)
217 to indicate a multiple of kilobytes, megabytes, gigabytes, or terabytes.
218 If no suffix is given, the value is assumed to be in megabytes.
221 .It Fl o Ar var Ns Cm = Ns Ar value
222 Set the configuration variable
227 Force the guest virtual CPU to exit when a PAUSE instruction is detected.
228 .It Fl p Ar vcpu Ns Cm \& : Ns Ar hostcpu
229 Pin guest's virtual CPU
234 Force the guest virtual CPU to exit when a PAUSE instruction is detected.
237 .It Fl s Op Ar help|slot,emulation Ns Op , Ns Ar conf
238 Configure a virtual PCI slot and function.
241 provides PCI bus emulation and virtual devices that can be attached to
243 There are 32 available slots, with the option of providing up to 8 functions
247 print a list of supported PCI devices.
249 .Ar pcislot[:function]
250 .Ar bus:pcislot:function
261 If not specified, the
264 If not specified, the
269 .It Li hostbridge | Li amd_hostbridge
271 Provide a simple host bridge.
272 This is usually configured at slot 0, and is required by most guest
276 emulation is identical but uses a PCI vendor ID of
279 PCI pass-through device.
281 Virtio network interface.
283 Virtio block storage interface.
285 Virtio SCSI interface.
287 Virtio RNG interface.
288 .It Li virtio-console
289 Virtio console interface, which exposes multiple ports
290 to the guest in the form of simple char devices for simple IO
291 between the guest and host userspaces.
293 AHCI controller attached to arbitrary devices.
295 AHCI controller attached to an ATAPI CD/DVD.
297 AHCI controller attached to a SATA hard-drive.
299 Intel e82545 network interface.
301 PCI 16550 serial device.
303 LPC PCI-ISA bridge with COM1 and COM2 16550 serial ports, a boot ROM, and,
304 optionally, the debug/test device.
305 The LPC bridge emulation can only be configured on bus 0.
307 Raw framebuffer device attached to VNC server.
309 eXtensible Host Controller Interface (xHCI) USB controller.
311 NVM Express (NVMe) controller.
314 This optional parameter describes the backend for device emulations.
317 is not specified, the device emulation has no backend and can be
318 considered unconnected.
322 .It Ar tapN Ns Op , Ns Ar mac=xx:xx:xx:xx:xx:xx
323 .It Ar vmnetN Ns Op , Ns Ar mac=xx:xx:xx:xx:xx:xx
327 is not specified, the MAC address is derived from a fixed OUI and the
328 remaining bytes from an MD5 hash of the slot and function numbers and
331 The MAC address is an ASCII string in
336 Block storage devices:
338 .It Pa /filename Ns Oo , Ns Ar block-device-options Oc
339 .It Pa /dev/xxx Ns Oo , Ns Ar block-device-options Oc
343 .Ar block-device-options
353 Force the file to be opened read-only.
354 .It Li sectorsize= Ns Ar logical Ns Oo / Ns Ar physical Oc
355 Specify the logical and physical sector sizes of the emulated disk.
356 The physical sector size is optional and is equal to the logical sector size
357 if not explicitly specified.
362 .It Pa /dev/cam/ctl Ns Oo Ar pp . Ns Ar vp Oc Ns Oo , Ns Ar scsi-device-options Oc
366 .Ar scsi-device-options
369 .It Li iid= Ns Ar IID
370 Initiator ID to use when sending requests to specified CTL port.
371 The default value is 0.
377 Connect the serial port to the standard input and output of
382 Use the host TTY device for serial port I/O.
390 in the guest address space reserved for boot firmware.
393 Pass-through devices:
395 .It Ns Ar slot Ns / Ns Ar bus Ns / Ns Ar function
396 Connect to a PCI device on the host at the selector described by
404 Guest memory must be wired using the
406 option when a pass-through device is configured.
408 The host device must have been reserved at boot-time using the
410 loader variable as described in
413 Virtio console devices:
415 .It Li port1= Ns Pa /path/to/port1.sock Ns ,anotherport= Ns Pa ...
416 A maximum of 16 ports per device can be created.
417 Every port is named and corresponds to a Unix domain socket created by
420 accepts at most one connection per port at a time.
423 .Bl -bullet -offset 2n
425 Due to lack of destructors in
427 sockets on the filesystem must be cleaned up manually after
431 There is no way to use the "console port" feature, nor the console port
434 Emergency write is advertised, but no-op at present.
441 .Oo rfb= Ns Oo Ar IP\&: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= Ns
442 .Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc Ns Oo ,password= Ns
446 .It Ar IPv4:port No or Ar [IPv6%zone]:port
451 VNC should listen on.
452 The default is to listen on localhost IPv4 address and default VNC port 5900.
453 An IPv6 address must be enclosed in square brackets and may contain an
454 optional zone identifier.
455 .It Ar width No and Ar height
456 A display resolution, width and height, respectively.
457 If not specified, a default resolution of 1024x768 pixels will be used.
458 Minimal supported resolution is 640x480 pixels,
459 and maximum is 1920x1200 pixels.
461 Possible values for this option are
467 PCI graphics cards have a dual personality in that they are
468 standard PCI devices with BAR addressing, but may also
469 implicitly decode legacy VGA I/O space
472 .Pq 64KB at Ad 0xA0000 .
475 option should be used for guests that attempt to issue BIOS calls which result
476 in I/O port queries, and fail to boot if I/O decode is disabled.
480 option should be used along with the CSM BIOS capability in UEFI
481 to boot traditional BIOS guests that require the legacy VGA I/O and
482 memory regions to be available.
486 option should be used for the UEFI guests that assume that
487 VGA adapter is present if they detect the I/O ports.
488 An example of such a guest is
496 .Pq Lk https://wiki.freebsd.org/bhyve
497 for configuration notes of particular guests.
501 to only boot upon the initiation of a VNC connection, simplifying the
502 installation of operating systems that require immediate keyboard input.
503 This can be removed for post-installation use.
505 This type of authentication is known to be cryptographically weak and is not
506 intended for use on untrusted networks.
507 Many implementations will want to use stronger security, such as running
508 the session over an encrypted channel provided by IPsec or SSH.
515 A USB tablet device which provides precise cursor synchronization
522 Accepted device paths are:
527 .Ar ram=size_in_MiB .
529 Max number of queues.
531 Max elements in each queue.
533 Max number of concurrent I/O requests.
535 Sector size (defaults to blockif sector size).
537 Serial number with maximum 20 characters.
543 Nominal Media Rotation Rate, known as RPM. value 1 will indicate device as Solid State Disk. default value is 0, not report.
545 Serial Number with maximum 20 characters.
547 Revision Number with maximum 8 characters.
549 Model Number with maximum 40 characters.
555 Playback device, typically
558 Recording device, typically
563 Set the universally unique identifier
565 in the guest's System Management BIOS System Information structure.
566 By default a UUID is generated from the host's hostname and
571 Force virtio PCI device emulations to use MSI interrupts instead of MSI-X
574 Ignore accesses to unimplemented Model Specific Registers (MSRs).
575 This is intended for debug purposes.
577 The guest's local APIC is configured in x2APIC mode.
579 Disable MPtable generation.
581 Alphanumeric name of the guest.
582 This should be the same as that created by
586 The current debug server provides limited support for debuggers.
588 Each virtual CPU is exposed to the debugger as a thread.
590 General purpose registers can be queried for each virtual CPU, but other
591 registers such as floating-point and system registers cannot be queried.
593 Memory (including memory mapped I/O regions) can be read by the debugger,
595 Memory operations use virtual addresses that are resolved to physical addresses
596 via the current virtual CPU's active address translation.
598 The running guest can be interrupted by the debugger at any time
599 .Pq for example, by pressing Ctrl-C in the debugger .
601 Single stepping is only supported on Intel CPUs supporting the MTRAP VM exit.
603 Breakpoints are supported on Intel CPUs that support single stepping.
604 Note that continuing from a breakpoint while interrupts are enabled in the
605 guest may not work as expected due to timer interrupts firing while single
606 stepping over the breakpoint.
609 deals with the following signals:
611 .Bl -tag -width SIGTERM -compact
613 Trigger ACPI poweroff for a VM
616 Exit status indicates how the VM was terminated:
618 .Bl -tag -width indent -compact
628 exited due to an error
631 If not using a boot ROM, the guest operating system must have been loaded with
633 or a similar boot loader before
636 Otherwise, the boot loader is not needed.
638 To run a virtual machine with 1GB of memory, two virtual CPUs, a virtio
639 block device backed by the
641 filesystem image, and a serial port for the console:
642 .Bd -literal -offset indent
643 bhyve -c 2 -s 0,hostbridge -s 1,lpc -s 2,virtio-blk,/my/image \\
644 -l com1,stdio -A -H -P -m 1G vm1
647 Run a 24GB single-CPU virtual machine with three network ports, one of which
648 has a MAC address specified:
649 .Bd -literal -offset indent
650 bhyve -s 0,hostbridge -s 1,lpc -s 2:0,virtio-net,tap0 \\
651 -s 2:1,virtio-net,tap1 \\
652 -s 2:2,virtio-net,tap2,mac=00:be:fa:76:45:00 \\
653 -s 3,virtio-blk,/my/image -l com1,stdio \\
654 -A -H -P -m 24G bigvm
657 Run an 8GB quad-CPU virtual machine with 8 AHCI SATA disks, an AHCI ATAPI
658 CD-ROM, a single virtio network port, an AMD hostbridge, and the console
662 .Bd -literal -offset indent
664 -s 0,amd_hostbridge -s 1,lpc \\
665 -s 1:0,ahci,hd:/images/disk.1,hd:/images/disk.2,\\
666 hd:/images/disk.3,hd:/images/disk.4,\\
667 hd:/images/disk.5,hd:/images/disk.6,\\
668 hd:/images/disk.7,hd:/images/disk.8,\\
669 cd:/images/install.iso \\
670 -s 3,virtio-net,tap0 \\
671 -l com1,/dev/nmdm0A \\
675 Run a UEFI virtual machine with a display resolution of 800 by 600 pixels
676 that can be accessed via VNC at: 0.0.0.0:5900.
677 .Bd -literal -offset indent
678 bhyve -c 2 -m 4G -w -H \\
680 -s 3,ahci-cd,/path/to/uefi-OS-install.iso \\
681 -s 4,ahci-hd,disk.img \\
682 -s 5,virtio-net,tap0 \\
683 -s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \\
685 -s 31,lpc -l com1,stdio \\
686 -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\
690 Run a UEFI virtual machine with a VNC display that is bound to all IPv6
691 addresses on port 5900.
692 .Bd -literal -offset indent
693 bhyve -c 2 -m 4G -w -H \\
695 -s 4,ahci-hd,disk.img \\
696 -s 5,virtio-net,tap0 \\
697 -s 29,fbuf,tcp=[::]:5900,w=800,h=600 \\
699 -s 31,lpc -l com1,stdio \\
700 -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\
713 .%B 64 and IA-32 Architectures Software Developer’s Manual
721 .An Neel Natu Aq Mt neel@freebsd.org
722 .An Peter Grehan Aq Mt grehan@freebsd.org