xref: /freebsd/usr.sbin/bhyve/bhyve.8 (revision b30a7e5418be5c5d27ac967f5ce99461ab79c37c)
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.\"
25*b30a7e54SChris Moerz.Dd April 26, 2024
26b13e60daSPeter Grehan.Dt BHYVE 8
27b13e60daSPeter Grehan.Os
28b13e60daSPeter Grehan.Sh NAME
29b13e60daSPeter Grehan.Nm bhyve
30b13e60daSPeter Grehan.Nd "run a guest operating system inside a virtual machine"
31b13e60daSPeter Grehan.Sh SYNOPSIS
32b13e60daSPeter Grehan.Nm
3310758471SMark Johnston.Op Fl aCDeHhPSuWwxY
3401d822d3SRodney W. Grimes.Oo
3577d208a3SMateusz Piotrowski.Sm off
3677d208a3SMateusz Piotrowski.Fl c\~
3701d822d3SRodney W. Grimes.Oo
3877d208a3SMateusz Piotrowski.Op Cm cpus=
3977d208a3SMateusz Piotrowski.Ar numcpus
4001d822d3SRodney W. Grimes.Oc
4177d208a3SMateusz Piotrowski.Op Cm ,sockets= Ar n
4277d208a3SMateusz Piotrowski.Op Cm ,cores= Ar n
4377d208a3SMateusz Piotrowski.Op Cm ,threads= Ar n
4477d208a3SMateusz Piotrowski.Oc
4577d208a3SMateusz Piotrowski.Sm on
46ca14781cSCorvin Köhne.Oo Fl f
47ca14781cSCorvin Köhne.Sm off
48ca14781cSCorvin Köhne.Ar name Cm \&,
49ca14781cSCorvin Köhne.Oo
50ca14781cSCorvin Köhne.Cm string No | Cm file
51ca14781cSCorvin Köhne.Oc
52ca14781cSCorvin Köhne.Cm \&= Ar data
53ca14781cSCorvin Köhne.Sm on
54ca14781cSCorvin Köhne.Oc
55775f6f45SMateusz Piotrowski.Oo
56b70b050aSJohn Baldwin.Sm off
57775f6f45SMateusz Piotrowski.Fl G\~
58b70b050aSJohn Baldwin.Oo Ar w Oc
59775f6f45SMateusz Piotrowski.Oo Ar bind_address Cm \&: Oc
60b70b050aSJohn Baldwin.Ar port
61b70b050aSJohn Baldwin.Sm on
62b70b050aSJohn Baldwin.Oc
63f656df58SMateusz Piotrowski.Op Fl k Ar config_file
6419eaa01bSMichael Reifenberger.Op Fl K Ar layout
6577d208a3SMateusz Piotrowski.Oo Fl l
6677d208a3SMateusz Piotrowski.Sm off
67bfe40b69SMateusz Piotrowski.Ar lpcdev Op Cm \&, Ar conf
6877d208a3SMateusz Piotrowski.Sm on
6977d208a3SMateusz Piotrowski.Oc
7077d208a3SMateusz Piotrowski.Sm off
71775f6f45SMateusz Piotrowski.Oo Fl m\~
7277d208a3SMateusz Piotrowski.Ar memsize
7377d208a3SMateusz Piotrowski.Oo
748d9fefe6SMateusz Piotrowski.Cm K | Cm k | Cm M | Cm m | Cm G | Cm g | Cm T | Cm t
7577d208a3SMateusz Piotrowski.Oc
7677d208a3SMateusz Piotrowski.Sm on
7777d208a3SMateusz Piotrowski.Oc
78621b5090SJohn Baldwin.Op Fl o Ar var Ns Cm = Ns Ar value
7977d208a3SMateusz Piotrowski.Op Fl p Ar vcpu Ns Cm \&: Ns Ar hostcpu
80483d953aSJohn Baldwin.Op Fl r Ar file
8177d208a3SMateusz Piotrowski.Sm off
82bfe40b69SMateusz Piotrowski.Oo Fl s\~
83bfe40b69SMateusz Piotrowski.Ar slot Cm \&, Ar emulation Op Cm \&, Ar conf
8477d208a3SMateusz Piotrowski.Sm on
8577d208a3SMateusz Piotrowski.Oc
865749449dSJohn Baldwin.Op Fl U Ar uuid
87b13e60daSPeter Grehan.Ar vmname
88bfe40b69SMateusz Piotrowski.Nm
89bfe40b69SMateusz Piotrowski.Fl l Cm help
90bfe40b69SMateusz Piotrowski.Nm
91bfe40b69SMateusz Piotrowski.Fl s Cm help
92b13e60daSPeter Grehan.Sh DESCRIPTION
93b13e60daSPeter Grehan.Nm
947fca1ad5SGlen Barberis a hypervisor that runs guest operating systems inside a
95b13e60daSPeter Grehanvirtual machine.
9671b2ba90SMark JohnstonIt can run guests on amd64 and arm64 platforms with suitable hardware support.
97b13e60daSPeter Grehan.Pp
98b13e60daSPeter GrehanParameters such as the number of virtual CPUs, amount of guest memory, and
99b13e60daSPeter GrehanI/O connectivity can be specified with command-line parameters.
100b13e60daSPeter Grehan.Pp
10171b2ba90SMark Johnston.Nm
10271b2ba90SMark Johnstonis typically used with a boot ROM that can load the guest operating system.
10371b2ba90SMark JohnstonOn arm64 platforms, this is currently required.
1045c3ec676SGleb SmirnoffIf not using a boot ROM, the guest operating system must be loaded with
10584fe889cSChristian Brueffer.Xr bhyveload 8
106b13e60daSPeter Grehanor a similar boot loader before running
1075c3ec676SGleb Smirnoff.Nm ,
10871b2ba90SMark Johnstonotherwise.
10971b2ba90SMark JohnstonOn amd64, the
11071b2ba90SMark Johnston.Pa edk2-bhyve
11171b2ba90SMark Johnstonpackage provides a UEFI firmware that can be used to boot the guest;
11271b2ba90SMark Johnstonon arm64 the
11371b2ba90SMark Johnston.Pa u-boot-bhyve-arm64
11471b2ba90SMark Johnstonpackage provides a U-Boot image that can be used to boot the guest.
115b13e60daSPeter Grehan.Pp
116b13e60daSPeter Grehan.Nm
117b13e60daSPeter Grehanruns until the guest operating system reboots or an unhandled hypervisor
118b13e60daSPeter Grehanexit is detected.
119b13e60daSPeter Grehan.Sh OPTIONS
120b13e60daSPeter Grehan.Bl -tag -width 10n
121ccb1c87aSMateusz Piotrowski.It Fl a
122ccb1c87aSMateusz PiotrowskiThe guest's local APIC is configured in xAPIC mode.
12371b2ba90SMark JohnstonThis option only applies to the amd64 platform.
12471b2ba90SMark JohnstonxAPIC mode is the default setting so this option is redundant.
125ccb1c87aSMateusz PiotrowskiIt will be deprecated in a future version.
126ccb1c87aSMateusz Piotrowski.It Fl C
12771b2ba90SMark JohnstonInclude guest memory in core files.
12801d822d3SRodney W. Grimes.It Fl c Op Ar setting ...
12901d822d3SRodney W. GrimesNumber of guest virtual CPUs
13001d822d3SRodney W. Grimesand/or the CPU topology.
13101d822d3SRodney W. GrimesThe default value for each of
13201d822d3SRodney W. Grimes.Ar numcpus ,
13301d822d3SRodney W. Grimes.Ar sockets ,
13401d822d3SRodney W. Grimes.Ar cores ,
13501d822d3SRodney W. Grimesand
13601d822d3SRodney W. Grimes.Ar threads
13701d822d3SRodney W. Grimesis 1.
13801d822d3SRodney W. GrimesIf
13901d822d3SRodney W. Grimes.Ar numcpus
14001d822d3SRodney W. Grimesis not specified then it will be calculated from the other arguments.
14101d822d3SRodney W. GrimesThe topology must be consistent in that the
14201d822d3SRodney W. Grimes.Ar numcpus
14301d822d3SRodney W. Grimesmust equal the product of
14401d822d3SRodney W. Grimes.Ar sockets ,
14501d822d3SRodney W. Grimes.Ar cores ,
14601d822d3SRodney W. Grimesand
14701d822d3SRodney W. Grimes.Ar threads .
14801d822d3SRodney W. GrimesIf a
14901d822d3SRodney W. Grimes.Ar setting
15001d822d3SRodney W. Grimesis specified more than once the last one has precedence.
151da202b0fSYuri Pankov.Pp
152da202b0fSYuri PankovThe maximum number of virtual CPUs defaults to the number of active
153da202b0fSYuri Pankovphysical CPUs in the system available via the
154da202b0fSYuri Pankov.Va hw.vmm.maxcpu
155da202b0fSYuri Pankov.Xr sysctl 8
156da202b0fSYuri Pankovvariable.
157da202b0fSYuri PankovThe limit can be adjusted via the
158da202b0fSYuri Pankov.Va hw.vmm.maxcpu
159da202b0fSYuri Pankovloader tunable.
1600a1016f9SPawel Biernacki.It Fl D
1610a1016f9SPawel BiernackiDestroy the VM on guest initiated power-off.
162cde1f5b8SJohn Baldwin.It Fl e
163cde1f5b8SJohn BaldwinForce
164cde1f5b8SJohn Baldwin.Nm
165cde1f5b8SJohn Baldwinto exit when a guest issues an access to an I/O port that is not emulated.
16671b2ba90SMark JohnstonThis is intended for debug purposes and only applies to the amd64 platform.
167ca14781cSCorvin Köhne.It Fl f Ar name Ns Cm \&, Ns Oo Cm string Ns No | Ns Cm file Ns Oc Ns Cm \&= Ns Ar data
168ca14781cSCorvin KöhneAdd a fw_cfg file
169ca14781cSCorvin Köhne.Ar name
170ca14781cSCorvin Köhneto the fw_cfg interface.
171ca14781cSCorvin KöhneIf a
172ca14781cSCorvin Köhne.Cm string
173ca14781cSCorvin Köhneis specified, the fw_cfg file contains the string as data.
174ca14781cSCorvin KöhneIf a
175ca14781cSCorvin Köhne.Cm file
176ca14781cSCorvin Köhneis specified, bhyve reads the file and adds the file content as fw_cfg data.
1772cdff991SMariusz Zaborski.It Fl G Xo
1782cdff991SMariusz Zaborski.Sm off
1792cdff991SMariusz Zaborski.Oo Ar w Oc
180775f6f45SMateusz Piotrowski.Oo Ar bind_address Cm \&: Oc
1812cdff991SMariusz Zaborski.Ar port
1822cdff991SMariusz Zaborski.Sm on
1832cdff991SMariusz Zaborski.Xc
184cd377eb3SJohn BaldwinStart a debug server that uses the GDB protocol to export guest state to a
185cd377eb3SJohn Baldwindebugger.
186cd377eb3SJohn BaldwinAn IPv4 TCP socket will be bound to the supplied
1872cdff991SMariusz Zaborski.Ar bind_address
1882cdff991SMariusz Zaborskiand
189cd377eb3SJohn Baldwin.Ar port
190cd377eb3SJohn Baldwinto listen for debugger connections.
191cd377eb3SJohn BaldwinOnly a single debugger may be attached to the debug server at a time.
1922cdff991SMariusz ZaborskiIf the option begins with
193cd377eb3SJohn Baldwin.Sq w ,
194cd377eb3SJohn Baldwin.Nm
195cd377eb3SJohn Baldwinwill pause execution at the first instruction waiting for a debugger to attach.
196cde1f5b8SJohn Baldwin.It Fl H
197cde1f5b8SJohn BaldwinYield the virtual CPU thread when a HLT instruction is detected.
198cde1f5b8SJohn BaldwinIf this option is not specified, virtual CPUs will use 100% of a host CPU.
19971b2ba90SMark JohnstonThis option applies only to the amd64 platform.
200ccb1c87aSMateusz Piotrowski.It Fl h
201ccb1c87aSMateusz PiotrowskiPrint help message and exit.
202f656df58SMateusz Piotrowski.It Fl k Ar config_file
203621b5090SJohn BaldwinSet configuration variables from a simple, key-value config file.
204621b5090SJohn BaldwinEach line of the config file is expected to consist of a config variable
205621b5090SJohn Baldwinname, an equals sign
206621b5090SJohn Baldwin.Pq Sq = ,
207621b5090SJohn Baldwinand a value.
208621b5090SJohn BaldwinNo spaces are permitted between the variable name, equals sign, or
209621b5090SJohn Baldwinvalue.
210621b5090SJohn BaldwinBlank lines and lines starting with
211621b5090SJohn Baldwin.Sq #
212621b5090SJohn Baldwinare ignored.
213f656df58SMateusz PiotrowskiSee
214f656df58SMateusz Piotrowski.Xr bhyve_config 5
215f656df58SMateusz Piotrowskifor more details.
21672f1e31fSKonstantin Belousov.It Fl K Ar layout
21772f1e31fSKonstantin BelousovSpecify the keyboard layout.
21872f1e31fSKonstantin BelousovThe value that can be specified sets the file name in
21972f1e31fSKonstantin Belousov.Ar /usr/share/bhyve/kbdlayout .
22072f1e31fSKonstantin BelousovThis specification only works when loaded with UEFI mode for VNC.
22172f1e31fSKonstantin BelousovWhen using a VNC client that supports QEMU Extended Key Event Message (e.g.
22272f1e31fSKonstantin BelousovTigerVNC), this option isn't needed.
22372f1e31fSKonstantin BelousovWhen using a VNC client that doesn't support QEMU Extended Key Event Message
22472f1e31fSKonstantin Belousov(e.g. tightVNC), the layout defaults to the US keyboard unless specified
22572f1e31fSKonstantin Belousovotherwise.
2264c08b978SMateusz Piotrowski.It Fl l Cm help
2274c08b978SMateusz PiotrowskiPrint a list of supported LPC devices.
2284c08b978SMateusz Piotrowski.It Fl l Ar lpcdev Ns Op Cm \&, Ns Ar conf
229cde1f5b8SJohn BaldwinAllow devices behind the LPC PCI-ISA bridge to be configured.
2309b1aa8d6SNeel NatuThe only supported devices are the TTY-class devices
2314c08b978SMateusz Piotrowski.Cm com1 , com2 , com3 ,
2324c08b978SMateusz Piotrowskiand
2334c08b978SMateusz Piotrowski.Cm com4 ,
23467c26eb2SCorvin Köhnethe TPM module
23567c26eb2SCorvin Köhne.Cm tpm ,
2362f40fc6fSPeter Grehanthe boot ROM device
2374c08b978SMateusz Piotrowski.Cm bootrom ,
238d85147f3SCorvin Köhnethe
239d85147f3SCorvin Köhne.Cm fwcfg
240d85147f3SCorvin Köhnetype and the debug/test device
2414c08b978SMateusz Piotrowski.Cm pc-testdev .
2421aa56353SMarcelo Araujo.Pp
2434c08b978SMateusz PiotrowskiThe possible values for the
2444c08b978SMateusz Piotrowski.Ar conf
2454c08b978SMateusz Piotrowskiargument are listed in the
2464c08b978SMateusz Piotrowski.Fl s
2474c08b978SMateusz Piotrowskiflag description.
24871b2ba90SMark Johnston.Pp
24971b2ba90SMark JohnstonThis option applies only to the amd64 platform.
25071b2ba90SMark JohnstonOn arm64, the console and boot ROM devices are configured using the
25171b2ba90SMark Johnstonmore generic
25271b2ba90SMark Johnston.Fl o
25371b2ba90SMark Johnstonoption.
2547e0cb3dfSMateusz Piotrowski.It Xo
2557e0cb3dfSMateusz Piotrowski.Fl m Ar memsize Ns Oo
2567e0cb3dfSMateusz Piotrowski.Sm off
2577e0cb3dfSMateusz Piotrowski.Cm K | k | M | m | G | g | T | t
2587e0cb3dfSMateusz Piotrowski.Sm on
2597e0cb3dfSMateusz Piotrowski.Oc
2607e0cb3dfSMateusz Piotrowski.Xc
26159a35b7cSKonstantin BelousovSet the guest physical memory size.
262cde1f5b8SJohn BaldwinThis must be the same size that was given to
263cde1f5b8SJohn Baldwin.Xr bhyveload 8 .
264cde1f5b8SJohn Baldwin.Pp
2657e0cb3dfSMateusz PiotrowskiThe size argument may be suffixed with one of
2667e0cb3dfSMateusz Piotrowski.Cm K , M , G
2677e0cb3dfSMateusz Piotrowskior
2687e0cb3dfSMateusz Piotrowski.Cm T
2697e0cb3dfSMateusz Piotrowski(either upper or lower case)
2707e0cb3dfSMateusz Piotrowskito indicate a multiple of kilobytes, megabytes, gigabytes, or terabytes.
271cde1f5b8SJohn BaldwinIf no suffix is given, the value is assumed to be in megabytes.
2726ee52c65SRoman Bogorodskiy.Pp
2737e0cb3dfSMateusz PiotrowskiThe default is 256M.
274621b5090SJohn Baldwin.It Fl o Ar var Ns Cm = Ns Ar value
275621b5090SJohn BaldwinSet the configuration variable
276621b5090SJohn Baldwin.Ar var
277621b5090SJohn Baldwinto
278621b5090SJohn Baldwin.Ar value .
27971b2ba90SMark JohnstonSee
28071b2ba90SMark Johnston.Xr bhyve_config 5
28171b2ba90SMark Johnstonfor configuration options.
282ccb1c87aSMateusz Piotrowski.It Fl P
283ccb1c87aSMateusz PiotrowskiForce the guest virtual CPU to exit when a PAUSE instruction is detected.
28471b2ba90SMark JohnstonThis option applies only to the amd64 platform.
28590df5437SMateusz Piotrowski.It Fl p Ar vcpu Ns Cm \& : Ns Ar hostcpu
2869b6155a2SNeel NatuPin guest's virtual CPU
2879b6155a2SNeel Natu.Em vcpu
2889b6155a2SNeel Natuto
2899b6155a2SNeel Natu.Em hostcpu .
2908120190fSFelix JohnsonHost CPUs and guest virtual CPUs are numbered starting from 0.
2918120190fSFelix JohnsonA
2928120190fSFelix Johnson.Fl p
2938120190fSFelix Johnsonoption is required for every guest vCPU to be pinned.
2948120190fSFelix JohnsonTo map a 4 vCPU guest to host CPUs 12-15:
2958120190fSFelix Johnson.Bd -literal
2968120190fSFelix Johnson-p 0:12 -p 1:13 -p 2:14 -p 3:15
2978120190fSFelix Johnson.Ed
298483d953aSJohn Baldwin.It Fl r Ar file
299483d953aSJohn BaldwinResume a guest from a snapshot.
300483d953aSJohn BaldwinThe guest memory contents are restored from
301483d953aSJohn Baldwin.Ar file ,
302483d953aSJohn Baldwinand the guest device and vCPU state are restored from the file
303483d953aSJohn Baldwin.Dq Ar file Ns .kern .
304483d953aSJohn Baldwin.Pp
305a3b3e89fSBenedict ReuschlingNote that the current snapshot file format requires that the
306a3b3e89fSBenedict Reuschlingconfiguration of devices in the new VM match the VM from which the
307a3b3e89fSBenedict Reuschlingsnapshot was taken by specifying the same
308b24eea8cSMateusz Piotrowski.Fl s
309483d953aSJohn Baldwinand
310b24eea8cSMateusz Piotrowski.Fl l
311483d953aSJohn Baldwinoptions.
312483d953aSJohn BaldwinThe count of vCPUs and memory configuration are read from the snapshot.
313ccb1c87aSMateusz Piotrowski.It Fl S
314ccb1c87aSMateusz PiotrowskiWire guest memory.
315449f0e48SMateusz Piotrowski.It Fl s Cm help
316449f0e48SMateusz PiotrowskiPrint a list of supported PCI devices.
317449f0e48SMateusz Piotrowski.It Fl s Ar slot Ns Cm \&, Ns Ar emulation Ns Op Cm \&, Ns Ar conf
318b13e60daSPeter GrehanConfigure a virtual PCI slot and function.
319b13e60daSPeter Grehan.Pp
32084fe889cSChristian Brueffer.Nm
321b13e60daSPeter Grehanprovides PCI bus emulation and virtual devices that can be attached to
322b13e60daSPeter Grehanslots on the bus.
323b13e60daSPeter GrehanThere are 32 available slots, with the option of providing up to 8 functions
324b13e60daSPeter Grehanper slot.
325234d8c47SMateusz Piotrowski.Pp
326234d8c47SMateusz PiotrowskiThe
327234d8c47SMateusz Piotrowski.Ar slot
328234d8c47SMateusz Piotrowskican be specified in one of the following formats:
329234d8c47SMateusz Piotrowski.Pp
330234d8c47SMateusz Piotrowski.Bl -bullet -compact
331234d8c47SMateusz Piotrowski.It
332234d8c47SMateusz Piotrowski.Ar pcislot
333234d8c47SMateusz Piotrowski.It
334234d8c47SMateusz Piotrowski.Sm off
335234d8c47SMateusz Piotrowski.Ar pcislot Cm \&: Ar function
336234d8c47SMateusz Piotrowski.Sm on
337234d8c47SMateusz Piotrowski.It
338234d8c47SMateusz Piotrowski.Sm off
339234d8c47SMateusz Piotrowski.Ar bus Cm \&: Ar pcislot Cm \&: Ar function
340234d8c47SMateusz Piotrowski.Sm on
341234d8c47SMateusz Piotrowski.El
342b13e60daSPeter Grehan.Pp
343b13e60daSPeter GrehanThe
344b13e60daSPeter Grehan.Ar pcislot
34584fe889cSChristian Brueffervalue is 0 to 31.
34684fe889cSChristian BruefferThe optional
34784fe889cSChristian Brueffer.Ar function
34884fe889cSChristian Brueffervalue is 0 to 7.
34984fe889cSChristian BruefferThe optional
35006db1b4aSNeel Natu.Ar bus
35106db1b4aSNeel Natuvalue is 0 to 255.
35284fe889cSChristian BruefferIf not specified, the
35384fe889cSChristian Brueffer.Ar function
35484fe889cSChristian Brueffervalue defaults to 0.
35584fe889cSChristian BruefferIf not specified, the
35684fe889cSChristian Brueffer.Ar bus
35784fe889cSChristian Brueffervalue defaults to 0.
358234d8c47SMateusz Piotrowski.Pp
359*b30a7e54SChris MoerzSee
360*b30a7e54SChris Moerz.Sx "PCI EMULATION"
361*b30a7e54SChris Moerzfor available options for the
362234d8c47SMateusz Piotrowski.Ar emulation
363*b30a7e54SChris Moerzargument.
364*b30a7e54SChris Moerz.It Fl U Ar uuid
365*b30a7e54SChris MoerzSet the universally unique identifier
366*b30a7e54SChris Moerz.Pq UUID
367*b30a7e54SChris Moerzin the guest's System Management BIOS System Information structure.
368*b30a7e54SChris MoerzBy default a UUID is generated from the host's hostname and
369*b30a7e54SChris Moerz.Ar vmname .
370*b30a7e54SChris Moerz.It Fl u
371*b30a7e54SChris MoerzRTC keeps UTC time.
372*b30a7e54SChris Moerz.It Fl W
373*b30a7e54SChris MoerzForce virtio PCI device emulations to use MSI interrupts instead of MSI-X
374*b30a7e54SChris Moerzinterrupts.
375*b30a7e54SChris Moerz.It Fl w
376*b30a7e54SChris MoerzIgnore accesses to unimplemented Model Specific Registers (MSRs).
377*b30a7e54SChris MoerzThis is intended for debug purposes.
378*b30a7e54SChris Moerz.It Fl x
379*b30a7e54SChris MoerzThe guest's local APIC is configured in x2APIC mode.
380*b30a7e54SChris MoerzThis option applies only to the amd64 platform.
381*b30a7e54SChris Moerz.It Fl Y
382*b30a7e54SChris MoerzDisable MPtable generation.
383*b30a7e54SChris MoerzThis option applies only to the amd64 platform.
384*b30a7e54SChris Moerz.It Ar vmname
385*b30a7e54SChris MoerzAlphanumeric name of the guest.
386*b30a7e54SChris MoerzThis should be the same as that created by
387*b30a7e54SChris Moerz.Xr bhyveload 8 .
388*b30a7e54SChris Moerz.El
389*b30a7e54SChris Moerz.Sh PCI EMULATION
390*b30a7e54SChris Moerz.Nm
391*b30a7e54SChris Moerzprovides emulation for various PCI devices.
392*b30a7e54SChris MoerzThey are specified by the
393*b30a7e54SChris Moerz.Fl s
394*b30a7e54SChris Moerz.Ar slot,emulation,conf
395*b30a7e54SChris Moerzconfiguration's
396*b30a7e54SChris Moerz.Ar emulation
397*b30a7e54SChris Moerzargument, which can be one of the following:
3987014cb23SMateusz Piotrowski.Bl -tag -width "amd_hostbridge"
3997014cb23SMateusz Piotrowski.It Cm hostbridge
4007014cb23SMateusz PiotrowskiA simple host bridge.
401b13e60daSPeter GrehanThis is usually configured at slot 0, and is required by most guest
402b13e60daSPeter Grehanoperating systems.
4037014cb23SMateusz Piotrowski.It Cm amd_hostbridge
4047014cb23SMateusz PiotrowskiEmulation identical to
4057014cb23SMateusz Piotrowski.Cm hostbridge
4067014cb23SMateusz Piotrowskiusing a PCI vendor ID of AMD.
4077014cb23SMateusz Piotrowski.It Cm passthru
408b13e60daSPeter GrehanPCI pass-through device.
4097014cb23SMateusz Piotrowski.It Cm virtio-net
410b13e60daSPeter GrehanVirtio network interface.
4117014cb23SMateusz Piotrowski.It Cm virtio-blk
412b13e60daSPeter GrehanVirtio block storage interface.
4137014cb23SMateusz Piotrowski.It Cm virtio-scsi
414f9c005a1SMarcelo AraujoVirtio SCSI interface.
4157014cb23SMateusz Piotrowski.It Cm virtio-9p
416100353cfSJakub Wojciech KlamaVirtio 9p (VirtFS) interface.
4177014cb23SMateusz Piotrowski.It Cm virtio-rnd
4189d0c4e17SPeter GrehanVirtio RNG interface.
4197014cb23SMateusz Piotrowski.It Cm virtio-console
4205121b6ccSRoman BogorodskiyVirtio console interface, which exposes multiple ports
4215121b6ccSRoman Bogorodskiyto the guest in the form of simple char devices for simple IO
4225121b6ccSRoman Bogorodskiybetween the guest and host userspaces.
423054accacSCorvin Köhne.It Cm virtio-input
424054accacSCorvin KöhneVirtio input interface.
4257014cb23SMateusz Piotrowski.It Cm ahci
426d6099860SMaxim KonovalovAHCI controller attached to arbitrary devices.
4277014cb23SMateusz Piotrowski.It Cm ahci-cd
428b13e60daSPeter GrehanAHCI controller attached to an ATAPI CD/DVD.
4297014cb23SMateusz Piotrowski.It Cm ahci-hd
4307014cb23SMateusz PiotrowskiAHCI controller attached to a SATA hard drive.
4317014cb23SMateusz Piotrowski.It Cm e1000
4329e749f25SAlexander MotinIntel e82545 network interface.
4337014cb23SMateusz Piotrowski.It Cm uart
434b13e60daSPeter GrehanPCI 16550 serial device.
4357014cb23SMateusz Piotrowski.It Cm lpc
4367014cb23SMateusz PiotrowskiLPC PCI-ISA bridge with COM1, COM2, COM3, and COM4 16550 serial ports,
4377014cb23SMateusz Piotrowskia boot ROM, and,
438*b30a7e54SChris Moerzoptionally, a fwcfg type, and the debug/test device.
4399b1aa8d6SNeel NatuThe LPC bridge emulation can only be configured on bus 0.
4407014cb23SMateusz Piotrowski.It Cm fbuf
4416c87a2c0SGleb SmirnoffRaw framebuffer device attached to VNC server.
4427014cb23SMateusz Piotrowski.It Cm xhci
4435c3ec676SGleb SmirnoffeXtensible Host Controller Interface (xHCI) USB controller.
4447014cb23SMateusz Piotrowski.It Cm nvme
445c066c68cSMarcelo AraujoNVM Express (NVMe) controller.
4467014cb23SMateusz Piotrowski.It Cm hda
44736f9f044SWarner LoshHigh Definition Audio Controller.
448b13e60daSPeter Grehan.El
449234d8c47SMateusz Piotrowski.Pp
450234d8c47SMateusz PiotrowskiThe optional parameter
451234d8c47SMateusz Piotrowski.Ar conf
452234d8c47SMateusz Piotrowskidescribes the backend for device emulations.
453b13e60daSPeter GrehanIf
454b13e60daSPeter Grehan.Ar conf
455b13e60daSPeter Grehanis not specified, the device emulation has no backend and can be
456b13e60daSPeter Grehanconsidered unconnected.
457*b30a7e54SChris Moerz.Ss Network device backends
4587fb22729SMateusz Piotrowski.Sm off
4597fb22729SMateusz Piotrowski.Bl -bullet
4607fb22729SMateusz Piotrowski.It
4617fb22729SMateusz Piotrowski.Xo
4627fb22729SMateusz Piotrowski.Cm tap Ar N
4637fb22729SMateusz Piotrowski.Op Cm \&,mac= Ar xx:xx:xx:xx:xx:xx
4647fb22729SMateusz Piotrowski.Op Cm \&,mtu= Ar N
4657fb22729SMateusz Piotrowski.Xc
4667fb22729SMateusz Piotrowski.It
4677fb22729SMateusz Piotrowski.Xo
4687fb22729SMateusz Piotrowski.Cm vmnet Ar N
4697fb22729SMateusz Piotrowski.Op Cm \&,mac= Ar xx:xx:xx:xx:xx:xx
4707fb22729SMateusz Piotrowski.Op Cm \&,mtu= Ar N
4717fb22729SMateusz Piotrowski.Xc
4727fb22729SMateusz Piotrowski.It
4737fb22729SMateusz Piotrowski.Xo
4747fb22729SMateusz Piotrowski.Cm netgraph,path= Ar ADDRESS Cm \&,peerhook= Ar HOOK
4757fb22729SMateusz Piotrowski.Op Cm \&,socket= Ar NAME
4767fb22729SMateusz Piotrowski.Op Cm \&,hook= Ar HOOK
4777fb22729SMateusz Piotrowski.Op Cm \&,mac= Ar xx:xx:xx:xx:xx:xx
4787fb22729SMateusz Piotrowski.Op Cm \&,mtu= Ar N
4797fb22729SMateusz Piotrowski.Xc
480c5359e2aSMark Johnston.It
481c5359e2aSMark Johnston.Xo
482c5359e2aSMark Johnston.Cm slirp,hostfwd= Ar proto : Ar hostaddr : Ar hostport - Ar guestaddr : Ar guestport
483c5359e2aSMark Johnston.Xc
4847fb22729SMateusz Piotrowski.El
4857fb22729SMateusz Piotrowski.Sm on
486baf753ccSJohn Baldwin.Pp
487b13e60daSPeter GrehanIf
4887fb22729SMateusz Piotrowski.Cm mac
489*b30a7e54SChris Moerzis not specified, the MAC address is derived from a fixed OUI, and the
490b13e60daSPeter Grehanremaining bytes from an MD5 hash of the slot and function numbers and
491b13e60daSPeter Grehanthe device name.
492b13e60daSPeter Grehan.Pp
493b13e60daSPeter GrehanThe MAC address is an ASCII string in
494b13e60daSPeter Grehan.Xr ethers 5
495b13e60daSPeter Grehanformat.
496692dbfe9SVincenzo Maffione.Pp
4977fb22729SMateusz PiotrowskiWith
4987fb22729SMateusz Piotrowski.Cm virtio-net
4997fb22729SMateusz Piotrowskidevices, the
5007fb22729SMateusz Piotrowski.Cm mtu
501692dbfe9SVincenzo Maffioneparameter can be specified to inform the guest about the largest MTU
502692dbfe9SVincenzo Maffionethat should be allowed, expressed in bytes.
503e90337e4SAleksandr Fedorov.Pp
5047fb22729SMateusz PiotrowskiWith
5057fb22729SMateusz Piotrowski.Cm netgraph
5067fb22729SMateusz Piotrowskibackend, the
5077fb22729SMateusz Piotrowski.Cm path
508e90337e4SAleksandr Fedorovand
5097fb22729SMateusz Piotrowski.Cm peerhook
510e90337e4SAleksandr Fedorovparameters must be specified to set the destination node and corresponding hook.
511e90337e4SAleksandr FedorovThe optional parameters
5127fb22729SMateusz Piotrowski.Cm socket
513e90337e4SAleksandr Fedorovand
5147fb22729SMateusz Piotrowski.Cm hook
515e90337e4SAleksandr Fedorovmay be used to set the
516e90337e4SAleksandr Fedorov.Xr ng_socket 4
517e90337e4SAleksandr Fedorovnode name and source hook.
518e90337e4SAleksandr FedorovThe
519e90337e4SAleksandr Fedorov.Ar ADDRESS ,
5207fb22729SMateusz Piotrowski.Ar HOOK ,
521e90337e4SAleksandr Fedorovand
522e90337e4SAleksandr Fedorov.Ar NAME
523e90337e4SAleksandr Fedorovmust comply with
524e90337e4SAleksandr Fedorov.Xr netgraph 4
525e90337e4SAleksandr Fedorovaddressing rules.
526b13e60daSPeter Grehan.Pp
527c5359e2aSMark JohnstonThe slirp backend can be used to provide a NATed network to the guest.
528c5359e2aSMark JohnstonThis backend has poor performance but does not require any network
529c5359e2aSMark Johnstonconfiguration on the host system.
530c5359e2aSMark JohnstonIt depends on the
531c5359e2aSMark Johnston.Pa net/libslirp
532c5359e2aSMark Johnstonport.
533c5359e2aSMark JohnstonThe
534c5359e2aSMark Johnston.Cm hostfwd
535c5359e2aSMark Johnstonoption takes a 5-tuple describing how connections from the host are to be
536c5359e2aSMark Johnstonforwarded to the guest.
537c5359e2aSMark JohnstonMultiple rules can be specified, separated by semicolons.
538c5359e2aSMark JohnstonNote that semicolons must be escaped or quoted to prevent the shell from
539c5359e2aSMark Johnstoninterpreting them.
540*b30a7e54SChris Moerz.Ss Block storage device backends:
5415232a35fSMateusz Piotrowski.Bl -bullet
542*b30a7e54SChris Moerz.Sm off
5435232a35fSMateusz Piotrowski.It
5445232a35fSMateusz Piotrowski.Ar /filename Op Cm \&, Ar block-device-options
5455232a35fSMateusz Piotrowski.It
5465232a35fSMateusz Piotrowski.Ar /dev/xxx Op Cm \&, Ar block-device-options
5475232a35fSMateusz Piotrowski.Sm on
548*b30a7e54SChris Moerz.El
5494e43c1e8SNeel Natu.Pp
5504e43c1e8SNeel NatuThe
5514e43c1e8SNeel Natu.Ar block-device-options
5524e43c1e8SNeel Natuare:
5535232a35fSMateusz Piotrowski.Bl -tag -width 10n
5545232a35fSMateusz Piotrowski.It Cm nocache
555b13e60daSPeter GrehanOpen the file with
556b13e60daSPeter Grehan.Dv O_DIRECT .
5575232a35fSMateusz Piotrowski.It Cm direct
558b13e60daSPeter GrehanOpen the file using
559b13e60daSPeter Grehan.Dv O_SYNC .
5605232a35fSMateusz Piotrowski.It Cm ro
561b13e60daSPeter GrehanForce the file to be opened read-only.
5625232a35fSMateusz Piotrowski.It Cm sectorsize= Ns Ar logical Ns Oo Cm \&/ Ns Ar physical Oc
5634e43c1e8SNeel NatuSpecify the logical and physical sector sizes of the emulated disk.
5644e43c1e8SNeel NatuThe physical sector size is optional and is equal to the logical sector size
5654e43c1e8SNeel Natuif not explicitly specified.
5665232a35fSMateusz Piotrowski.It Cm nodelete
567e6d795d1SAllan JudeDisable emulation of guest trim requests via
568e6d795d1SAllan Jude.Dv DIOCGDELETE
569e6d795d1SAllan Juderequests.
570480bef94SCorvin Köhne.It Li bootindex= Ns Ar index
571480bef94SCorvin KöhneAdd the device to the bootorder at
572480bef94SCorvin Köhne.Ar index .
573480bef94SCorvin KöhneA fwcfg file is used to specify the bootorder.
574480bef94SCorvin KöhneThe guest firmware may ignore or doesn't support this fwcfg file.
575480bef94SCorvin KöhneIn that case, this feature doesn't work as expected.
576b13e60daSPeter Grehan.El
577*b30a7e54SChris Moerz.Ss SCSI device backends
5787c5829c9SMateusz Piotrowski.Bl -bullet
579*b30a7e54SChris Moerz.Sm off
5807c5829c9SMateusz Piotrowski.It
5817c5829c9SMateusz Piotrowski.Pa /dev/cam/ctl Oo Ar pp Cm \&. Ar vp Oc Oo Cm \&, Ar scsi-device-options Oc
5827c5829c9SMateusz Piotrowski.Sm on
583*b30a7e54SChris Moerz.El
58449f87822SAlexander Motin.Pp
58549f87822SAlexander MotinThe
58649f87822SAlexander Motin.Ar scsi-device-options
58749f87822SAlexander Motinare:
58849f87822SAlexander Motin.Bl -tag -width 10n
5897c5829c9SMateusz Piotrowski.It Cm iid= Ns Ar IID
59049f87822SAlexander MotinInitiator ID to use when sending requests to specified CTL port.
59149f87822SAlexander MotinThe default value is 0.
592480bef94SCorvin Köhne.It Li bootindex= Ns Ar index
593480bef94SCorvin KöhneAdd the device to the bootorder at
594480bef94SCorvin Köhne.Ar index .
595480bef94SCorvin KöhneA fwcfg file is used to specify the bootorder.
596480bef94SCorvin KöhneThe guest firmware may ignore or doesn't support this fwcfg file.
597480bef94SCorvin KöhneIn that case, this feature doesn't work as expected.
598f9c005a1SMarcelo Araujo.El
599*b30a7e54SChris Moerz.Ss 9P device backends
6002d00b570SMateusz Piotrowski.Bl -bullet
601*b30a7e54SChris Moerz.Sm off
6022d00b570SMateusz Piotrowski.It
6032d00b570SMateusz Piotrowski.Ar sharename Cm = Ar /path/to/share Op Cm \&, Ar 9p-device-options
6042d00b570SMateusz Piotrowski.Sm on
605*b30a7e54SChris Moerz.El
606100353cfSJakub Wojciech Klama.Pp
607100353cfSJakub Wojciech KlamaThe
608100353cfSJakub Wojciech Klama.Ar 9p-device-options
609100353cfSJakub Wojciech Klamaare:
610100353cfSJakub Wojciech Klama.Bl -tag -width 10n
6112d00b570SMateusz Piotrowski.It Cm ro
612100353cfSJakub Wojciech KlamaExpose the share in read-only mode.
613100353cfSJakub Wojciech Klama.El
614*b30a7e54SChris Moerz.Ss TTY device backends
615b13e60daSPeter Grehan.Bl -tag -width 10n
6162fda01a1SMateusz Piotrowski.It Cm stdio
617b13e60daSPeter GrehanConnect the serial port to the standard input and output of
61884fe889cSChristian Bruefferthe
61984fe889cSChristian Brueffer.Nm
62084fe889cSChristian Bruefferprocess.
6212fda01a1SMateusz Piotrowski.It Ar /dev/xxx
622b13e60daSPeter GrehanUse the host TTY device for serial port I/O.
623b13e60daSPeter Grehan.El
624*b30a7e54SChris Moerz.Ss TPM device backends
625*b30a7e54SChris Moerz.Bl -bullet
626*b30a7e54SChris Moerz.Sm off
627*b30a7e54SChris Moerz.It
628*b30a7e54SChris Moerz.Ar type Ns \&, Ns Ar path Ns Op Cm \&, Ns Ar tpm-device-options
629*b30a7e54SChris Moerz.Sm on
630*b30a7e54SChris Moerz.El
631b13e60daSPeter Grehan.Pp
632*b30a7e54SChris MoerzEmulate a TPM device. The argument
633*b30a7e54SChris Moerz.Ar path
634*b30a7e54SChris Moerzneeds to point to a valid TPM device path, i.e.
635*b30a7e54SChris Moerz.Pa /dev/tpm0 .
636*b30a7e54SChris Moerz.El
637*b30a7e54SChris Moerz.Pp
638*b30a7e54SChris MoerzSupported options for
639*b30a7e54SChris Moerz.Ar type :
64067c26eb2SCorvin Köhne.Bl -tag -width 10n
641*b30a7e54SChris Moerz.It Cm passthru
642*b30a7e54SChris Moerzpass a physical TPM device through to the guest
64367c26eb2SCorvin Köhne.El
64467c26eb2SCorvin Köhne.Pp
64567c26eb2SCorvin KöhneThe
64667c26eb2SCorvin Köhne.Ar tpm-device-options
64767c26eb2SCorvin Köhneare:
64867c26eb2SCorvin Köhne.Bl -tag -width 10n
64967c26eb2SCorvin Köhne.It Cm version= Ns Ar version
65067c26eb2SCorvin KöhneVersion of the TPM device according to the TCG specification.
65167c26eb2SCorvin KöhneDefaults to
65267c26eb2SCorvin Köhne.Cm 2.0
65367c26eb2SCorvin Köhne.El
654*b30a7e54SChris Moerz.Ss Boot ROM device backends
655*b30a7e54SChris Moerz.Sm off
656*b30a7e54SChris Moerz.Bl -bullet
657*b30a7e54SChris Moerz.It
658*b30a7e54SChris Moerz.Ar romfile Ns Op Cm \&, Ns Ar varfile
659*b30a7e54SChris Moerz.El
660*b30a7e54SChris Moerz.Sm on
66167c26eb2SCorvin Köhne.Pp
6629b1aa8d6SNeel NatuMap
6639b1aa8d6SNeel Natu.Ar romfile
6649b1aa8d6SNeel Natuin the guest address space reserved for boot firmware.
665*b30a7e54SChris Moerz.Pp
666866036f4SRebecca CranIf
667866036f4SRebecca Cran.Ar varfile
668866036f4SRebecca Cranis provided, that file is also mapped in the boot firmware guest
669866036f4SRebecca Cranaddress space, and any modifications the guest makes will be saved
670866036f4SRebecca Cranto that file.
6719b1aa8d6SNeel Natu.Pp
672d85147f3SCorvin KöhneFwcfg types:
673d85147f3SCorvin Köhne.Bl -tag -width 10n
674d85147f3SCorvin Köhne.It Ar fwcfg
675a3b3e89fSBenedict ReuschlingThe fwcfg interface is used to pass information such as the CPU count
676a3b3e89fSBenedict Reuschlingor ACPI tables to the guest firmware.
677d85147f3SCorvin KöhneSupported values are
678d85147f3SCorvin Köhne.Ql bhyve
679d85147f3SCorvin Köhneand
680d85147f3SCorvin Köhne.Ql qemu .
681d85147f3SCorvin KöhneDue to backward compatibility reasons,
682d85147f3SCorvin Köhne.Ql bhyve
683d85147f3SCorvin Köhneis the default option.
684d85147f3SCorvin KöhneWhen
685d85147f3SCorvin Köhne.Ql bhyve
686d85147f3SCorvin Köhneis used, bhyve's fwctl interface is used.
687d85147f3SCorvin KöhneIt currently reports only the CPU count to the guest firmware.
688d85147f3SCorvin KöhneThe
689d85147f3SCorvin Köhne.Ql qemu
690d85147f3SCorvin Köhneoption uses QEMU's fwcfg interface.
691a3b3e89fSBenedict ReuschlingThis interface is widely used and allows user-defined information to
692a3b3e89fSBenedict Reuschlingbe passed to the guest.
693a3b3e89fSBenedict ReuschlingIt is used for passing the CPU count, ACPI tables, a boot order and
694a3b3e89fSBenedict Reuschlingmany other things to the guest.
695a3b3e89fSBenedict ReuschlingSome operating systems such as Fedora CoreOS can be configured by
696a3b3e89fSBenedict Reuschlingqemu's fwcfg interface as well.
697d85147f3SCorvin Köhne.El
698*b30a7e54SChris Moerz.Ss Pass-through device backends
699baf753ccSJohn Baldwin.Sm off
700baf753ccSJohn Baldwin.Bl -bullet
701baf753ccSJohn Baldwin.It
702baf753ccSJohn Baldwin.Cm ppt Ar N Oo , Ar passthru-device-options Oc
703baf753ccSJohn Baldwin.It
704baf753ccSJohn Baldwin.Ns Ar bus Cm \&/ Ar slot Cm \&/ Ar function
705baf753ccSJohn Baldwin.Op , Ar passthru-device-options
706baf753ccSJohn Baldwin.It
707baf753ccSJohn Baldwin.Cm pci Ar bus Cm : Ar slot Cm : Ns Ar function
708baf753ccSJohn Baldwin.Op , Ar passthru-device-options
709baf753ccSJohn Baldwin.El
710baf753ccSJohn Baldwin.Sm on
711baf753ccSJohn Baldwin.Pp
712baf753ccSJohn BaldwinConnect to a PCI device on the host either named ppt
713baf753ccSJohn Baldwin.Ns Ar N
714baf753ccSJohn Baldwinor at the selector described by
715b13e60daSPeter Grehan.Ar slot ,
716b13e60daSPeter Grehan.Ar bus ,
717b13e60daSPeter Grehanand
718b13e60daSPeter Grehan.Ar function
719b13e60daSPeter Grehannumbers.
720baf753ccSJohn Baldwin.Pp
721baf753ccSJohn BaldwinThe
722baf753ccSJohn Baldwin.Ar passthru-device-options
723baf753ccSJohn Baldwinare:
724baf753ccSJohn Baldwin.Bl -tag -width 10n
7255e19a518SMateusz Piotrowski.It Cm rom= Ns Ar romfile
726e47fe318SCorvin KöhneAdd
727e47fe318SCorvin Köhne.Ar romfile
728e47fe318SCorvin Köhneas option ROM to the PCI device.
729a3b3e89fSBenedict ReuschlingThe ROM will be loaded by firmware and should be capable of
730a3b3e89fSBenedict Reuschlinginitializing the device.
731480bef94SCorvin Köhne.It Li bootindex= Ns Ar index
732480bef94SCorvin KöhneAdd the device to the bootorder at
733480bef94SCorvin Köhne.Ar index .
734480bef94SCorvin KöhneA fwcfg file is used to specify the bootorder.
735480bef94SCorvin KöhneThe guest firmware may ignore or doesn't support this fwcfg file.
736480bef94SCorvin KöhneIn that case, this feature doesn't work as expected.
737b13e60daSPeter Grehan.El
738b13e60daSPeter Grehan.Pp
7399b1aa8d6SNeel NatuGuest memory must be wired using the
7409b1aa8d6SNeel Natu.Fl S
7419b1aa8d6SNeel Natuoption when a pass-through device is configured.
7429b1aa8d6SNeel Natu.Pp
743b13e60daSPeter GrehanThe host device must have been reserved at boot-time using the
744a9258f9bSWarren Block.Va pptdevs
745b13e60daSPeter Grehanloader variable as described in
746b13e60daSPeter Grehan.Xr vmm 4 .
747*b30a7e54SChris Moerz.Ss Virtio console device backends
7483f4c771fSMateusz Piotrowski.Bl -bullet
7493f4c771fSMateusz Piotrowski.Sm off
7503f4c771fSMateusz Piotrowski.It
7513f4c771fSMateusz Piotrowski.Cm port1= Ns Ar /path/to/port1.sock Ns Op Cm ,port Ns Ar N Cm \&= Ns Ar /path/to/port2.sock No \~ Ar ...
7523f4c771fSMateusz Piotrowski.Sm on
7533f4c771fSMateusz Piotrowski.El
7543f4c771fSMateusz Piotrowski.Pp
7555121b6ccSRoman BogorodskiyA maximum of 16 ports per device can be created.
7565121b6ccSRoman BogorodskiyEvery port is named and corresponds to a Unix domain socket created by
7575121b6ccSRoman Bogorodskiy.Nm .
7585121b6ccSRoman Bogorodskiy.Nm
7595121b6ccSRoman Bogorodskiyaccepts at most one connection per port at a time.
7605121b6ccSRoman Bogorodskiy.Pp
7615121b6ccSRoman BogorodskiyLimitations:
7628d9fefe6SMateusz Piotrowski.Bl -bullet
7635121b6ccSRoman Bogorodskiy.It
764*b30a7e54SChris MoerzDue to the lack of destructors in
7655121b6ccSRoman Bogorodskiy.Nm ,
7665121b6ccSRoman Bogorodskiysockets on the filesystem must be cleaned up manually after
7675121b6ccSRoman Bogorodskiy.Nm
7685121b6ccSRoman Bogorodskiyexits.
7695121b6ccSRoman Bogorodskiy.It
7703f4c771fSMateusz PiotrowskiThere is no way to use the
7713f4c771fSMateusz Piotrowski.Dq console port
7723f4c771fSMateusz Piotrowskifeature, nor the console port
7730ee3a4b4SRoman Bogorodskiyresize at present.
7745121b6ccSRoman Bogorodskiy.It
7750ee3a4b4SRoman BogorodskiyEmergency write is advertised, but no-op at present.
7765121b6ccSRoman Bogorodskiy.El
777*b30a7e54SChris Moerz.Ss Virtio input device backends:
778*b30a7e54SChris Moerz.Bl -bullet
779*b30a7e54SChris Moerz.Sm off
780*b30a7e54SChris Moerz.It
781*b30a7e54SChris Moerz.Ar /dev/input/eventX
782*b30a7e54SChris Moerz.Sm on
783*b30a7e54SChris Moerz.El
7846c87a2c0SGleb Smirnoff.Pp
785054accacSCorvin KöhneSend input events of
786054accacSCorvin Köhne.Ar /dev/input/eventX
787054accacSCorvin Köhneto guest by VirtIO Input Interface.
788*b30a7e54SChris Moerz.Ss Framebuffer device backends
7898b97e975SMateusz Piotrowski.Bl -bullet
7908b97e975SMateusz Piotrowski.Sm off
7918b97e975SMateusz Piotrowski.It
7928b97e975SMateusz Piotrowski.Op Cm rfb= Ar ip-and-port
7938b97e975SMateusz Piotrowski.Op Cm ,w= Ar width
7948b97e975SMateusz Piotrowski.Op Cm ,h= Ar height
7958b97e975SMateusz Piotrowski.Op Cm ,vga= Ar vgaconf
7968b97e975SMateusz Piotrowski.Op Cm ,wait
7978b97e975SMateusz Piotrowski.Op Cm ,password= Ar password
7988b97e975SMateusz Piotrowski.Sm on
7998b97e975SMateusz Piotrowski.El
8008b97e975SMateusz Piotrowski.Pp
8018b97e975SMateusz PiotrowskiConfiguration options are defined as follows:
8025c3ec676SGleb Smirnoff.Bl -tag -width 10n
8038b97e975SMateusz Piotrowski.It Cm rfb= Ns Ar ip-and-port Pq or Cm tcp= Ns Ar ip-and-port
8048b97e975SMateusz PiotrowskiAn IP address and a port VNC should listen on.
8058b97e975SMateusz PiotrowskiThere are two formats:
8068b97e975SMateusz Piotrowski.Pp
8078b97e975SMateusz Piotrowski.Bl -bullet -compact
8088d9fefe6SMateusz Piotrowski.It
8098b97e975SMateusz Piotrowski.Sm off
8108b97e975SMateusz Piotrowski.Op Ar IPv4 Cm \&:
8115c3ec676SGleb Smirnoff.Ar port
8128b97e975SMateusz Piotrowski.Sm on
8138d9fefe6SMateusz Piotrowski.It
8148b97e975SMateusz Piotrowski.Sm off
8158b97e975SMateusz Piotrowski.Cm \&[ Ar IPv6%zone Cm \&] Cm \&: Ar port
8168b97e975SMateusz Piotrowski.Sm on
8178b97e975SMateusz Piotrowski.El
8188b97e975SMateusz Piotrowski.Pp
8196c87a2c0SGleb SmirnoffThe default is to listen on localhost IPv4 address and default VNC port 5900.
8208883128bSBjoern A. ZeebAn IPv6 address must be enclosed in square brackets and may contain an
8217d9545fcSRodney W. Grimesoptional zone identifier.
8228b97e975SMateusz Piotrowski.It Cm w= Ns Ar width No and Cm h= Ns Ar height
8235c3ec676SGleb SmirnoffA display resolution, width and height, respectively.
8245c3ec676SGleb SmirnoffIf not specified, a default resolution of 1024x768 pixels will be used.
8255c3ec676SGleb SmirnoffMinimal supported resolution is 640x480 pixels,
8260600b575SRobert Wingand maximum is 3840x2160 pixels.
8278b97e975SMateusz Piotrowski.It Cm vga= Ns Ar vgaconf
8285c3ec676SGleb SmirnoffPossible values for this option are
8298b97e975SMateusz Piotrowski.Cm io
8305c3ec676SGleb Smirnoff(default),
831*b30a7e54SChris Moerz.Cm on ,
832*b30a7e54SChris Moerzand
8338b97e975SMateusz Piotrowski.Cm off .
8345c3ec676SGleb SmirnoffPCI graphics cards have a dual personality in that they are
8355c3ec676SGleb Smirnoffstandard PCI devices with BAR addressing, but may also
8365c3ec676SGleb Smirnoffimplicitly decode legacy VGA I/O space
8375c3ec676SGleb Smirnoff.Pq Ad 0x3c0-3df
8385c3ec676SGleb Smirnoffand memory space
8395c3ec676SGleb Smirnoff.Pq 64KB at Ad 0xA0000 .
8405c3ec676SGleb SmirnoffThe default
8418b97e975SMateusz Piotrowski.Cm io
8428d56c805SYuri Pankovoption should be used for guests that attempt to issue BIOS calls which result
8438d56c805SYuri Pankovin I/O port queries, and fail to boot if I/O decode is disabled.
8445c3ec676SGleb Smirnoff.Pp
8455c3ec676SGleb SmirnoffThe
8468b97e975SMateusz Piotrowski.Cm on
8475c3ec676SGleb Smirnoffoption should be used along with the CSM BIOS capability in UEFI
8485c3ec676SGleb Smirnoffto boot traditional BIOS guests that require the legacy VGA I/O and
8495c3ec676SGleb Smirnoffmemory regions to be available.
8505c3ec676SGleb Smirnoff.Pp
8515c3ec676SGleb SmirnoffThe
8528b97e975SMateusz Piotrowski.Cm off
8535c3ec676SGleb Smirnoffoption should be used for the UEFI guests that assume that
8545c3ec676SGleb SmirnoffVGA adapter is present if they detect the I/O ports.
8555c3ec676SGleb SmirnoffAn example of such a guest is
8565c3ec676SGleb Smirnoff.Ox
8575c3ec676SGleb Smirnoffin UEFI mode.
8585c3ec676SGleb Smirnoff.Pp
8595c3ec676SGleb SmirnoffPlease refer to the
8605c3ec676SGleb Smirnoff.Nm
8615c3ec676SGleb Smirnoff.Fx
8625c3ec676SGleb Smirnoffwiki page
8635c3ec676SGleb Smirnoff.Pq Lk https://wiki.freebsd.org/bhyve
8645c3ec676SGleb Smirnofffor configuration notes of particular guests.
8658b97e975SMateusz Piotrowski.It Cm wait
8665c3ec676SGleb SmirnoffInstruct
8675c3ec676SGleb Smirnoff.Nm
8688d56c805SYuri Pankovto only boot upon the initiation of a VNC connection, simplifying the
8698d56c805SYuri Pankovinstallation of operating systems that require immediate keyboard input.
8705c3ec676SGleb SmirnoffThis can be removed for post-installation use.
8718b97e975SMateusz Piotrowski.It Cm password= Ns Ar password
872f4d34383SMarcelo AraujoThis type of authentication is known to be cryptographically weak and is not
873f4d34383SMarcelo Araujointended for use on untrusted networks.
874f4d34383SMarcelo AraujoMany implementations will want to use stronger security, such as running
875f4d34383SMarcelo Araujothe session over an encrypted channel provided by IPsec or SSH.
8765c3ec676SGleb Smirnoff.El
877*b30a7e54SChris Moerz.Ss xHCI USB device backends
878*b30a7e54SChris Moerz.Bl -bullet
879*b30a7e54SChris Moerz.Sm off
880*b30a7e54SChris Moerz.It
881*b30a7e54SChris Moerz.Ar tablet
882*b30a7e54SChris Moerz.Sm on
8836c87a2c0SGleb Smirnoff.El
884c066c68cSMarcelo Araujo.Pp
885*b30a7e54SChris MoerzA USB tablet device that provides precise cursor synchronization
886*b30a7e54SChris Moerzwhen using VNC.
887*b30a7e54SChris Moerz.Ss NVMe device backends
8886eff58acSMateusz Piotrowski.Bl -bullet
8896eff58acSMateusz Piotrowski.Sm off
8906eff58acSMateusz Piotrowski.It
8916eff58acSMateusz Piotrowski.Ar devpath
8926eff58acSMateusz Piotrowski.Op Cm ,maxq= Ar #
8936eff58acSMateusz Piotrowski.Op Cm ,qsz= Ar #
8946eff58acSMateusz Piotrowski.Op Cm ,ioslots= Ar #
8956eff58acSMateusz Piotrowski.Op Cm ,sectsz= Ar #
8966eff58acSMateusz Piotrowski.Op Cm ,ser= Ar #
8976eff58acSMateusz Piotrowski.Op Cm ,eui64= Ar #
8986eff58acSMateusz Piotrowski.Op Cm ,dsm= Ar opt
8996eff58acSMateusz Piotrowski.Sm on
9006eff58acSMateusz Piotrowski.El
9016eff58acSMateusz Piotrowski.Pp
9026eff58acSMateusz PiotrowskiConfiguration options are defined as follows:
903c066c68cSMarcelo Araujo.Bl -tag -width 10n
9046eff58acSMateusz Piotrowski.It Ar devpath
905c066c68cSMarcelo AraujoAccepted device paths are:
906c066c68cSMarcelo Araujo.Ar /dev/blockdev
907c066c68cSMarcelo Araujoor
908c066c68cSMarcelo Araujo.Ar /path/to/image
909c066c68cSMarcelo Araujoor
9106eff58acSMateusz Piotrowski.Cm ram= Ns Ar size_in_MiB .
9116eff58acSMateusz Piotrowski.It Cm maxq
912c066c68cSMarcelo AraujoMax number of queues.
9136eff58acSMateusz Piotrowski.It Cm qsz
914c066c68cSMarcelo AraujoMax elements in each queue.
9156eff58acSMateusz Piotrowski.It Cm ioslots
916c066c68cSMarcelo AraujoMax number of concurrent I/O requests.
9176eff58acSMateusz Piotrowski.It Cm sectsz
918c066c68cSMarcelo AraujoSector size (defaults to blockif sector size).
9196eff58acSMateusz Piotrowski.It Cm ser
920c066c68cSMarcelo AraujoSerial number with maximum 20 characters.
9216eff58acSMateusz Piotrowski.It Cm eui64
9226eff58acSMateusz PiotrowskiIEEE Extended Unique Identifier (8 byte value).
9236eff58acSMateusz Piotrowski.It Cm dsm
9246eff58acSMateusz PiotrowskiDataSet Management support.
9256eff58acSMateusz PiotrowskiSupported values are:
9266eff58acSMateusz Piotrowski.Cm auto , enable ,
9276eff58acSMateusz Piotrowskiand
9286eff58acSMateusz Piotrowski.Cm disable .
929c066c68cSMarcelo Araujo.El
930*b30a7e54SChris Moerz.Ss AHCI device backends
931d5fcc4b6SMateusz Piotrowski.Bl -bullet
932d5fcc4b6SMateusz Piotrowski.It
933d5fcc4b6SMateusz Piotrowski.Sm off
934d5fcc4b6SMateusz Piotrowski.Op Oo Cm hd\&: | cd\&: Oc Ar path
935d5fcc4b6SMateusz Piotrowski.Op Cm ,nmrr= Ar nmrr
936d5fcc4b6SMateusz Piotrowski.Op Cm ,ser= Ar #
937d5fcc4b6SMateusz Piotrowski.Op Cm ,rev= Ar #
938d5fcc4b6SMateusz Piotrowski.Op Cm ,model= Ar #
939d5fcc4b6SMateusz Piotrowski.Sm on
940d5fcc4b6SMateusz Piotrowski.El
941d5fcc4b6SMateusz Piotrowski.Pp
942d5fcc4b6SMateusz PiotrowskiConfiguration options are defined as follows:
9439af3bcd7SPeter Grehan.Bl -tag -width 10n
944d5fcc4b6SMateusz Piotrowski.It Cm nmrr
945d5fcc4b6SMateusz PiotrowskiNominal Media Rotation Rate, known as RPM.
946d5fcc4b6SMateusz PiotrowskiValue 1 will indicate device as Solid State Disk.
947d5fcc4b6SMateusz PiotrowskiDefault value is 0, not report.
948d5fcc4b6SMateusz Piotrowski.It Cm ser
9499af3bcd7SPeter GrehanSerial Number with maximum 20 characters.
950d5fcc4b6SMateusz Piotrowski.It Cm rev
9519af3bcd7SPeter GrehanRevision Number with maximum 8 characters.
952d5fcc4b6SMateusz Piotrowski.It Cm model
9539af3bcd7SPeter GrehanModel Number with maximum 40 characters.
9549af3bcd7SPeter Grehan.El
955*b30a7e54SChris Moerz.Ss HD Audio device backends
956061f37d2SMateusz Piotrowski.Bl -bullet
957061f37d2SMateusz Piotrowski.It
958061f37d2SMateusz Piotrowski.Sm off
959061f37d2SMateusz Piotrowski.Op Cm play= Ar playback
960061f37d2SMateusz Piotrowski.Op Cm ,rec= Ar recording
961061f37d2SMateusz Piotrowski.Sm on
962061f37d2SMateusz Piotrowski.El
963061f37d2SMateusz Piotrowski.Pp
964061f37d2SMateusz PiotrowskiConfiguration options are defined as follows:
96536f9f044SWarner Losh.Bl -tag -width 10n
966061f37d2SMateusz Piotrowski.It Cm play
96736f9f044SWarner LoshPlayback device, typically
96836f9f044SWarner Losh.Ar /dev/dsp0 .
969061f37d2SMateusz Piotrowski.It Cm rec
97036f9f044SWarner LoshRecording device, typically
97136f9f044SWarner Losh.Ar /dev/dsp0 .
97236f9f044SWarner Losh.El
973621b5090SJohn Baldwin.Sh CONFIGURATION VARIABLES
974621b5090SJohn Baldwin.Nm
975621b5090SJohn Baldwinuses an internal tree of configuration variables to describe global and
976621b5090SJohn Baldwinper-device settings.
977621b5090SJohn BaldwinWhen
978621b5090SJohn Baldwin.Nm
979621b5090SJohn Baldwinstarts,
980621b5090SJohn Baldwinit parses command line options (including config files) in the order given
981621b5090SJohn Baldwinon the command line.
982621b5090SJohn BaldwinEach command line option sets one or more configuration variables.
983621b5090SJohn BaldwinFor example,
984621b5090SJohn Baldwinthe
985621b5090SJohn Baldwin.Fl s
986621b5090SJohn Baldwinoption creates a new tree node for a PCI device and sets one or more variables
987621b5090SJohn Baldwinunder that node including the device model and device model-specific variables.
988621b5090SJohn BaldwinVariables may be set multiple times during this parsing stage with the final
989621b5090SJohn Baldwinvalue overriding previous values.
990621b5090SJohn Baldwin.Pp
991621b5090SJohn BaldwinOnce all of the command line options have been processed,
992621b5090SJohn Baldwinthe configuration values are frozen.
993621b5090SJohn Baldwin.Nm
994621b5090SJohn Baldwinthen uses the value of configuration values to initialize device models
995621b5090SJohn Baldwinand global settings.
996621b5090SJohn Baldwin.Pp
997621b5090SJohn BaldwinMore details on configuration variables can be found in
998621b5090SJohn Baldwin.Xr bhyve_config 5 .
999*b30a7e54SChris Moerz.Sh CONFIGURATION FILE CREATION
1000*b30a7e54SChris MoerzThe
1001*b30a7e54SChris Moerz.Fl k
1002*b30a7e54SChris Moerzflag allows one to provide a path to a configuration file holding all
1003*b30a7e54SChris Moerzsettings, which otherwise would need to be defined by providing a long
1004*b30a7e54SChris Moerzlist of program arguments to
1005*b30a7e54SChris Moerz.Nm .
1006*b30a7e54SChris Moerz.Pp
1007*b30a7e54SChris MoerzThere is a very simple way to translate a complex set of program
1008*b30a7e54SChris Moerzarguments to an equivalent configuration file in
1009*b30a7e54SChris Moerz.Xr bhyve_config 5
1010*b30a7e54SChris Moerzformat.
1011*b30a7e54SChris Moerz.Pp
1012*b30a7e54SChris MoerzUse
1013*b30a7e54SChris Moerz.Fl o
1014*b30a7e54SChris Moerz.Ar config.dump=1
1015*b30a7e54SChris Moerzto make
1016*b30a7e54SChris Moerz.Nm
1017*b30a7e54SChris Moerzdump a configuration file representing the used flags and arguments to
1018*b30a7e54SChris Moerzstdout. You can pipe the output into a file to persist the generated settings.
1019*b30a7e54SChris Moerz.Pp
1020*b30a7e54SChris MoerzMake sure to remove the
1021*b30a7e54SChris Moerz.Ar config.dump
1022*b30a7e54SChris Moerzline from the resulting configuration file before using it to start
1023*b30a7e54SChris Moerz.Nm .
1024cd377eb3SJohn Baldwin.Sh DEBUG SERVER
1025cd377eb3SJohn BaldwinThe current debug server provides limited support for debuggers.
1026cd377eb3SJohn Baldwin.Ss Registers
1027cd377eb3SJohn BaldwinEach virtual CPU is exposed to the debugger as a thread.
1028cd377eb3SJohn Baldwin.Pp
1029cd377eb3SJohn BaldwinGeneral purpose registers can be queried for each virtual CPU, but other
1030cd377eb3SJohn Baldwinregisters such as floating-point and system registers cannot be queried.
1031cd377eb3SJohn Baldwin.Ss Memory
1032a3b3e89fSBenedict ReuschlingMemory (including memory mapped I/O regions) can be read and written
1033a3b3e89fSBenedict Reuschlingby the debugger.
1034a3b3e89fSBenedict ReuschlingMemory operations use virtual addresses that are resolved to physical
1035a3b3e89fSBenedict Reuschlingaddresses via the current virtual CPU's active address translation.
1036cd377eb3SJohn Baldwin.Ss Control
1037cd377eb3SJohn BaldwinThe running guest can be interrupted by the debugger at any time
1038cd377eb3SJohn Baldwin.Pq for example, by pressing Ctrl-C in the debugger .
1039cd377eb3SJohn Baldwin.Pp
1040cd377eb3SJohn BaldwinSingle stepping is only supported on Intel CPUs supporting the MTRAP VM exit.
1041cd377eb3SJohn Baldwin.Pp
1042cbd03a9dSJohn BaldwinBreakpoints are supported on Intel CPUs that support single stepping.
1043cbd03a9dSJohn BaldwinNote that continuing from a breakpoint while interrupts are enabled in the
1044cbd03a9dSJohn Baldwinguest may not work as expected due to timer interrupts firing while single
1045cbd03a9dSJohn Baldwinstepping over the breakpoint.
1046c2202d41SRoman Bogorodskiy.Sh SIGNAL HANDLING
1047c2202d41SRoman Bogorodskiy.Nm
1048c2202d41SRoman Bogorodskiydeals with the following signals:
1049c2202d41SRoman Bogorodskiy.Pp
10503357e948SMateusz Piotrowski.Bl -tag -width SIGTERM -compact
1051c2202d41SRoman Bogorodskiy.It SIGTERM
1052c2202d41SRoman BogorodskiyTrigger ACPI poweroff for a VM
1053c2202d41SRoman Bogorodskiy.El
1054c2202d41SRoman Bogorodskiy.Sh EXIT STATUS
1055c2202d41SRoman BogorodskiyExit status indicates how the VM was terminated:
1056c2202d41SRoman Bogorodskiy.Pp
1057c2202d41SRoman Bogorodskiy.Bl -tag -width indent -compact
1058c2202d41SRoman Bogorodskiy.It 0
1059c2202d41SRoman Bogorodskiyrebooted
1060c2202d41SRoman Bogorodskiy.It 1
1061c2202d41SRoman Bogorodskiypowered off
1062c2202d41SRoman Bogorodskiy.It 2
1063c2202d41SRoman Bogorodskiyhalted
1064c2202d41SRoman Bogorodskiy.It 3
1065c2202d41SRoman Bogorodskiytriple fault
1066989e062bSMarcelo Araujo.It 4
1067989e062bSMarcelo Araujoexited due to an error
1068c2202d41SRoman Bogorodskiy.El
1069b13e60daSPeter Grehan.Sh EXAMPLES
10705c3ec676SGleb SmirnoffIf not using a boot ROM, the guest operating system must have been loaded with
107184fe889cSChristian Brueffer.Xr bhyveload 8
1072b13e60daSPeter Grehanor a similar boot loader before
1073b13e60daSPeter Grehan.Xr bhyve 4
1074b13e60daSPeter Grehancan be run.
10755c3ec676SGleb SmirnoffOtherwise, the boot loader is not needed.
1076b13e60daSPeter Grehan.Pp
1077b13e60daSPeter GrehanTo run a virtual machine with 1GB of memory, two virtual CPUs, a virtio
1078b13e60daSPeter Grehanblock device backed by the
1079b13e60daSPeter Grehan.Pa /my/image
1080b13e60daSPeter Grehanfilesystem image, and a serial port for the console:
1081b13e60daSPeter Grehan.Bd -literal -offset indent
1082b13e60daSPeter Grehanbhyve -c 2 -s 0,hostbridge -s 1,lpc -s 2,virtio-blk,/my/image \\
108310758471SMark Johnston  -l com1,stdio -H -P -m 1G vm1
1084b13e60daSPeter Grehan.Ed
1085b13e60daSPeter Grehan.Pp
108671b2ba90SMark JohnstonTo do the same on arm64:
108771b2ba90SMark Johnston.Bd -literal -offset indent
108871b2ba90SMark Johnston.Ed
108971b2ba90SMark Johnstonbhyve -c 2 -s 0,hostbridge -s 1,virtio-blk,/my/image -o console=stdio \\
109071b2ba90SMark Johnston  -o bootrom=/usr/local/share/u-boot/u-boot-bhyve-arm64/u-boot.bin -m 1G vm1
109171b2ba90SMark Johnston.Pp
1092b13e60daSPeter GrehanRun a 24GB single-CPU virtual machine with three network ports, one of which
1093b13e60daSPeter Grehanhas a MAC address specified:
1094b13e60daSPeter Grehan.Bd -literal -offset indent
1095b13e60daSPeter Grehanbhyve -s 0,hostbridge -s 1,lpc -s 2:0,virtio-net,tap0 \\
1096b13e60daSPeter Grehan  -s 2:1,virtio-net,tap1 \\
1097b13e60daSPeter Grehan  -s 2:2,virtio-net,tap2,mac=00:be:fa:76:45:00 \\
1098b13e60daSPeter Grehan  -s 3,virtio-blk,/my/image -l com1,stdio \\
109910758471SMark Johnston  -H -P -m 24G bigvm
1100b13e60daSPeter Grehan.Ed
1101b13e60daSPeter Grehan.Pp
1102b13e60daSPeter GrehanRun an 8GB quad-CPU virtual machine with 8 AHCI SATA disks, an AHCI ATAPI
1103b13e60daSPeter GrehanCD-ROM, a single virtio network port, an AMD hostbridge, and the console
1104b13e60daSPeter Grehanport connected to an
1105b13e60daSPeter Grehan.Xr nmdm 4
110684fe889cSChristian Brueffernull-modem device.
1107b13e60daSPeter Grehan.Bd -literal -offset indent
1108a7ab1463SAlexander Motinbhyve -c 4 \\
1109b13e60daSPeter Grehan  -s 0,amd_hostbridge -s 1,lpc \\
1110098f5155SAlexander Motin  -s 1:0,ahci,hd:/images/disk.1,hd:/images/disk.2,\\
1111098f5155SAlexander Motinhd:/images/disk.3,hd:/images/disk.4,\\
1112098f5155SAlexander Motinhd:/images/disk.5,hd:/images/disk.6,\\
1113098f5155SAlexander Motinhd:/images/disk.7,hd:/images/disk.8,\\
1114098f5155SAlexander Motincd:/images/install.iso \\
1115b13e60daSPeter Grehan  -s 3,virtio-net,tap0 \\
1116b13e60daSPeter Grehan  -l com1,/dev/nmdm0A \\
111710758471SMark Johnston  -H -P -m 8G
1118b13e60daSPeter Grehan.Ed
11195c3ec676SGleb Smirnoff.Pp
11205c3ec676SGleb SmirnoffRun a UEFI virtual machine with a display resolution of 800 by 600 pixels
11215c3ec676SGleb Smirnoffthat can be accessed via VNC at: 0.0.0.0:5900.
11225c3ec676SGleb Smirnoff.Bd -literal -offset indent
11235c3ec676SGleb Smirnoffbhyve -c 2 -m 4G -w -H \\
11245c3ec676SGleb Smirnoff  -s 0,hostbridge \\
11255c3ec676SGleb Smirnoff  -s 3,ahci-cd,/path/to/uefi-OS-install.iso \\
11265c3ec676SGleb Smirnoff  -s 4,ahci-hd,disk.img \\
11275c3ec676SGleb Smirnoff  -s 5,virtio-net,tap0 \\
11285c3ec676SGleb Smirnoff  -s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \\
11295c3ec676SGleb Smirnoff  -s 30,xhci,tablet \\
11305c3ec676SGleb Smirnoff  -s 31,lpc -l com1,stdio \\
11315c3ec676SGleb Smirnoff  -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\
11325c3ec676SGleb Smirnoff   uefivm
11335c3ec676SGleb Smirnoff.Ed
11348883128bSBjoern A. Zeeb.Pp
11358883128bSBjoern A. ZeebRun a UEFI virtual machine with a VNC display that is bound to all IPv6
11368883128bSBjoern A. Zeebaddresses on port 5900.
11378883128bSBjoern A. Zeeb.Bd -literal -offset indent
11388883128bSBjoern A. Zeebbhyve -c 2 -m 4G -w -H \\
11398883128bSBjoern A. Zeeb  -s 0,hostbridge \\
11408883128bSBjoern A. Zeeb  -s 4,ahci-hd,disk.img \\
11418883128bSBjoern A. Zeeb  -s 5,virtio-net,tap0 \\
11428883128bSBjoern A. Zeeb  -s 29,fbuf,tcp=[::]:5900,w=800,h=600 \\
11438883128bSBjoern A. Zeeb  -s 30,xhci,tablet \\
11448883128bSBjoern A. Zeeb  -s 31,lpc -l com1,stdio \\
11458883128bSBjoern A. Zeeb  -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\
11468883128bSBjoern A. Zeeb   uefivm
11478883128bSBjoern A. Zeeb.Ed
1148866036f4SRebecca Cran.Pp
1149866036f4SRebecca CranRun a UEFI virtual machine with a VARS file to save EFI variables.
1150866036f4SRebecca CranNote that
1151866036f4SRebecca Cran.Nm
1152866036f4SRebecca Cranwill write guest modifications to the given VARS file.
1153866036f4SRebecca CranBe sure to create a per-guest copy of the template VARS file from
1154866036f4SRebecca Cran.Pa /usr .
1155866036f4SRebecca Cran.Bd -literal -offset indent
1156866036f4SRebecca Cranbhyve -c 2 -m 4g -w -H \\
1157866036f4SRebecca Cran  -s 0,hostbridge \\
115866659955SAlexey Marchenko  -s 31,lpc -l com1,stdio \\
1159866036f4SRebecca Cran  -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd,BHYVE_UEFI_VARS.fd
1160866036f4SRebecca Cran   uefivm
1161866036f4SRebecca Cran.Ed
1162*b30a7e54SChris Moerz.Pp
1163*b30a7e54SChris MoerzTo create a configuration file
1164*b30a7e54SChris Moerz.Pa configfile
1165*b30a7e54SChris Moerzfor a virtual machine, use
1166*b30a7e54SChris Moerz.Fl o
1167*b30a7e54SChris Moerz.Ar config.dump=1 :
1168*b30a7e54SChris Moerz.Bd -literal -offset indent
1169*b30a7e54SChris Moerz/usr/sbin/bhyve -c 2 -m 256 -A -H -P \\
1170*b30a7e54SChris Moerz  -s 0:0,hostbridge -s 1:0,virtio-net,tap0 \\
1171*b30a7e54SChris Moerz  -s 2:0,ahci-hd,./vm0.img \\
1172*b30a7e54SChris Moerz  -s 31,lpc -l com1,stdio \\
1173*b30a7e54SChris Moerz  -o config.dump=1 vm0 > configfile
1174*b30a7e54SChris Moerz.Ed
1175*b30a7e54SChris Moerz.Pp
1176*b30a7e54SChris MoerzThen use an editor of your choice to remove the line "config.dump=1"
1177*b30a7e54SChris Moerzfrom the newly generated
1178*b30a7e54SChris Moerz.Pa configfile .
1179*b30a7e54SChris Moerz.Pp
1180*b30a7e54SChris MoerzTo start
1181*b30a7e54SChris Moerz.Nm
1182*b30a7e54SChris Moerzusing this configuration file, use flag
1183*b30a7e54SChris Moerz.Fl k :
1184*b30a7e54SChris Moerz.Bd -literal -offset indent
1185*b30a7e54SChris Moerz/usr/sbin/bhyve -k configfile vm0
1186*b30a7e54SChris Moerz.Ed
1187b13e60daSPeter Grehan.Sh SEE ALSO
1188b13e60daSPeter Grehan.Xr bhyve 4 ,
1189e90337e4SAleksandr Fedorov.Xr netgraph 4 ,
1190e90337e4SAleksandr Fedorov.Xr ng_socket 4 ,
1191b13e60daSPeter Grehan.Xr nmdm 4 ,
1192b13e60daSPeter Grehan.Xr vmm 4 ,
1193621b5090SJohn Baldwin.Xr bhyve_config 5 ,
1194b13e60daSPeter Grehan.Xr ethers 5 ,
119505f7cd8bSJoel Dahl.Xr bhyvectl 8 ,
119605f7cd8bSJoel Dahl.Xr bhyveload 8
11978d56c805SYuri Pankov.Pp
11988d56c805SYuri Pankov.Rs
11998d56c805SYuri Pankov.%A Intel
12008d56c805SYuri Pankov.%B 64 and IA-32 Architectures Software Developer’s Manual
12018d56c805SYuri Pankov.%V Volume 3
12028d56c805SYuri Pankov.Re
1203b13e60daSPeter Grehan.Sh HISTORY
1204b13e60daSPeter Grehan.Nm
1205b13e60daSPeter Grehanfirst appeared in
1206b13e60daSPeter Grehan.Fx 10.0 .
1207b13e60daSPeter Grehan.Sh AUTHORS
120801c2b8acSBaptiste Daroussin.An Neel Natu Aq Mt neel@freebsd.org
120901c2b8acSBaptiste Daroussin.An Peter Grehan Aq Mt grehan@freebsd.org
1210