xref: /freebsd/usr.sbin/bhyve/bhyve.8 (revision c066c68c57f812f5dfe22cad38108d1668c49124)
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*c066c68cSMarcelo Araujo.Dd Jul 05, 2018
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
359b1aa8d6SNeel Natu.Op Fl abehuwxACHPSWY
3601d822d3SRodney W. Grimes.Oo
3701d822d3SRodney W. Grimes.Fl c\~ Ns
3801d822d3SRodney W. Grimes.Oo
3901d822d3SRodney W. Grimes.Op Ar cpus= Ns
4001d822d3SRodney W. Grimes.Ar numcpus Ns
4101d822d3SRodney W. Grimes.Oc Ns
4201d822d3SRodney W. Grimes.Op Ar ,sockets=n Ns
4301d822d3SRodney W. Grimes.Op Ar ,cores=n Ns
4401d822d3SRodney W. Grimes.Op Ar ,threads=n
4501d822d3SRodney W. Grimes.Oc
46b13e60daSPeter Grehan.Op Fl g Ar gdbport
47cde1f5b8SJohn Baldwin.Op Fl l Ar lpcdev Ns Op , Ns Ar conf
486ee52c65SRoman Bogorodskiy.Op Fl m Ar memsize Ns Op Ar K|k|M|m|G|g|T|t
499b6155a2SNeel Natu.Op Fl p Ar vcpu:hostcpu
50b13e60daSPeter Grehan.Op Fl s Ar slot,emulation Ns Op , Ns Ar conf
51cd377eb3SJohn Baldwin.Op Fl G Ar port
525749449dSJohn Baldwin.Op Fl U Ar uuid
53b13e60daSPeter Grehan.Ar vmname
54b13e60daSPeter Grehan.Sh DESCRIPTION
55b13e60daSPeter Grehan.Nm
567fca1ad5SGlen Barberis a hypervisor that runs guest operating systems inside a
57b13e60daSPeter Grehanvirtual machine.
58b13e60daSPeter Grehan.Pp
59b13e60daSPeter GrehanParameters such as the number of virtual CPUs, amount of guest memory, and
60b13e60daSPeter GrehanI/O connectivity can be specified with command-line parameters.
61b13e60daSPeter Grehan.Pp
625c3ec676SGleb SmirnoffIf not using a boot ROM, the guest operating system must be loaded with
6384fe889cSChristian Brueffer.Xr bhyveload 8
64b13e60daSPeter Grehanor a similar boot loader before running
655c3ec676SGleb Smirnoff.Nm ,
665c3ec676SGleb Smirnoffotherwise, it is enough to run
675c3ec676SGleb Smirnoff.Nm
685c3ec676SGleb Smirnoffwith a boot ROM of choice.
69b13e60daSPeter Grehan.Pp
70b13e60daSPeter Grehan.Nm
71b13e60daSPeter Grehanruns until the guest operating system reboots or an unhandled hypervisor
72b13e60daSPeter Grehanexit is detected.
73b13e60daSPeter Grehan.Sh OPTIONS
74b13e60daSPeter Grehan.Bl -tag -width 10n
75b13e60daSPeter Grehan.It Fl a
769777ca20SNeel NatuThe guest's local APIC is configured in xAPIC mode.
7784fe889cSChristian BruefferThe xAPIC mode is the default setting so this option is redundant.
7884fe889cSChristian BruefferIt will be deprecated in a future version.
79b13e60daSPeter Grehan.It Fl A
80b13e60daSPeter GrehanGenerate ACPI tables.
81b13e60daSPeter GrehanRequired for
82b13e60daSPeter Grehan.Fx Ns /amd64
83b13e60daSPeter Grehanguests.
845749449dSJohn Baldwin.It Fl b
855749449dSJohn BaldwinEnable a low-level console device supported by
86aca4343cSEdward Tomasz Napierala.Fx
87aca4343cSEdward Tomasz Napieralakernels compiled with
885749449dSJohn Baldwin.Cd "device bvmconsole" .
895749449dSJohn BaldwinThis option will be deprecated in a future version.
9001d822d3SRodney W. Grimes.It Fl c Op Ar setting ...
9101d822d3SRodney W. GrimesNumber of guest virtual CPUs
9201d822d3SRodney W. Grimesand/or the CPU topology.
9301d822d3SRodney W. GrimesThe default value for each of
9401d822d3SRodney W. Grimes.Ar numcpus ,
9501d822d3SRodney W. Grimes.Ar sockets ,
9601d822d3SRodney W. Grimes.Ar cores ,
9701d822d3SRodney W. Grimesand
9801d822d3SRodney W. Grimes.Ar threads
9901d822d3SRodney W. Grimesis 1.
10001d822d3SRodney W. GrimesThe current maximum number of guest virtual CPUs is 16.
10101d822d3SRodney W. GrimesIf
10201d822d3SRodney W. Grimes.Ar numcpus
10301d822d3SRodney W. Grimesis not specified then it will be calculated from the other arguments.
10401d822d3SRodney W. GrimesThe topology must be consistent in that the
10501d822d3SRodney W. Grimes.Ar numcpus
10601d822d3SRodney W. Grimesmust equal the product of
10701d822d3SRodney W. Grimes.Ar sockets ,
10801d822d3SRodney W. Grimes.Ar cores ,
10901d822d3SRodney W. Grimesand
11001d822d3SRodney W. Grimes.Ar threads .
11101d822d3SRodney W. GrimesIf a
11201d822d3SRodney W. Grimes.Ar setting
11301d822d3SRodney W. Grimesis specified more than once the last one has precedence.
1140dd10c00SNeel Natu.It Fl C
1150dd10c00SNeel NatuInclude guest memory in core file.
116cde1f5b8SJohn Baldwin.It Fl e
117cde1f5b8SJohn BaldwinForce
118cde1f5b8SJohn Baldwin.Nm
119cde1f5b8SJohn Baldwinto exit when a guest issues an access to an I/O port that is not emulated.
120cde1f5b8SJohn BaldwinThis is intended for debug purposes.
121b13e60daSPeter Grehan.It Fl g Ar gdbport
122b13e60daSPeter GrehanFor
1235749449dSJohn Baldwin.Fx
1245749449dSJohn Baldwinkernels compiled with
1255749449dSJohn Baldwin.Cd "device bvmdebug" ,
126b13e60daSPeter Grehanallow a remote kernel kgdb to be relayed to the guest kernel gdb stub
127b13e60daSPeter Grehanvia a local IPv4 address and this port.
128b13e60daSPeter GrehanThis option will be deprecated in a future version.
129cd377eb3SJohn Baldwin.It Fl G Ar port
130cd377eb3SJohn BaldwinStart a debug server that uses the GDB protocol to export guest state to a
131cd377eb3SJohn Baldwindebugger.
132cd377eb3SJohn BaldwinAn IPv4 TCP socket will be bound to the supplied
133cd377eb3SJohn Baldwin.Ar port
134cd377eb3SJohn Baldwinto listen for debugger connections.
135cd377eb3SJohn BaldwinOnly a single debugger may be attached to the debug server at a time.
136cd377eb3SJohn BaldwinIf
137cd377eb3SJohn Baldwin.Ar port
138cd377eb3SJohn Baldwinbegins with
139cd377eb3SJohn Baldwin.Sq w ,
140cd377eb3SJohn Baldwin.Nm
141cd377eb3SJohn Baldwinwill pause execution at the first instruction waiting for a debugger to attach.
142cde1f5b8SJohn Baldwin.It Fl h
143cde1f5b8SJohn BaldwinPrint help message and exit.
144cde1f5b8SJohn Baldwin.It Fl H
145cde1f5b8SJohn BaldwinYield the virtual CPU thread when a HLT instruction is detected.
146cde1f5b8SJohn BaldwinIf this option is not specified, virtual CPUs will use 100% of a host CPU.
147cde1f5b8SJohn Baldwin.It Fl l Ar lpcdev Ns Op , Ns Ar conf
148cde1f5b8SJohn BaldwinAllow devices behind the LPC PCI-ISA bridge to be configured.
1499b1aa8d6SNeel NatuThe only supported devices are the TTY-class devices
1509b1aa8d6SNeel Natu.Ar com1
151cde1f5b8SJohn Baldwinand
1529b1aa8d6SNeel Natu.Ar com2
1539b1aa8d6SNeel Natuand the boot ROM device
1549b1aa8d6SNeel Natu.Ar bootrom .
1556ee52c65SRoman Bogorodskiy.It Fl m Ar memsize Ns Op Ar K|k|M|m|G|g|T|t
156cde1f5b8SJohn BaldwinGuest physical memory size in bytes.
157cde1f5b8SJohn BaldwinThis must be the same size that was given to
158cde1f5b8SJohn Baldwin.Xr bhyveload 8 .
159cde1f5b8SJohn Baldwin.Pp
160cde1f5b8SJohn BaldwinThe size argument may be suffixed with one of K, M, G or T (either upper
161cde1f5b8SJohn Baldwinor lower case) to indicate a multiple of kilobytes, megabytes, gigabytes,
162cde1f5b8SJohn Baldwinor terabytes.
163cde1f5b8SJohn BaldwinIf no suffix is given, the value is assumed to be in megabytes.
1646ee52c65SRoman Bogorodskiy.Pp
1656ee52c65SRoman Bogorodskiy.Ar memsize
1666ee52c65SRoman Bogorodskiydefaults to 256M.
1679b6155a2SNeel Natu.It Fl p Ar vcpu:hostcpu
1689b6155a2SNeel NatuPin guest's virtual CPU
1699b6155a2SNeel Natu.Em vcpu
1709b6155a2SNeel Natuto
1719b6155a2SNeel Natu.Em hostcpu .
172b13e60daSPeter Grehan.It Fl P
173b13e60daSPeter GrehanForce the guest virtual CPU to exit when a PAUSE instruction is detected.
174b13e60daSPeter Grehan.It Fl s Ar slot,emulation Ns Op , Ns Ar conf
175b13e60daSPeter GrehanConfigure a virtual PCI slot and function.
176b13e60daSPeter Grehan.Pp
17784fe889cSChristian Brueffer.Nm
178b13e60daSPeter Grehanprovides PCI bus emulation and virtual devices that can be attached to
179b13e60daSPeter Grehanslots on the bus.
180b13e60daSPeter GrehanThere are 32 available slots, with the option of providing up to 8 functions
181b13e60daSPeter Grehanper slot.
182b13e60daSPeter Grehan.Bl -tag -width 10n
183b13e60daSPeter Grehan.It Ar slot
18406db1b4aSNeel Natu.Ar pcislot[:function]
18506db1b4aSNeel Natu.Ar bus:pcislot:function
186b13e60daSPeter Grehan.Pp
187b13e60daSPeter GrehanThe
188b13e60daSPeter Grehan.Ar pcislot
18984fe889cSChristian Brueffervalue is 0 to 31.
19084fe889cSChristian BruefferThe optional
19184fe889cSChristian Brueffer.Ar function
19284fe889cSChristian Brueffervalue is 0 to 7.
19384fe889cSChristian BruefferThe optional
19406db1b4aSNeel Natu.Ar bus
19506db1b4aSNeel Natuvalue is 0 to 255.
19684fe889cSChristian BruefferIf not specified, the
19784fe889cSChristian Brueffer.Ar function
19884fe889cSChristian Brueffervalue defaults to 0.
19984fe889cSChristian BruefferIf not specified, the
20084fe889cSChristian Brueffer.Ar bus
20184fe889cSChristian Brueffervalue defaults to 0.
202b13e60daSPeter Grehan.It Ar emulation
203b13e60daSPeter Grehan.Bl -tag -width 10n
204b13e60daSPeter Grehan.It Li hostbridge | Li amd_hostbridge
205b13e60daSPeter Grehan.Pp
206b13e60daSPeter GrehanProvide a simple host bridge.
207b13e60daSPeter GrehanThis is usually configured at slot 0, and is required by most guest
208b13e60daSPeter Grehanoperating systems.
209b13e60daSPeter GrehanThe
210b13e60daSPeter Grehan.Li amd_hostbridge
211b13e60daSPeter Grehanemulation is identical but uses a PCI vendor ID of
212b13e60daSPeter Grehan.Li AMD .
213b13e60daSPeter Grehan.It Li passthru
214b13e60daSPeter GrehanPCI pass-through device.
215b13e60daSPeter Grehan.It Li virtio-net
216b13e60daSPeter GrehanVirtio network interface.
217a8be8e5eSRemko Lodder.It Li virtio-blk
218b13e60daSPeter GrehanVirtio block storage interface.
219f9c005a1SMarcelo Araujo.It Li virtio-scsi
220f9c005a1SMarcelo AraujoVirtio SCSI interface.
2219d0c4e17SPeter Grehan.It Li virtio-rnd
2229d0c4e17SPeter GrehanVirtio RNG interface.
2235121b6ccSRoman Bogorodskiy.It Li virtio-console
2245121b6ccSRoman BogorodskiyVirtio console interface, which exposes multiple ports
2255121b6ccSRoman Bogorodskiyto the guest in the form of simple char devices for simple IO
2265121b6ccSRoman Bogorodskiybetween the guest and host userspaces.
227098f5155SAlexander Motin.It Li ahci
228d6099860SMaxim KonovalovAHCI controller attached to arbitrary devices.
229b13e60daSPeter Grehan.It Li ahci-cd
230b13e60daSPeter GrehanAHCI controller attached to an ATAPI CD/DVD.
231b13e60daSPeter Grehan.It Li ahci-hd
232b13e60daSPeter GrehanAHCI controller attached to a SATA hard-drive.
2339e749f25SAlexander Motin.It Li e1000
2349e749f25SAlexander MotinIntel e82545 network interface.
235b13e60daSPeter Grehan.It Li uart
236b13e60daSPeter GrehanPCI 16550 serial device.
237b13e60daSPeter Grehan.It Li lpc
2389b1aa8d6SNeel NatuLPC PCI-ISA bridge with COM1 and COM2 16550 serial ports and a boot ROM.
2399b1aa8d6SNeel NatuThe LPC bridge emulation can only be configured on bus 0.
2406c87a2c0SGleb Smirnoff.It Li fbuf
2416c87a2c0SGleb SmirnoffRaw framebuffer device attached to VNC server.
2426c87a2c0SGleb Smirnoff.It Li xhci
2435c3ec676SGleb SmirnoffeXtensible Host Controller Interface (xHCI) USB controller.
244*c066c68cSMarcelo Araujo.It Li nvme
245*c066c68cSMarcelo AraujoNVM Express (NVMe) controller.
246b13e60daSPeter Grehan.El
247b13e60daSPeter Grehan.It Op Ar conf
248b13e60daSPeter GrehanThis optional parameter describes the backend for device emulations.
249b13e60daSPeter GrehanIf
250b13e60daSPeter Grehan.Ar conf
251b13e60daSPeter Grehanis not specified, the device emulation has no backend and can be
252b13e60daSPeter Grehanconsidered unconnected.
253b13e60daSPeter Grehan.Pp
254b13e60daSPeter GrehanNetwork devices:
255b13e60daSPeter Grehan.Bl -tag -width 10n
256b13e60daSPeter Grehan.It Ar tapN Ns Op , Ns Ar mac=xx:xx:xx:xx:xx:xx
257b13e60daSPeter Grehan.It Ar vmnetN Ns Op , Ns Ar mac=xx:xx:xx:xx:xx:xx
258b13e60daSPeter Grehan.Pp
259b13e60daSPeter GrehanIf
260b13e60daSPeter Grehan.Ar mac
261b13e60daSPeter Grehanis not specified, the MAC address is derived from a fixed OUI and the
262b13e60daSPeter Grehanremaining bytes from an MD5 hash of the slot and function numbers and
263b13e60daSPeter Grehanthe device name.
264b13e60daSPeter Grehan.Pp
265b13e60daSPeter GrehanThe MAC address is an ASCII string in
266b13e60daSPeter Grehan.Xr ethers 5
267b13e60daSPeter Grehanformat.
268b13e60daSPeter Grehan.El
269b13e60daSPeter Grehan.Pp
270b13e60daSPeter GrehanBlock storage devices:
271b13e60daSPeter Grehan.Bl -tag -width 10n
2724e43c1e8SNeel Natu.It Pa /filename Ns Oo , Ns Ar block-device-options Oc
2734e43c1e8SNeel Natu.It Pa /dev/xxx Ns Oo , Ns Ar block-device-options Oc
2744e43c1e8SNeel Natu.El
2754e43c1e8SNeel Natu.Pp
2764e43c1e8SNeel NatuThe
2774e43c1e8SNeel Natu.Ar block-device-options
2784e43c1e8SNeel Natuare:
279b13e60daSPeter Grehan.Bl -tag -width 8n
280b13e60daSPeter Grehan.It Li nocache
281b13e60daSPeter GrehanOpen the file with
282b13e60daSPeter Grehan.Dv O_DIRECT .
283b13e60daSPeter Grehan.It Li direct
284b13e60daSPeter GrehanOpen the file using
285b13e60daSPeter Grehan.Dv O_SYNC .
286b13e60daSPeter Grehan.It Li ro
287b13e60daSPeter GrehanForce the file to be opened read-only.
2884e43c1e8SNeel Natu.It Li sectorsize= Ns Ar logical Ns Oo / Ns Ar physical Oc
2894e43c1e8SNeel NatuSpecify the logical and physical sector sizes of the emulated disk.
2904e43c1e8SNeel NatuThe physical sector size is optional and is equal to the logical sector size
2914e43c1e8SNeel Natuif not explicitly specified.
292b13e60daSPeter Grehan.El
293b13e60daSPeter Grehan.Pp
294f9c005a1SMarcelo AraujoSCSI devices:
295f9c005a1SMarcelo Araujo.Bl -tag -width 10n
296f9c005a1SMarcelo Araujo.It Pa /dev/cam/ Ns Oo , Ns Ar port and initiator_id Oc
297f9c005a1SMarcelo Araujo.El
298f9c005a1SMarcelo Araujo.Pp
299b13e60daSPeter GrehanTTY devices:
300b13e60daSPeter Grehan.Bl -tag -width 10n
301b13e60daSPeter Grehan.It Li stdio
302b13e60daSPeter GrehanConnect the serial port to the standard input and output of
30384fe889cSChristian Bruefferthe
30484fe889cSChristian Brueffer.Nm
30584fe889cSChristian Bruefferprocess.
306b13e60daSPeter Grehan.It Pa /dev/xxx
307b13e60daSPeter GrehanUse the host TTY device for serial port I/O.
308b13e60daSPeter Grehan.El
309b13e60daSPeter Grehan.Pp
3109b1aa8d6SNeel NatuBoot ROM device:
3119b1aa8d6SNeel Natu.Bl -tag -width 10n
3129b1aa8d6SNeel Natu.It Pa romfile
3139b1aa8d6SNeel NatuMap
3149b1aa8d6SNeel Natu.Ar romfile
3159b1aa8d6SNeel Natuin the guest address space reserved for boot firmware.
3169b1aa8d6SNeel Natu.El
3179b1aa8d6SNeel Natu.Pp
318b13e60daSPeter GrehanPass-through devices:
319b13e60daSPeter Grehan.Bl -tag -width 10n
320b13e60daSPeter Grehan.It Ns Ar slot Ns / Ns Ar bus Ns / Ns Ar function
321b13e60daSPeter GrehanConnect to a PCI device on the host at the selector described by
322b13e60daSPeter Grehan.Ar slot ,
323b13e60daSPeter Grehan.Ar bus ,
324b13e60daSPeter Grehanand
325b13e60daSPeter Grehan.Ar function
326b13e60daSPeter Grehannumbers.
327b13e60daSPeter Grehan.El
328b13e60daSPeter Grehan.Pp
3299b1aa8d6SNeel NatuGuest memory must be wired using the
3309b1aa8d6SNeel Natu.Fl S
3319b1aa8d6SNeel Natuoption when a pass-through device is configured.
3329b1aa8d6SNeel Natu.Pp
333b13e60daSPeter GrehanThe host device must have been reserved at boot-time using the
334b13e60daSPeter Grehan.Va pptdev
335b13e60daSPeter Grehanloader variable as described in
336b13e60daSPeter Grehan.Xr vmm 4 .
3375121b6ccSRoman Bogorodskiy.Pp
3385121b6ccSRoman BogorodskiyVirtio console devices:
3395121b6ccSRoman Bogorodskiy.Bl -tag -width 10n
3405121b6ccSRoman Bogorodskiy.It Li port1= Ns Pa /path/to/port1.sock Ns ,anotherport= Ns Pa ...
3415121b6ccSRoman BogorodskiyA maximum of 16 ports per device can be created.
3425121b6ccSRoman BogorodskiyEvery port is named and corresponds to a Unix domain socket created by
3435121b6ccSRoman Bogorodskiy.Nm .
3445121b6ccSRoman Bogorodskiy.Nm
3455121b6ccSRoman Bogorodskiyaccepts at most one connection per port at a time.
3465121b6ccSRoman Bogorodskiy.Pp
3475121b6ccSRoman BogorodskiyLimitations:
3485121b6ccSRoman Bogorodskiy.Bl -bullet -offset 2n
3495121b6ccSRoman Bogorodskiy.It
3505121b6ccSRoman BogorodskiyDue to lack of destructors in
3515121b6ccSRoman Bogorodskiy.Nm ,
3525121b6ccSRoman Bogorodskiysockets on the filesystem must be cleaned up manually after
3535121b6ccSRoman Bogorodskiy.Nm
3545121b6ccSRoman Bogorodskiyexits.
3555121b6ccSRoman Bogorodskiy.It
3565121b6ccSRoman BogorodskiyThere is no way to use the "console port" feature, nor the console port
3570ee3a4b4SRoman Bogorodskiyresize at present.
3585121b6ccSRoman Bogorodskiy.It
3590ee3a4b4SRoman BogorodskiyEmergency write is advertised, but no-op at present.
3605121b6ccSRoman Bogorodskiy.El
3615121b6ccSRoman Bogorodskiy.El
3626c87a2c0SGleb Smirnoff.Pp
3635c3ec676SGleb SmirnoffFramebuffer devices:
3645c3ec676SGleb Smirnoff.Bl -tag -width 10n
365f4d34383SMarcelo Araujo.It Oo rfb= Ns Oo Ar IP: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= Ns Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc Ns Oo ,password= Ns Ar password Oc
3665c3ec676SGleb Smirnoff.Bl -tag -width 8n
3675c3ec676SGleb Smirnoff.It Ar IP:port
3685c3ec676SGleb SmirnoffAn
3695c3ec676SGleb Smirnoff.Ar IP
3705c3ec676SGleb Smirnoffaddress and a
3715c3ec676SGleb Smirnoff.Ar port
3725c3ec676SGleb SmirnoffVNC should listen on.
3736c87a2c0SGleb SmirnoffThe default is to listen on localhost IPv4 address and default VNC port 5900.
3745c3ec676SGleb SmirnoffListening on an IPv6 address is not supported.
3755c3ec676SGleb Smirnoff.It Ar width No and Ar height
3765c3ec676SGleb SmirnoffA display resolution, width and height, respectively.
3775c3ec676SGleb SmirnoffIf not specified, a default resolution of 1024x768 pixels will be used.
3785c3ec676SGleb SmirnoffMinimal supported resolution is 640x480 pixels,
3795c3ec676SGleb Smirnoffand maximum is 1920x1200 pixels.
3805c3ec676SGleb Smirnoff.It Ar vgaconf
3815c3ec676SGleb SmirnoffPossible values for this option are
3825c3ec676SGleb Smirnoff.Dq io
3835c3ec676SGleb Smirnoff(default),
3845c3ec676SGleb Smirnoff.Dq on
3855c3ec676SGleb Smirnoff, and
3865c3ec676SGleb Smirnoff.Dq off .
3875c3ec676SGleb SmirnoffPCI graphics cards have a dual personality in that they are
3885c3ec676SGleb Smirnoffstandard PCI devices with BAR addressing, but may also
3895c3ec676SGleb Smirnoffimplicitly decode legacy VGA I/O space
3905c3ec676SGleb Smirnoff.Pq Ad 0x3c0-3df
3915c3ec676SGleb Smirnoffand memory space
3925c3ec676SGleb Smirnoff.Pq 64KB at Ad 0xA0000 .
3935c3ec676SGleb SmirnoffThe default
3945c3ec676SGleb Smirnoff.Dq io
3955c3ec676SGleb Smirnoffoption should be used for guests that attempt to issue BIOS
3965c3ec676SGleb Smirnoffcalls which result in I/O port queries, and fail to boot if I/O decode is disabled.
3975c3ec676SGleb Smirnoff.Pp
3985c3ec676SGleb SmirnoffThe
3995c3ec676SGleb Smirnoff.Dq on
4005c3ec676SGleb Smirnoffoption should be used along with the CSM BIOS capability in UEFI
4015c3ec676SGleb Smirnoffto boot traditional BIOS guests that require the legacy VGA I/O and
4025c3ec676SGleb Smirnoffmemory regions to be available.
4035c3ec676SGleb Smirnoff.Pp
4045c3ec676SGleb SmirnoffThe
4055c3ec676SGleb Smirnoff.Dq off
4065c3ec676SGleb Smirnoffoption should be used for the UEFI guests that assume that
4075c3ec676SGleb SmirnoffVGA adapter is present if they detect the I/O ports.
4085c3ec676SGleb SmirnoffAn example of such a guest is
4095c3ec676SGleb Smirnoff.Ox
4105c3ec676SGleb Smirnoffin UEFI mode.
4115c3ec676SGleb Smirnoff.Pp
4125c3ec676SGleb SmirnoffPlease refer to the
4135c3ec676SGleb Smirnoff.Nm
4145c3ec676SGleb Smirnoff.Fx
4155c3ec676SGleb Smirnoffwiki page
4165c3ec676SGleb Smirnoff.Pq Lk https://wiki.freebsd.org/bhyve
4175c3ec676SGleb Smirnofffor configuration notes of particular guests.
4185c3ec676SGleb Smirnoff.It wait
4195c3ec676SGleb SmirnoffInstruct
4205c3ec676SGleb Smirnoff.Nm
4215c3ec676SGleb Smirnoffto only boot upon the initiation of a VNC connection, simplifying the installation
4225c3ec676SGleb Smirnoffof operating systems that require immediate keyboard input.
4235c3ec676SGleb SmirnoffThis can be removed for post-installation use.
424f4d34383SMarcelo Araujo.It password
425f4d34383SMarcelo AraujoThis type of authentication is known to be cryptographically weak and is not
426f4d34383SMarcelo Araujointended for use on untrusted networks.
427f4d34383SMarcelo AraujoMany implementations will want to use stronger security, such as running
428f4d34383SMarcelo Araujothe session over an encrypted channel provided by IPsec or SSH.
4295c3ec676SGleb Smirnoff.El
4306c87a2c0SGleb Smirnoff.El
4316c87a2c0SGleb Smirnoff.Pp
4325c3ec676SGleb SmirnoffxHCI USB devices:
4335c3ec676SGleb Smirnoff.Bl -tag -width 10n
4345c3ec676SGleb Smirnoff.It Li tablet
4355c3ec676SGleb SmirnoffA USB tablet device which provides precise cursor synchronization
4365c3ec676SGleb Smirnoffwhen using VNC.
4376c87a2c0SGleb Smirnoff.El
438*c066c68cSMarcelo Araujo.Pp
439*c066c68cSMarcelo AraujoNVMe devices:
440*c066c68cSMarcelo Araujo.Bl -tag -width 10n
441*c066c68cSMarcelo Araujo.It Li devpath
442*c066c68cSMarcelo AraujoAccepted device paths are:
443*c066c68cSMarcelo Araujo.Ar /dev/blockdev
444*c066c68cSMarcelo Araujoor
445*c066c68cSMarcelo Araujo.Ar /path/to/image
446*c066c68cSMarcelo Araujoor
447*c066c68cSMarcelo Araujo.Ar ram=size_in_MiB .
448*c066c68cSMarcelo Araujo.It Li maxq
449*c066c68cSMarcelo AraujoMax number of queues.
450*c066c68cSMarcelo Araujo.It Li qsz
451*c066c68cSMarcelo AraujoMax elements in each queue.
452*c066c68cSMarcelo Araujo.It Li ioslots
453*c066c68cSMarcelo AraujoMax number of concurrent I/O requests.
454*c066c68cSMarcelo Araujo.It Li sectsz
455*c066c68cSMarcelo AraujoSector size (defaults to blockif sector size).
456*c066c68cSMarcelo Araujo.It Li ser
457*c066c68cSMarcelo AraujoSerial number with maximum 20 characters.
458*c066c68cSMarcelo Araujo.El
459b13e60daSPeter Grehan.El
4609b1aa8d6SNeel Natu.It Fl S
4619b1aa8d6SNeel NatuWire guest memory.
462c9747678SNeel Natu.It Fl u
463c9747678SNeel NatuRTC keeps UTC time.
4645749449dSJohn Baldwin.It Fl U Ar uuid
4655749449dSJohn BaldwinSet the universally unique identifier
4665749449dSJohn Baldwin.Pq UUID
4675749449dSJohn Baldwinin the guest's System Management BIOS System Information structure.
4685749449dSJohn BaldwinBy default a UUID is generated from the host's hostname and
4695749449dSJohn Baldwin.Ar vmname .
470851d84f1SNeel Natu.It Fl w
47184fe889cSChristian BruefferIgnore accesses to unimplemented Model Specific Registers (MSRs).
47284fe889cSChristian BruefferThis is intended for debug purposes.
473cde1f5b8SJohn Baldwin.It Fl W
474cde1f5b8SJohn BaldwinForce virtio PCI device emulations to use MSI interrupts instead of MSI-X
475cde1f5b8SJohn Baldwininterrupts.
4769777ca20SNeel Natu.It Fl x
4779777ca20SNeel NatuThe guest's local APIC is configured in x2APIC mode.
478b100acf2SNeel Natu.It Fl Y
479b100acf2SNeel NatuDisable MPtable generation.
480b13e60daSPeter Grehan.It Ar vmname
481b13e60daSPeter GrehanAlphanumeric name of the guest.
482b13e60daSPeter GrehanThis should be the same as that created by
483b13e60daSPeter Grehan.Xr bhyveload 8 .
484b13e60daSPeter Grehan.El
485cd377eb3SJohn Baldwin.Sh DEBUG SERVER
486cd377eb3SJohn BaldwinThe current debug server provides limited support for debuggers.
487cd377eb3SJohn Baldwin.Ss Registers
488cd377eb3SJohn BaldwinEach virtual CPU is exposed to the debugger as a thread.
489cd377eb3SJohn Baldwin.Pp
490cd377eb3SJohn BaldwinGeneral purpose registers can be queried for each virtual CPU, but other
491cd377eb3SJohn Baldwinregisters such as floating-point and system registers cannot be queried.
492cd377eb3SJohn Baldwin.Ss Memory
493cd377eb3SJohn BaldwinMemory (including memory mapped I/O regions) can be read by the debugger,
494cd377eb3SJohn Baldwinbut not written.  Memory operations use virtual addresses that are resolved
495cd377eb3SJohn Baldwinto physical addresses via the current virtual CPU's active address translation.
496cd377eb3SJohn Baldwin.Ss Control
497cd377eb3SJohn BaldwinThe running guest can be interrupted by the debugger at any time
498cd377eb3SJohn Baldwin.Pq for example, by pressing Ctrl-C in the debugger .
499cd377eb3SJohn Baldwin.Pp
500cd377eb3SJohn BaldwinSingle stepping is only supported on Intel CPUs supporting the MTRAP VM exit.
501cd377eb3SJohn Baldwin.Pp
502cd377eb3SJohn BaldwinBreakpoints are not supported.
503c2202d41SRoman Bogorodskiy.Sh SIGNAL HANDLING
504c2202d41SRoman Bogorodskiy.Nm
505c2202d41SRoman Bogorodskiydeals with the following signals:
506c2202d41SRoman Bogorodskiy.Pp
507c2202d41SRoman Bogorodskiy.Bl -tag -width indent -compact
508c2202d41SRoman Bogorodskiy.It SIGTERM
509c2202d41SRoman BogorodskiyTrigger ACPI poweroff for a VM
510c2202d41SRoman Bogorodskiy.El
511c2202d41SRoman Bogorodskiy.Sh EXIT STATUS
512c2202d41SRoman BogorodskiyExit status indicates how the VM was terminated:
513c2202d41SRoman Bogorodskiy.Pp
514c2202d41SRoman Bogorodskiy.Bl -tag -width indent -compact
515c2202d41SRoman Bogorodskiy.It 0
516c2202d41SRoman Bogorodskiyrebooted
517c2202d41SRoman Bogorodskiy.It 1
518c2202d41SRoman Bogorodskiypowered off
519c2202d41SRoman Bogorodskiy.It 2
520c2202d41SRoman Bogorodskiyhalted
521c2202d41SRoman Bogorodskiy.It 3
522c2202d41SRoman Bogorodskiytriple fault
523c2202d41SRoman Bogorodskiy.El
524b13e60daSPeter Grehan.Sh EXAMPLES
5255c3ec676SGleb SmirnoffIf not using a boot ROM, the guest operating system must have been loaded with
52684fe889cSChristian Brueffer.Xr bhyveload 8
527b13e60daSPeter Grehanor a similar boot loader before
528b13e60daSPeter Grehan.Xr bhyve 4
529b13e60daSPeter Grehancan be run.
5305c3ec676SGleb SmirnoffOtherwise, the boot loader is not needed.
531b13e60daSPeter Grehan.Pp
532b13e60daSPeter GrehanTo run a virtual machine with 1GB of memory, two virtual CPUs, a virtio
533b13e60daSPeter Grehanblock device backed by the
534b13e60daSPeter Grehan.Pa /my/image
535b13e60daSPeter Grehanfilesystem image, and a serial port for the console:
536b13e60daSPeter Grehan.Bd -literal -offset indent
537b13e60daSPeter Grehanbhyve -c 2 -s 0,hostbridge -s 1,lpc -s 2,virtio-blk,/my/image \\
538b13e60daSPeter Grehan  -l com1,stdio -A -H -P -m 1G vm1
539b13e60daSPeter Grehan.Ed
540b13e60daSPeter Grehan.Pp
541b13e60daSPeter GrehanRun a 24GB single-CPU virtual machine with three network ports, one of which
542b13e60daSPeter Grehanhas a MAC address specified:
543b13e60daSPeter Grehan.Bd -literal -offset indent
544b13e60daSPeter Grehanbhyve -s 0,hostbridge -s 1,lpc -s 2:0,virtio-net,tap0 \\
545b13e60daSPeter Grehan  -s 2:1,virtio-net,tap1 \\
546b13e60daSPeter Grehan  -s 2:2,virtio-net,tap2,mac=00:be:fa:76:45:00 \\
547b13e60daSPeter Grehan  -s 3,virtio-blk,/my/image -l com1,stdio \\
548b13e60daSPeter Grehan  -A -H -P -m 24G bigvm
549b13e60daSPeter Grehan.Ed
550b13e60daSPeter Grehan.Pp
551b13e60daSPeter GrehanRun an 8GB quad-CPU virtual machine with 8 AHCI SATA disks, an AHCI ATAPI
552b13e60daSPeter GrehanCD-ROM, a single virtio network port, an AMD hostbridge, and the console
553b13e60daSPeter Grehanport connected to an
554b13e60daSPeter Grehan.Xr nmdm 4
55584fe889cSChristian Brueffernull-modem device.
556b13e60daSPeter Grehan.Bd -literal -offset indent
557a7ab1463SAlexander Motinbhyve -c 4 \\
558b13e60daSPeter Grehan  -s 0,amd_hostbridge -s 1,lpc \\
559098f5155SAlexander Motin  -s 1:0,ahci,hd:/images/disk.1,hd:/images/disk.2,\\
560098f5155SAlexander Motinhd:/images/disk.3,hd:/images/disk.4,\\
561098f5155SAlexander Motinhd:/images/disk.5,hd:/images/disk.6,\\
562098f5155SAlexander Motinhd:/images/disk.7,hd:/images/disk.8,\\
563098f5155SAlexander Motincd:/images/install.iso \\
564b13e60daSPeter Grehan  -s 3,virtio-net,tap0 \\
565b13e60daSPeter Grehan  -l com1,/dev/nmdm0A \\
566b13e60daSPeter Grehan  -A -H -P -m 8G
567b13e60daSPeter Grehan.Ed
5685c3ec676SGleb Smirnoff.Pp
5695c3ec676SGleb SmirnoffRun a UEFI virtual machine with a display resolution of 800 by 600 pixels
5705c3ec676SGleb Smirnoffthat can be accessed via VNC at: 0.0.0.0:5900.
5715c3ec676SGleb Smirnoff.Bd -literal -offset indent
5725c3ec676SGleb Smirnoffbhyve -c 2 -m 4G -w -H \\
5735c3ec676SGleb Smirnoff  -s 0,hostbridge \\
5745c3ec676SGleb Smirnoff  -s 3,ahci-cd,/path/to/uefi-OS-install.iso \\
5755c3ec676SGleb Smirnoff  -s 4,ahci-hd,disk.img \\
5765c3ec676SGleb Smirnoff  -s 5,virtio-net,tap0 \\
5775c3ec676SGleb Smirnoff  -s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \\
5785c3ec676SGleb Smirnoff  -s 30,xhci,tablet \\
5795c3ec676SGleb Smirnoff  -s 31,lpc -l com1,stdio \\
5805c3ec676SGleb Smirnoff  -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\
5815c3ec676SGleb Smirnoff   uefivm
5825c3ec676SGleb Smirnoff.Ed
583b13e60daSPeter Grehan.Sh SEE ALSO
584b13e60daSPeter Grehan.Xr bhyve 4 ,
585b13e60daSPeter Grehan.Xr nmdm 4 ,
586b13e60daSPeter Grehan.Xr vmm 4 ,
587b13e60daSPeter Grehan.Xr ethers 5 ,
58805f7cd8bSJoel Dahl.Xr bhyvectl 8 ,
58905f7cd8bSJoel Dahl.Xr bhyveload 8
590b13e60daSPeter Grehan.Sh HISTORY
591b13e60daSPeter Grehan.Nm
592b13e60daSPeter Grehanfirst appeared in
593b13e60daSPeter Grehan.Fx 10.0 .
594b13e60daSPeter Grehan.Sh AUTHORS
59501c2b8acSBaptiste Daroussin.An Neel Natu Aq Mt neel@freebsd.org
59601c2b8acSBaptiste Daroussin.An Peter Grehan Aq Mt grehan@freebsd.org
597