xref: /freebsd/usr.sbin/bhyve/bhyve.8 (revision d93fbcf0222b05fcd7704b35bc94e5513c2682e2)
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.\"
251f903953SSHENG-YI HONG.Dd August 21, 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
359b30a7e54SChris MoerzSee
360b30a7e54SChris Moerz.Sx "PCI EMULATION"
361b30a7e54SChris Moerzfor available options for the
362234d8c47SMateusz Piotrowski.Ar emulation
363b30a7e54SChris Moerzargument.
364b30a7e54SChris Moerz.It Fl U Ar uuid
365b30a7e54SChris MoerzSet the universally unique identifier
366b30a7e54SChris Moerz.Pq UUID
367b30a7e54SChris Moerzin the guest's System Management BIOS System Information structure.
368b30a7e54SChris MoerzBy default a UUID is generated from the host's hostname and
369b30a7e54SChris Moerz.Ar vmname .
370b30a7e54SChris Moerz.It Fl u
371b30a7e54SChris MoerzRTC keeps UTC time.
372b30a7e54SChris Moerz.It Fl W
373b30a7e54SChris MoerzForce virtio PCI device emulations to use MSI interrupts instead of MSI-X
374b30a7e54SChris Moerzinterrupts.
375b30a7e54SChris Moerz.It Fl w
376b30a7e54SChris MoerzIgnore accesses to unimplemented Model Specific Registers (MSRs).
377b30a7e54SChris MoerzThis is intended for debug purposes.
378b30a7e54SChris Moerz.It Fl x
379b30a7e54SChris MoerzThe guest's local APIC is configured in x2APIC mode.
380b30a7e54SChris MoerzThis option applies only to the amd64 platform.
381b30a7e54SChris Moerz.It Fl Y
382b30a7e54SChris MoerzDisable MPtable generation.
383b30a7e54SChris MoerzThis option applies only to the amd64 platform.
384b30a7e54SChris Moerz.It Ar vmname
385b30a7e54SChris MoerzAlphanumeric name of the guest.
386b30a7e54SChris MoerzThis should be the same as that created by
387b30a7e54SChris Moerz.Xr bhyveload 8 .
388b30a7e54SChris Moerz.El
389b30a7e54SChris Moerz.Sh PCI EMULATION
390b30a7e54SChris Moerz.Nm
391b30a7e54SChris Moerzprovides emulation for various PCI devices.
392b30a7e54SChris MoerzThey are specified by the
393b30a7e54SChris Moerz.Fl s
394b30a7e54SChris Moerz.Ar slot,emulation,conf
395b30a7e54SChris Moerzconfiguration's
396b30a7e54SChris Moerz.Ar emulation
397b30a7e54SChris 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*d93fbcf0SHans Rosenfeldoptionally, a TPM module, 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.
457b30a7e54SChris 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
489b30a7e54SChris 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.
540b30a7e54SChris Moerz.Ss Block storage device backends:
5415232a35fSMateusz Piotrowski.Bl -bullet
542b30a7e54SChris 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
548b30a7e54SChris 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
577b30a7e54SChris Moerz.Ss SCSI device backends
5787c5829c9SMateusz Piotrowski.Bl -bullet
579b30a7e54SChris 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
583b30a7e54SChris 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
599b30a7e54SChris Moerz.Ss 9P device backends
6002d00b570SMateusz Piotrowski.Bl -bullet
601b30a7e54SChris 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
605b30a7e54SChris 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
614b30a7e54SChris 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.
6231f903953SSHENG-YI HONG.It Ar tcp=ip:port
6241f903953SSHENG-YI HONGUse the TCP server for serial port I/O.
6251f903953SSHENG-YI HONGConfiguring this option will start a TCP server that waits for connections.
6261f903953SSHENG-YI HONGOnly one connection is allowed at any time. Other connection try to connect
6271f903953SSHENG-YI HONGto TCP server will be disconnected immediately. Note that this feature
6281f903953SSHENG-YI HONGallows unprivileged users to access the guest console, so ensure that
6291f903953SSHENG-YI HONGaccess is appropriately restricted.
630b13e60daSPeter Grehan.El
631b30a7e54SChris Moerz.Ss TPM device backends
632b30a7e54SChris Moerz.Bl -bullet
633b30a7e54SChris Moerz.Sm off
634b30a7e54SChris Moerz.It
635b30a7e54SChris Moerz.Ar type Ns \&, Ns Ar path Ns Op Cm \&, Ns Ar tpm-device-options
636b30a7e54SChris Moerz.Sm on
637b30a7e54SChris Moerz.El
638b13e60daSPeter Grehan.Pp
639*d93fbcf0SHans RosenfeldEmulate a TPM device.
640b30a7e54SChris MoerzSupported options for
641b30a7e54SChris Moerz.Ar type :
64267c26eb2SCorvin Köhne.Bl -tag -width 10n
643b30a7e54SChris Moerz.It Cm passthru
644*d93fbcf0SHans RosenfeldUse a physical TPM device.
645*d93fbcf0SHans RosenfeldThe argument
646*d93fbcf0SHans Rosenfeld.Ar path
647*d93fbcf0SHans Rosenfeldneeds to point to a valid TPM device path, i.e.
648*d93fbcf0SHans Rosenfeld.Pa /dev/tpm0 .
649*d93fbcf0SHans Rosenfeld.It Cm swtpm
650*d93fbcf0SHans RosenfeldConnect to a running
651*d93fbcf0SHans Rosenfeld.Cm swtpm
652*d93fbcf0SHans Rosenfeldinstance.
653*d93fbcf0SHans RosenfeldThe argument
654*d93fbcf0SHans Rosenfeld.Ar path
655*d93fbcf0SHans Rosenfeldneeds to point to a UNIX domain socket that a
656*d93fbcf0SHans Rosenfeld.Cm swtpm
657*d93fbcf0SHans Rosenfeldprocess is listening on.
65867c26eb2SCorvin Köhne.El
65967c26eb2SCorvin Köhne.Pp
66067c26eb2SCorvin KöhneThe
66167c26eb2SCorvin Köhne.Ar tpm-device-options
66267c26eb2SCorvin Köhneare:
66367c26eb2SCorvin Köhne.Bl -tag -width 10n
66467c26eb2SCorvin Köhne.It Cm version= Ns Ar version
66567c26eb2SCorvin KöhneVersion of the TPM device according to the TCG specification.
66667c26eb2SCorvin KöhneDefaults to
667*d93fbcf0SHans Rosenfeld.Cm 2.0 ,
668*d93fbcf0SHans Rosenfeldwhich is the only version currently supported.
66967c26eb2SCorvin Köhne.El
670b30a7e54SChris Moerz.Ss Boot ROM device backends
671b30a7e54SChris Moerz.Sm off
672b30a7e54SChris Moerz.Bl -bullet
673b30a7e54SChris Moerz.It
674b30a7e54SChris Moerz.Ar romfile Ns Op Cm \&, Ns Ar varfile
675b30a7e54SChris Moerz.El
676b30a7e54SChris Moerz.Sm on
67767c26eb2SCorvin Köhne.Pp
6789b1aa8d6SNeel NatuMap
6799b1aa8d6SNeel Natu.Ar romfile
6809b1aa8d6SNeel Natuin the guest address space reserved for boot firmware.
681b30a7e54SChris Moerz.Pp
682866036f4SRebecca CranIf
683866036f4SRebecca Cran.Ar varfile
684866036f4SRebecca Cranis provided, that file is also mapped in the boot firmware guest
685866036f4SRebecca Cranaddress space, and any modifications the guest makes will be saved
686866036f4SRebecca Cranto that file.
6879b1aa8d6SNeel Natu.Pp
688d85147f3SCorvin KöhneFwcfg types:
689d85147f3SCorvin Köhne.Bl -tag -width 10n
690d85147f3SCorvin Köhne.It Ar fwcfg
691a3b3e89fSBenedict ReuschlingThe fwcfg interface is used to pass information such as the CPU count
692a3b3e89fSBenedict Reuschlingor ACPI tables to the guest firmware.
693d85147f3SCorvin KöhneSupported values are
694d85147f3SCorvin Köhne.Ql bhyve
695d85147f3SCorvin Köhneand
696d85147f3SCorvin Köhne.Ql qemu .
697d85147f3SCorvin KöhneDue to backward compatibility reasons,
698d85147f3SCorvin Köhne.Ql bhyve
699d85147f3SCorvin Köhneis the default option.
700d85147f3SCorvin KöhneWhen
701d85147f3SCorvin Köhne.Ql bhyve
702d85147f3SCorvin Köhneis used, bhyve's fwctl interface is used.
703d85147f3SCorvin KöhneIt currently reports only the CPU count to the guest firmware.
704d85147f3SCorvin KöhneThe
705d85147f3SCorvin Köhne.Ql qemu
706d85147f3SCorvin Köhneoption uses QEMU's fwcfg interface.
707a3b3e89fSBenedict ReuschlingThis interface is widely used and allows user-defined information to
708a3b3e89fSBenedict Reuschlingbe passed to the guest.
709a3b3e89fSBenedict ReuschlingIt is used for passing the CPU count, ACPI tables, a boot order and
710a3b3e89fSBenedict Reuschlingmany other things to the guest.
711a3b3e89fSBenedict ReuschlingSome operating systems such as Fedora CoreOS can be configured by
712a3b3e89fSBenedict Reuschlingqemu's fwcfg interface as well.
713d85147f3SCorvin Köhne.El
714b30a7e54SChris Moerz.Ss Pass-through device backends
715baf753ccSJohn Baldwin.Sm off
716baf753ccSJohn Baldwin.Bl -bullet
717baf753ccSJohn Baldwin.It
718baf753ccSJohn Baldwin.Cm ppt Ar N Oo , Ar passthru-device-options Oc
719baf753ccSJohn Baldwin.It
720baf753ccSJohn Baldwin.Ns Ar bus Cm \&/ Ar slot Cm \&/ Ar function
721baf753ccSJohn Baldwin.Op , Ar passthru-device-options
722baf753ccSJohn Baldwin.It
723baf753ccSJohn Baldwin.Cm pci Ar bus Cm : Ar slot Cm : Ns Ar function
724baf753ccSJohn Baldwin.Op , Ar passthru-device-options
725baf753ccSJohn Baldwin.El
726baf753ccSJohn Baldwin.Sm on
727baf753ccSJohn Baldwin.Pp
728baf753ccSJohn BaldwinConnect to a PCI device on the host either named ppt
729baf753ccSJohn Baldwin.Ns Ar N
730baf753ccSJohn Baldwinor at the selector described by
731b13e60daSPeter Grehan.Ar slot ,
732b13e60daSPeter Grehan.Ar bus ,
733b13e60daSPeter Grehanand
734b13e60daSPeter Grehan.Ar function
735b13e60daSPeter Grehannumbers.
736baf753ccSJohn Baldwin.Pp
737baf753ccSJohn BaldwinThe
738baf753ccSJohn Baldwin.Ar passthru-device-options
739baf753ccSJohn Baldwinare:
740baf753ccSJohn Baldwin.Bl -tag -width 10n
7415e19a518SMateusz Piotrowski.It Cm rom= Ns Ar romfile
742e47fe318SCorvin KöhneAdd
743e47fe318SCorvin Köhne.Ar romfile
744e47fe318SCorvin Köhneas option ROM to the PCI device.
745a3b3e89fSBenedict ReuschlingThe ROM will be loaded by firmware and should be capable of
746a3b3e89fSBenedict Reuschlinginitializing the device.
747480bef94SCorvin Köhne.It Li bootindex= Ns Ar index
748480bef94SCorvin KöhneAdd the device to the bootorder at
749480bef94SCorvin Köhne.Ar index .
750480bef94SCorvin KöhneA fwcfg file is used to specify the bootorder.
751480bef94SCorvin KöhneThe guest firmware may ignore or doesn't support this fwcfg file.
752480bef94SCorvin KöhneIn that case, this feature doesn't work as expected.
753b13e60daSPeter Grehan.El
754b13e60daSPeter Grehan.Pp
7559b1aa8d6SNeel NatuGuest memory must be wired using the
7569b1aa8d6SNeel Natu.Fl S
7579b1aa8d6SNeel Natuoption when a pass-through device is configured.
7589b1aa8d6SNeel Natu.Pp
759b13e60daSPeter GrehanThe host device must have been reserved at boot-time using the
760a9258f9bSWarren Block.Va pptdevs
761b13e60daSPeter Grehanloader variable as described in
762b13e60daSPeter Grehan.Xr vmm 4 .
763b30a7e54SChris Moerz.Ss Virtio console device backends
7643f4c771fSMateusz Piotrowski.Bl -bullet
7653f4c771fSMateusz Piotrowski.Sm off
7663f4c771fSMateusz Piotrowski.It
7673f4c771fSMateusz 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 ...
7683f4c771fSMateusz Piotrowski.Sm on
7693f4c771fSMateusz Piotrowski.El
7703f4c771fSMateusz Piotrowski.Pp
7715121b6ccSRoman BogorodskiyA maximum of 16 ports per device can be created.
7725121b6ccSRoman BogorodskiyEvery port is named and corresponds to a Unix domain socket created by
7735121b6ccSRoman Bogorodskiy.Nm .
7745121b6ccSRoman Bogorodskiy.Nm
7755121b6ccSRoman Bogorodskiyaccepts at most one connection per port at a time.
7765121b6ccSRoman Bogorodskiy.Pp
7775121b6ccSRoman BogorodskiyLimitations:
7788d9fefe6SMateusz Piotrowski.Bl -bullet
7795121b6ccSRoman Bogorodskiy.It
780b30a7e54SChris MoerzDue to the lack of destructors in
7815121b6ccSRoman Bogorodskiy.Nm ,
7825121b6ccSRoman Bogorodskiysockets on the filesystem must be cleaned up manually after
7835121b6ccSRoman Bogorodskiy.Nm
7845121b6ccSRoman Bogorodskiyexits.
7855121b6ccSRoman Bogorodskiy.It
7863f4c771fSMateusz PiotrowskiThere is no way to use the
7873f4c771fSMateusz Piotrowski.Dq console port
7883f4c771fSMateusz Piotrowskifeature, nor the console port
7890ee3a4b4SRoman Bogorodskiyresize at present.
7905121b6ccSRoman Bogorodskiy.It
7910ee3a4b4SRoman BogorodskiyEmergency write is advertised, but no-op at present.
7925121b6ccSRoman Bogorodskiy.El
793b30a7e54SChris Moerz.Ss Virtio input device backends:
794b30a7e54SChris Moerz.Bl -bullet
795b30a7e54SChris Moerz.Sm off
796b30a7e54SChris Moerz.It
797b30a7e54SChris Moerz.Ar /dev/input/eventX
798b30a7e54SChris Moerz.Sm on
799b30a7e54SChris Moerz.El
8006c87a2c0SGleb Smirnoff.Pp
801054accacSCorvin KöhneSend input events of
802054accacSCorvin Köhne.Ar /dev/input/eventX
803054accacSCorvin Köhneto guest by VirtIO Input Interface.
804b30a7e54SChris Moerz.Ss Framebuffer device backends
8058b97e975SMateusz Piotrowski.Bl -bullet
8068b97e975SMateusz Piotrowski.Sm off
8078b97e975SMateusz Piotrowski.It
8088b97e975SMateusz Piotrowski.Op Cm rfb= Ar ip-and-port
8098b97e975SMateusz Piotrowski.Op Cm ,w= Ar width
8108b97e975SMateusz Piotrowski.Op Cm ,h= Ar height
8118b97e975SMateusz Piotrowski.Op Cm ,vga= Ar vgaconf
8128b97e975SMateusz Piotrowski.Op Cm ,wait
8138b97e975SMateusz Piotrowski.Op Cm ,password= Ar password
8148b97e975SMateusz Piotrowski.Sm on
8158b97e975SMateusz Piotrowski.El
8168b97e975SMateusz Piotrowski.Pp
8178b97e975SMateusz PiotrowskiConfiguration options are defined as follows:
8185c3ec676SGleb Smirnoff.Bl -tag -width 10n
8198b97e975SMateusz Piotrowski.It Cm rfb= Ns Ar ip-and-port Pq or Cm tcp= Ns Ar ip-and-port
8208b97e975SMateusz PiotrowskiAn IP address and a port VNC should listen on.
8218b97e975SMateusz PiotrowskiThere are two formats:
8228b97e975SMateusz Piotrowski.Pp
8238b97e975SMateusz Piotrowski.Bl -bullet -compact
8248d9fefe6SMateusz Piotrowski.It
8258b97e975SMateusz Piotrowski.Sm off
8268b97e975SMateusz Piotrowski.Op Ar IPv4 Cm \&:
8275c3ec676SGleb Smirnoff.Ar port
8288b97e975SMateusz Piotrowski.Sm on
8298d9fefe6SMateusz Piotrowski.It
8308b97e975SMateusz Piotrowski.Sm off
8318b97e975SMateusz Piotrowski.Cm \&[ Ar IPv6%zone Cm \&] Cm \&: Ar port
8328b97e975SMateusz Piotrowski.Sm on
8338b97e975SMateusz Piotrowski.El
8348b97e975SMateusz Piotrowski.Pp
8356c87a2c0SGleb SmirnoffThe default is to listen on localhost IPv4 address and default VNC port 5900.
8368883128bSBjoern A. ZeebAn IPv6 address must be enclosed in square brackets and may contain an
8377d9545fcSRodney W. Grimesoptional zone identifier.
8388b97e975SMateusz Piotrowski.It Cm w= Ns Ar width No and Cm h= Ns Ar height
8395c3ec676SGleb SmirnoffA display resolution, width and height, respectively.
8405c3ec676SGleb SmirnoffIf not specified, a default resolution of 1024x768 pixels will be used.
8415c3ec676SGleb SmirnoffMinimal supported resolution is 640x480 pixels,
8420600b575SRobert Wingand maximum is 3840x2160 pixels.
8438b97e975SMateusz Piotrowski.It Cm vga= Ns Ar vgaconf
8445c3ec676SGleb SmirnoffPossible values for this option are
8458b97e975SMateusz Piotrowski.Cm io
8465c3ec676SGleb Smirnoff(default),
847b30a7e54SChris Moerz.Cm on ,
848b30a7e54SChris Moerzand
8498b97e975SMateusz Piotrowski.Cm off .
8505c3ec676SGleb SmirnoffPCI graphics cards have a dual personality in that they are
8515c3ec676SGleb Smirnoffstandard PCI devices with BAR addressing, but may also
8525c3ec676SGleb Smirnoffimplicitly decode legacy VGA I/O space
8535c3ec676SGleb Smirnoff.Pq Ad 0x3c0-3df
8545c3ec676SGleb Smirnoffand memory space
8555c3ec676SGleb Smirnoff.Pq 64KB at Ad 0xA0000 .
8565c3ec676SGleb SmirnoffThe default
8578b97e975SMateusz Piotrowski.Cm io
8588d56c805SYuri Pankovoption should be used for guests that attempt to issue BIOS calls which result
8598d56c805SYuri Pankovin I/O port queries, and fail to boot if I/O decode is disabled.
8605c3ec676SGleb Smirnoff.Pp
8615c3ec676SGleb SmirnoffThe
8628b97e975SMateusz Piotrowski.Cm on
8635c3ec676SGleb Smirnoffoption should be used along with the CSM BIOS capability in UEFI
8645c3ec676SGleb Smirnoffto boot traditional BIOS guests that require the legacy VGA I/O and
8655c3ec676SGleb Smirnoffmemory regions to be available.
8665c3ec676SGleb Smirnoff.Pp
8675c3ec676SGleb SmirnoffThe
8688b97e975SMateusz Piotrowski.Cm off
8695c3ec676SGleb Smirnoffoption should be used for the UEFI guests that assume that
8705c3ec676SGleb SmirnoffVGA adapter is present if they detect the I/O ports.
8715c3ec676SGleb SmirnoffAn example of such a guest is
8725c3ec676SGleb Smirnoff.Ox
8735c3ec676SGleb Smirnoffin UEFI mode.
8745c3ec676SGleb Smirnoff.Pp
8755c3ec676SGleb SmirnoffPlease refer to the
8765c3ec676SGleb Smirnoff.Nm
8775c3ec676SGleb Smirnoff.Fx
8785c3ec676SGleb Smirnoffwiki page
8795c3ec676SGleb Smirnoff.Pq Lk https://wiki.freebsd.org/bhyve
8805c3ec676SGleb Smirnofffor configuration notes of particular guests.
8818b97e975SMateusz Piotrowski.It Cm wait
8825c3ec676SGleb SmirnoffInstruct
8835c3ec676SGleb Smirnoff.Nm
8848d56c805SYuri Pankovto only boot upon the initiation of a VNC connection, simplifying the
8858d56c805SYuri Pankovinstallation of operating systems that require immediate keyboard input.
8865c3ec676SGleb SmirnoffThis can be removed for post-installation use.
8878b97e975SMateusz Piotrowski.It Cm password= Ns Ar password
888f4d34383SMarcelo AraujoThis type of authentication is known to be cryptographically weak and is not
889f4d34383SMarcelo Araujointended for use on untrusted networks.
890f4d34383SMarcelo AraujoMany implementations will want to use stronger security, such as running
891f4d34383SMarcelo Araujothe session over an encrypted channel provided by IPsec or SSH.
8925c3ec676SGleb Smirnoff.El
893b30a7e54SChris Moerz.Ss xHCI USB device backends
894b30a7e54SChris Moerz.Bl -bullet
895b30a7e54SChris Moerz.Sm off
896b30a7e54SChris Moerz.It
897b30a7e54SChris Moerz.Ar tablet
898b30a7e54SChris Moerz.Sm on
8996c87a2c0SGleb Smirnoff.El
900c066c68cSMarcelo Araujo.Pp
901b30a7e54SChris MoerzA USB tablet device that provides precise cursor synchronization
902b30a7e54SChris Moerzwhen using VNC.
903b30a7e54SChris Moerz.Ss NVMe device backends
9046eff58acSMateusz Piotrowski.Bl -bullet
9056eff58acSMateusz Piotrowski.Sm off
9066eff58acSMateusz Piotrowski.It
9076eff58acSMateusz Piotrowski.Ar devpath
9086eff58acSMateusz Piotrowski.Op Cm ,maxq= Ar #
9096eff58acSMateusz Piotrowski.Op Cm ,qsz= Ar #
9106eff58acSMateusz Piotrowski.Op Cm ,ioslots= Ar #
9116eff58acSMateusz Piotrowski.Op Cm ,sectsz= Ar #
9126eff58acSMateusz Piotrowski.Op Cm ,ser= Ar #
9136eff58acSMateusz Piotrowski.Op Cm ,eui64= Ar #
9146eff58acSMateusz Piotrowski.Op Cm ,dsm= Ar opt
9156eff58acSMateusz Piotrowski.Sm on
9166eff58acSMateusz Piotrowski.El
9176eff58acSMateusz Piotrowski.Pp
9186eff58acSMateusz PiotrowskiConfiguration options are defined as follows:
919c066c68cSMarcelo Araujo.Bl -tag -width 10n
9206eff58acSMateusz Piotrowski.It Ar devpath
921c066c68cSMarcelo AraujoAccepted device paths are:
922c066c68cSMarcelo Araujo.Ar /dev/blockdev
923c066c68cSMarcelo Araujoor
924c066c68cSMarcelo Araujo.Ar /path/to/image
925c066c68cSMarcelo Araujoor
9266eff58acSMateusz Piotrowski.Cm ram= Ns Ar size_in_MiB .
9276eff58acSMateusz Piotrowski.It Cm maxq
928c066c68cSMarcelo AraujoMax number of queues.
9296eff58acSMateusz Piotrowski.It Cm qsz
930c066c68cSMarcelo AraujoMax elements in each queue.
9316eff58acSMateusz Piotrowski.It Cm ioslots
932c066c68cSMarcelo AraujoMax number of concurrent I/O requests.
9336eff58acSMateusz Piotrowski.It Cm sectsz
934c066c68cSMarcelo AraujoSector size (defaults to blockif sector size).
9356eff58acSMateusz Piotrowski.It Cm ser
936c066c68cSMarcelo AraujoSerial number with maximum 20 characters.
9376eff58acSMateusz Piotrowski.It Cm eui64
9386eff58acSMateusz PiotrowskiIEEE Extended Unique Identifier (8 byte value).
9396eff58acSMateusz Piotrowski.It Cm dsm
9406eff58acSMateusz PiotrowskiDataSet Management support.
9416eff58acSMateusz PiotrowskiSupported values are:
9426eff58acSMateusz Piotrowski.Cm auto , enable ,
9436eff58acSMateusz Piotrowskiand
9446eff58acSMateusz Piotrowski.Cm disable .
945c066c68cSMarcelo Araujo.El
946b30a7e54SChris Moerz.Ss AHCI device backends
947d5fcc4b6SMateusz Piotrowski.Bl -bullet
948d5fcc4b6SMateusz Piotrowski.It
949d5fcc4b6SMateusz Piotrowski.Sm off
950d5fcc4b6SMateusz Piotrowski.Op Oo Cm hd\&: | cd\&: Oc Ar path
951d5fcc4b6SMateusz Piotrowski.Op Cm ,nmrr= Ar nmrr
952d5fcc4b6SMateusz Piotrowski.Op Cm ,ser= Ar #
953d5fcc4b6SMateusz Piotrowski.Op Cm ,rev= Ar #
954d5fcc4b6SMateusz Piotrowski.Op Cm ,model= Ar #
955d5fcc4b6SMateusz Piotrowski.Sm on
956d5fcc4b6SMateusz Piotrowski.El
957d5fcc4b6SMateusz Piotrowski.Pp
958d5fcc4b6SMateusz PiotrowskiConfiguration options are defined as follows:
9599af3bcd7SPeter Grehan.Bl -tag -width 10n
960d5fcc4b6SMateusz Piotrowski.It Cm nmrr
961d5fcc4b6SMateusz PiotrowskiNominal Media Rotation Rate, known as RPM.
962d5fcc4b6SMateusz PiotrowskiValue 1 will indicate device as Solid State Disk.
963d5fcc4b6SMateusz PiotrowskiDefault value is 0, not report.
964d5fcc4b6SMateusz Piotrowski.It Cm ser
9659af3bcd7SPeter GrehanSerial Number with maximum 20 characters.
966d5fcc4b6SMateusz Piotrowski.It Cm rev
9679af3bcd7SPeter GrehanRevision Number with maximum 8 characters.
968d5fcc4b6SMateusz Piotrowski.It Cm model
9699af3bcd7SPeter GrehanModel Number with maximum 40 characters.
9709af3bcd7SPeter Grehan.El
971b30a7e54SChris Moerz.Ss HD Audio device backends
972061f37d2SMateusz Piotrowski.Bl -bullet
973061f37d2SMateusz Piotrowski.It
974061f37d2SMateusz Piotrowski.Sm off
975061f37d2SMateusz Piotrowski.Op Cm play= Ar playback
976061f37d2SMateusz Piotrowski.Op Cm ,rec= Ar recording
977061f37d2SMateusz Piotrowski.Sm on
978061f37d2SMateusz Piotrowski.El
979061f37d2SMateusz Piotrowski.Pp
980061f37d2SMateusz PiotrowskiConfiguration options are defined as follows:
98136f9f044SWarner Losh.Bl -tag -width 10n
982061f37d2SMateusz Piotrowski.It Cm play
98336f9f044SWarner LoshPlayback device, typically
98436f9f044SWarner Losh.Ar /dev/dsp0 .
985061f37d2SMateusz Piotrowski.It Cm rec
98636f9f044SWarner LoshRecording device, typically
98736f9f044SWarner Losh.Ar /dev/dsp0 .
98836f9f044SWarner Losh.El
989621b5090SJohn Baldwin.Sh CONFIGURATION VARIABLES
990621b5090SJohn Baldwin.Nm
991621b5090SJohn Baldwinuses an internal tree of configuration variables to describe global and
992621b5090SJohn Baldwinper-device settings.
993621b5090SJohn BaldwinWhen
994621b5090SJohn Baldwin.Nm
995621b5090SJohn Baldwinstarts,
996621b5090SJohn Baldwinit parses command line options (including config files) in the order given
997621b5090SJohn Baldwinon the command line.
998621b5090SJohn BaldwinEach command line option sets one or more configuration variables.
999621b5090SJohn BaldwinFor example,
1000621b5090SJohn Baldwinthe
1001621b5090SJohn Baldwin.Fl s
1002621b5090SJohn Baldwinoption creates a new tree node for a PCI device and sets one or more variables
1003621b5090SJohn Baldwinunder that node including the device model and device model-specific variables.
1004621b5090SJohn BaldwinVariables may be set multiple times during this parsing stage with the final
1005621b5090SJohn Baldwinvalue overriding previous values.
1006621b5090SJohn Baldwin.Pp
1007621b5090SJohn BaldwinOnce all of the command line options have been processed,
1008621b5090SJohn Baldwinthe configuration values are frozen.
1009621b5090SJohn Baldwin.Nm
1010621b5090SJohn Baldwinthen uses the value of configuration values to initialize device models
1011621b5090SJohn Baldwinand global settings.
1012621b5090SJohn Baldwin.Pp
1013621b5090SJohn BaldwinMore details on configuration variables can be found in
1014621b5090SJohn Baldwin.Xr bhyve_config 5 .
1015b30a7e54SChris Moerz.Sh CONFIGURATION FILE CREATION
1016b30a7e54SChris MoerzThe
1017b30a7e54SChris Moerz.Fl k
1018b30a7e54SChris Moerzflag allows one to provide a path to a configuration file holding all
1019b30a7e54SChris Moerzsettings, which otherwise would need to be defined by providing a long
1020b30a7e54SChris Moerzlist of program arguments to
1021b30a7e54SChris Moerz.Nm .
1022b30a7e54SChris Moerz.Pp
1023b30a7e54SChris MoerzThere is a very simple way to translate a complex set of program
1024b30a7e54SChris Moerzarguments to an equivalent configuration file in
1025b30a7e54SChris Moerz.Xr bhyve_config 5
1026b30a7e54SChris Moerzformat.
1027b30a7e54SChris Moerz.Pp
1028b30a7e54SChris MoerzUse
1029b30a7e54SChris Moerz.Fl o
1030b30a7e54SChris Moerz.Ar config.dump=1
1031b30a7e54SChris Moerzto make
1032b30a7e54SChris Moerz.Nm
1033b30a7e54SChris Moerzdump a configuration file representing the used flags and arguments to
1034b30a7e54SChris Moerzstdout. You can pipe the output into a file to persist the generated settings.
1035b30a7e54SChris Moerz.Pp
1036b30a7e54SChris MoerzMake sure to remove the
1037b30a7e54SChris Moerz.Ar config.dump
1038b30a7e54SChris Moerzline from the resulting configuration file before using it to start
1039b30a7e54SChris Moerz.Nm .
1040cd377eb3SJohn Baldwin.Sh DEBUG SERVER
1041cd377eb3SJohn BaldwinThe current debug server provides limited support for debuggers.
1042cd377eb3SJohn Baldwin.Ss Registers
1043cd377eb3SJohn BaldwinEach virtual CPU is exposed to the debugger as a thread.
1044cd377eb3SJohn Baldwin.Pp
1045cd377eb3SJohn BaldwinGeneral purpose registers can be queried for each virtual CPU, but other
1046cd377eb3SJohn Baldwinregisters such as floating-point and system registers cannot be queried.
1047cd377eb3SJohn Baldwin.Ss Memory
1048a3b3e89fSBenedict ReuschlingMemory (including memory mapped I/O regions) can be read and written
1049a3b3e89fSBenedict Reuschlingby the debugger.
1050a3b3e89fSBenedict ReuschlingMemory operations use virtual addresses that are resolved to physical
1051a3b3e89fSBenedict Reuschlingaddresses via the current virtual CPU's active address translation.
1052cd377eb3SJohn Baldwin.Ss Control
1053cd377eb3SJohn BaldwinThe running guest can be interrupted by the debugger at any time
1054cd377eb3SJohn Baldwin.Pq for example, by pressing Ctrl-C in the debugger .
1055cd377eb3SJohn Baldwin.Pp
1056cd377eb3SJohn BaldwinSingle stepping is only supported on Intel CPUs supporting the MTRAP VM exit.
1057cd377eb3SJohn Baldwin.Pp
1058cbd03a9dSJohn BaldwinBreakpoints are supported on Intel CPUs that support single stepping.
1059cbd03a9dSJohn BaldwinNote that continuing from a breakpoint while interrupts are enabled in the
1060cbd03a9dSJohn Baldwinguest may not work as expected due to timer interrupts firing while single
1061cbd03a9dSJohn Baldwinstepping over the breakpoint.
1062c2202d41SRoman Bogorodskiy.Sh SIGNAL HANDLING
1063c2202d41SRoman Bogorodskiy.Nm
1064c2202d41SRoman Bogorodskiydeals with the following signals:
1065c2202d41SRoman Bogorodskiy.Pp
10663357e948SMateusz Piotrowski.Bl -tag -width SIGTERM -compact
1067c2202d41SRoman Bogorodskiy.It SIGTERM
1068c2202d41SRoman BogorodskiyTrigger ACPI poweroff for a VM
1069c2202d41SRoman Bogorodskiy.El
1070c2202d41SRoman Bogorodskiy.Sh EXIT STATUS
1071c2202d41SRoman BogorodskiyExit status indicates how the VM was terminated:
1072c2202d41SRoman Bogorodskiy.Pp
1073c2202d41SRoman Bogorodskiy.Bl -tag -width indent -compact
1074c2202d41SRoman Bogorodskiy.It 0
1075c2202d41SRoman Bogorodskiyrebooted
1076c2202d41SRoman Bogorodskiy.It 1
1077c2202d41SRoman Bogorodskiypowered off
1078c2202d41SRoman Bogorodskiy.It 2
1079c2202d41SRoman Bogorodskiyhalted
1080c2202d41SRoman Bogorodskiy.It 3
1081c2202d41SRoman Bogorodskiytriple fault
1082989e062bSMarcelo Araujo.It 4
1083989e062bSMarcelo Araujoexited due to an error
1084c2202d41SRoman Bogorodskiy.El
1085b13e60daSPeter Grehan.Sh EXAMPLES
10865c3ec676SGleb SmirnoffIf not using a boot ROM, the guest operating system must have been loaded with
108784fe889cSChristian Brueffer.Xr bhyveload 8
1088b13e60daSPeter Grehanor a similar boot loader before
1089b13e60daSPeter Grehan.Xr bhyve 4
1090b13e60daSPeter Grehancan be run.
10915c3ec676SGleb SmirnoffOtherwise, the boot loader is not needed.
1092b13e60daSPeter Grehan.Pp
1093b13e60daSPeter GrehanTo run a virtual machine with 1GB of memory, two virtual CPUs, a virtio
1094b13e60daSPeter Grehanblock device backed by the
1095b13e60daSPeter Grehan.Pa /my/image
1096b13e60daSPeter Grehanfilesystem image, and a serial port for the console:
1097b13e60daSPeter Grehan.Bd -literal -offset indent
1098b13e60daSPeter Grehanbhyve -c 2 -s 0,hostbridge -s 1,lpc -s 2,virtio-blk,/my/image \\
109910758471SMark Johnston  -l com1,stdio -H -P -m 1G vm1
1100b13e60daSPeter Grehan.Ed
1101b13e60daSPeter Grehan.Pp
110271b2ba90SMark JohnstonTo do the same on arm64:
110371b2ba90SMark Johnston.Bd -literal -offset indent
110471b2ba90SMark Johnston.Ed
110571b2ba90SMark Johnstonbhyve -c 2 -s 0,hostbridge -s 1,virtio-blk,/my/image -o console=stdio \\
110671b2ba90SMark Johnston  -o bootrom=/usr/local/share/u-boot/u-boot-bhyve-arm64/u-boot.bin -m 1G vm1
110771b2ba90SMark Johnston.Pp
1108b13e60daSPeter GrehanRun a 24GB single-CPU virtual machine with three network ports, one of which
1109b13e60daSPeter Grehanhas a MAC address specified:
1110b13e60daSPeter Grehan.Bd -literal -offset indent
1111b13e60daSPeter Grehanbhyve -s 0,hostbridge -s 1,lpc -s 2:0,virtio-net,tap0 \\
1112b13e60daSPeter Grehan  -s 2:1,virtio-net,tap1 \\
1113b13e60daSPeter Grehan  -s 2:2,virtio-net,tap2,mac=00:be:fa:76:45:00 \\
1114b13e60daSPeter Grehan  -s 3,virtio-blk,/my/image -l com1,stdio \\
111510758471SMark Johnston  -H -P -m 24G bigvm
1116b13e60daSPeter Grehan.Ed
1117b13e60daSPeter Grehan.Pp
1118b13e60daSPeter GrehanRun an 8GB quad-CPU virtual machine with 8 AHCI SATA disks, an AHCI ATAPI
1119b13e60daSPeter GrehanCD-ROM, a single virtio network port, an AMD hostbridge, and the console
1120b13e60daSPeter Grehanport connected to an
1121b13e60daSPeter Grehan.Xr nmdm 4
112284fe889cSChristian Brueffernull-modem device.
1123b13e60daSPeter Grehan.Bd -literal -offset indent
1124a7ab1463SAlexander Motinbhyve -c 4 \\
1125b13e60daSPeter Grehan  -s 0,amd_hostbridge -s 1,lpc \\
1126098f5155SAlexander Motin  -s 1:0,ahci,hd:/images/disk.1,hd:/images/disk.2,\\
1127098f5155SAlexander Motinhd:/images/disk.3,hd:/images/disk.4,\\
1128098f5155SAlexander Motinhd:/images/disk.5,hd:/images/disk.6,\\
1129098f5155SAlexander Motinhd:/images/disk.7,hd:/images/disk.8,\\
1130098f5155SAlexander Motincd:/images/install.iso \\
1131b13e60daSPeter Grehan  -s 3,virtio-net,tap0 \\
1132b13e60daSPeter Grehan  -l com1,/dev/nmdm0A \\
113310758471SMark Johnston  -H -P -m 8G
1134b13e60daSPeter Grehan.Ed
11355c3ec676SGleb Smirnoff.Pp
11365c3ec676SGleb SmirnoffRun a UEFI virtual machine with a display resolution of 800 by 600 pixels
11371f903953SSHENG-YI HONGthat can be accessed via VNC at: 0.0.0.0:5900 or via serial console over
11381f903953SSHENG-YI HONGTCP at: 127.0.0.1:1234 (unsafe if you expose serial console without protection).
11395c3ec676SGleb Smirnoff.Bd -literal -offset indent
11405c3ec676SGleb Smirnoffbhyve -c 2 -m 4G -w -H \\
11415c3ec676SGleb Smirnoff  -s 0,hostbridge \\
11425c3ec676SGleb Smirnoff  -s 3,ahci-cd,/path/to/uefi-OS-install.iso \\
11435c3ec676SGleb Smirnoff  -s 4,ahci-hd,disk.img \\
11445c3ec676SGleb Smirnoff  -s 5,virtio-net,tap0 \\
11455c3ec676SGleb Smirnoff  -s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \\
11465c3ec676SGleb Smirnoff  -s 30,xhci,tablet \\
11471f903953SSHENG-YI HONG  -s 31,lpc -l com1,tcp=127.0.0.1:1234 \\
11485c3ec676SGleb Smirnoff  -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\
11495c3ec676SGleb Smirnoff   uefivm
11505c3ec676SGleb Smirnoff.Ed
11518883128bSBjoern A. Zeeb.Pp
11528883128bSBjoern A. ZeebRun a UEFI virtual machine with a VNC display that is bound to all IPv6
11531f903953SSHENG-YI HONGaddresses on port 5900 and a serial I/O port bound to TCP port 1234 of
11541f903953SSHENG-YI HONGloopback address (unsafe if you expose serial console without protection).
11558883128bSBjoern A. Zeeb.Bd -literal -offset indent
11568883128bSBjoern A. Zeebbhyve -c 2 -m 4G -w -H \\
11578883128bSBjoern A. Zeeb  -s 0,hostbridge \\
11588883128bSBjoern A. Zeeb  -s 4,ahci-hd,disk.img \\
11598883128bSBjoern A. Zeeb  -s 5,virtio-net,tap0 \\
11608883128bSBjoern A. Zeeb  -s 29,fbuf,tcp=[::]:5900,w=800,h=600 \\
11618883128bSBjoern A. Zeeb  -s 30,xhci,tablet \\
11621f903953SSHENG-YI HONG  -s 31,lpc -l com1,tcp=[::1]:1234 \\
11638883128bSBjoern A. Zeeb  -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\
11648883128bSBjoern A. Zeeb   uefivm
11658883128bSBjoern A. Zeeb.Ed
1166866036f4SRebecca Cran.Pp
1167866036f4SRebecca CranRun a UEFI virtual machine with a VARS file to save EFI variables.
1168866036f4SRebecca CranNote that
1169866036f4SRebecca Cran.Nm
1170866036f4SRebecca Cranwill write guest modifications to the given VARS file.
1171866036f4SRebecca CranBe sure to create a per-guest copy of the template VARS file from
1172866036f4SRebecca Cran.Pa /usr .
1173866036f4SRebecca Cran.Bd -literal -offset indent
1174866036f4SRebecca Cranbhyve -c 2 -m 4g -w -H \\
1175866036f4SRebecca Cran  -s 0,hostbridge \\
117666659955SAlexey Marchenko  -s 31,lpc -l com1,stdio \\
1177866036f4SRebecca Cran  -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd,BHYVE_UEFI_VARS.fd
1178866036f4SRebecca Cran   uefivm
1179866036f4SRebecca Cran.Ed
1180b30a7e54SChris Moerz.Pp
1181b30a7e54SChris MoerzTo create a configuration file
1182b30a7e54SChris Moerz.Pa configfile
1183b30a7e54SChris Moerzfor a virtual machine, use
1184b30a7e54SChris Moerz.Fl o
1185b30a7e54SChris Moerz.Ar config.dump=1 :
1186b30a7e54SChris Moerz.Bd -literal -offset indent
1187abdc7bb7SLi-Wen Hsu/usr/sbin/bhyve -c 2 -m 256 -H -P \\
1188b30a7e54SChris Moerz  -s 0:0,hostbridge -s 1:0,virtio-net,tap0 \\
1189b30a7e54SChris Moerz  -s 2:0,ahci-hd,./vm0.img \\
1190b30a7e54SChris Moerz  -s 31,lpc -l com1,stdio \\
1191b30a7e54SChris Moerz  -o config.dump=1 vm0 > configfile
1192b30a7e54SChris Moerz.Ed
1193b30a7e54SChris Moerz.Pp
1194b30a7e54SChris MoerzThen use an editor of your choice to remove the line "config.dump=1"
1195b30a7e54SChris Moerzfrom the newly generated
1196b30a7e54SChris Moerz.Pa configfile .
1197b30a7e54SChris Moerz.Pp
1198b30a7e54SChris MoerzTo start
1199b30a7e54SChris Moerz.Nm
1200b30a7e54SChris Moerzusing this configuration file, use flag
1201b30a7e54SChris Moerz.Fl k :
1202b30a7e54SChris Moerz.Bd -literal -offset indent
1203b30a7e54SChris Moerz/usr/sbin/bhyve -k configfile vm0
1204b30a7e54SChris Moerz.Ed
1205b13e60daSPeter Grehan.Sh SEE ALSO
1206b13e60daSPeter Grehan.Xr bhyve 4 ,
1207e90337e4SAleksandr Fedorov.Xr netgraph 4 ,
1208e90337e4SAleksandr Fedorov.Xr ng_socket 4 ,
1209b13e60daSPeter Grehan.Xr nmdm 4 ,
1210b13e60daSPeter Grehan.Xr vmm 4 ,
1211621b5090SJohn Baldwin.Xr bhyve_config 5 ,
1212b13e60daSPeter Grehan.Xr ethers 5 ,
121305f7cd8bSJoel Dahl.Xr bhyvectl 8 ,
121405f7cd8bSJoel Dahl.Xr bhyveload 8
12158d56c805SYuri Pankov.Pp
12168d56c805SYuri Pankov.Rs
12178d56c805SYuri Pankov.%A Intel
12188d56c805SYuri Pankov.%B 64 and IA-32 Architectures Software Developer’s Manual
12198d56c805SYuri Pankov.%V Volume 3
12208d56c805SYuri Pankov.Re
1221b13e60daSPeter Grehan.Sh HISTORY
1222b13e60daSPeter Grehan.Nm
1223b13e60daSPeter Grehanfirst appeared in
1224b13e60daSPeter Grehan.Fx 10.0 .
1225b13e60daSPeter Grehan.Sh AUTHORS
122601c2b8acSBaptiste Daroussin.An Neel Natu Aq Mt neel@freebsd.org
122701c2b8acSBaptiste Daroussin.An Peter Grehan Aq Mt grehan@freebsd.org
1228