]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/bhyve/bhyve.8
Add UPDATING entries and bump version.
[FreeBSD/FreeBSD.git] / usr.sbin / bhyve / bhyve.8
1 .\" Copyright (c) 2013 Peter Grehan
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd April 18, 2021
28 .Dt BHYVE 8
29 .Os
30 .Sh NAME
31 .Nm bhyve
32 .Nd "run a guest operating system inside a virtual machine"
33 .Sh SYNOPSIS
34 .Nm
35 .Op Fl AabCeHhPSuWwxY
36 .Oo
37 .Sm off
38 .Fl c\~
39 .Oo
40 .Op Cm cpus=
41 .Ar numcpus
42 .Oc
43 .Op Cm ,sockets= Ar n
44 .Op Cm ,cores= Ar n
45 .Op Cm ,threads= Ar n
46 .Oc
47 .Sm on
48 .Op Fl G Ar port
49 .Op Fl g Ar gdbport
50 .Oo Fl l
51 .Sm off
52 .Ar lpcdev Op Cm \&, Ar conf
53 .Sm on
54 .Oc
55 .Oo Fl m
56 .Sm off
57 .Ar memsize
58 .Oo
59 .Cm K | Cm k | Cm M | Cm m | Cm G | Cm g | Cm T | Cm t
60 .Oc
61 .Sm on
62 .Oc
63 .Op Fl p Ar vcpu Ns Cm \&: Ns Ar hostcpu
64 .Sm off
65 .Oo Fl s\~
66 .Ar slot Cm \&, Ar emulation Op Cm \&, Ar conf
67 .Sm on
68 .Oc
69 .Op Fl U Ar uuid
70 .Ar vmname
71 .Nm
72 .Fl l Cm help
73 .Nm
74 .Fl s Cm help
75 .Sh DESCRIPTION
76 .Nm
77 is a hypervisor that runs guest operating systems inside a
78 virtual machine.
79 .Pp
80 Parameters such as the number of virtual CPUs, amount of guest memory, and
81 I/O connectivity can be specified with command-line parameters.
82 .Pp
83 If not using a boot ROM, the guest operating system must be loaded with
84 .Xr bhyveload 8
85 or a similar boot loader before running
86 .Nm ,
87 otherwise, it is enough to run
88 .Nm
89 with a boot ROM of choice.
90 .Pp
91 .Nm
92 runs until the guest operating system reboots or an unhandled hypervisor
93 exit is detected.
94 .Sh OPTIONS
95 .Bl -tag -width 10n
96 .It Fl A
97 Generate ACPI tables.
98 Required for
99 .Fx Ns /amd64
100 guests.
101 .It Fl a
102 The guest's local APIC is configured in xAPIC mode.
103 The xAPIC mode is the default setting so this option is redundant.
104 It will be deprecated in a future version.
105 .It Fl b
106 Enable a low-level console device supported by
107 .Fx
108 kernels compiled with
109 .Cd "device bvmconsole" .
110 This option is deprecated and will be removed in
111 .Fx 13.0 .
112 .It Fl C
113 Include guest memory in core file.
114 .It Fl c Op Ar setting ...
115 Number of guest virtual CPUs
116 and/or the CPU topology.
117 The default value for each of
118 .Ar numcpus ,
119 .Ar sockets ,
120 .Ar cores ,
121 and
122 .Ar threads
123 is 1.
124 The current maximum number of guest virtual CPUs is 16.
125 If
126 .Ar numcpus
127 is not specified then it will be calculated from the other arguments.
128 The topology must be consistent in that the
129 .Ar numcpus
130 must equal the product of
131 .Ar sockets ,
132 .Ar cores ,
133 and
134 .Ar threads .
135 If a
136 .Ar setting
137 is specified more than once the last one has precedence.
138 .It Fl D
139 Destroy the VM on guest initiated power-off.
140 .It Fl e
141 Force
142 .Nm
143 to exit when a guest issues an access to an I/O port that is not emulated.
144 This is intended for debug purposes.
145 .It Fl G Ar port
146 Start a debug server that uses the GDB protocol to export guest state to a
147 debugger.
148 An IPv4 TCP socket will be bound to the supplied
149 .Ar port
150 to listen for debugger connections.
151 Only a single debugger may be attached to the debug server at a time.
152 If
153 .Ar port
154 begins with
155 .Sq w ,
156 .Nm
157 will pause execution at the first instruction waiting for a debugger to attach.
158 .It Fl g Ar gdbport
159 For
160 .Fx
161 kernels compiled with
162 .Cd "device bvmdebug" ,
163 allow a remote kernel kgdb to be relayed to the guest kernel gdb stub
164 via a local IPv4 address and this port.
165 This option is deprecated and will be removed in
166 .Fx 13.0 .
167 .It Fl H
168 Yield the virtual CPU thread when a HLT instruction is detected.
169 If this option is not specified, virtual CPUs will use 100% of a host CPU.
170 .It Fl h
171 Print help message and exit.
172 .It Fl k Ar file
173 Set configuration variables from a simple, key-value config file.
174 Each line of the config file is expected to consist of a config variable
175 name, an equals sign
176 .Pq Sq = ,
177 and a value.
178 No spaces are permitted between the variable name, equals sign, or
179 value.
180 Blank lines and lines starting with
181 .Sq #
182 are ignored.
183 .It Fl l Cm help
184 Print a list of supported LPC devices.
185 .It Fl l Ar lpcdev Ns Op Cm \&, Ns Ar conf
186 Allow devices behind the LPC PCI-ISA bridge to be configured.
187 The only supported devices are the TTY-class devices
188 .Ar com1
189 and
190 .Ar com2 ,
191 the boot ROM device
192 .Cm bootrom ,
193 and the debug/test device
194 .Cm pc-testdev .
195 .Pp
196 The possible values for the
197 .Ar conf
198 argument are listed in the
199 .Fl s
200 flag description.
201 .It Xo
202 .Fl m Ar memsize Ns Oo
203 .Sm off
204 .Cm K | k | M | m | G | g | T | t
205 .Sm on
206 .Oc
207 .Xc
208 Set the guest physical memory size
209 This must be the same size that was given to
210 .Xr bhyveload 8 .
211 .Pp
212 The size argument may be suffixed with one of
213 .Cm K , M , G
214 or
215 .Cm T
216 (either upper or lower case)
217 to indicate a multiple of kilobytes, megabytes, gigabytes, or terabytes.
218 If no suffix is given, the value is assumed to be in megabytes.
219 .Pp
220 The default is 256M.
221 .It Fl o Ar var Ns Cm = Ns Ar value
222 Set the configuration variable
223 .Ar var
224 to
225 .Ar value .
226 .It Fl P
227 Force the guest virtual CPU to exit when a PAUSE instruction is detected.
228 .It Fl p Ar vcpu Ns Cm \& : Ns Ar hostcpu
229 Pin guest's virtual CPU
230 .Em vcpu
231 to
232 .Em hostcpu .
233 .It Fl P
234 Force the guest virtual CPU to exit when a PAUSE instruction is detected.
235 .It Fl S
236 Wire guest memory.
237 .It Fl s Cm help
238 Print a list of supported PCI devices.
239 .It Fl s Ar slot Ns Cm \&, Ns Ar emulation Ns Op Cm \&, Ns Ar conf
240 Configure a virtual PCI slot and function.
241 .Pp
242 .Nm
243 provides PCI bus emulation and virtual devices that can be attached to
244 slots on the bus.
245 There are 32 available slots, with the option of providing up to 8 functions
246 per slot.
247 .Pp
248 The
249 .Ar slot
250 can be specified in one of the following formats:
251 .Pp
252 .Bl -bullet -compact
253 .It
254 .Ar pcislot
255 .It
256 .Sm off
257 .Ar pcislot Cm \&: Ar function
258 .Sm on
259 .It
260 .Sm off
261 .Ar bus Cm \&: Ar pcislot Cm \&: Ar function
262 .Sm on
263 .El
264 .Pp
265 The
266 .Ar pcislot
267 value is 0 to 31.
268 The optional
269 .Ar function
270 value is 0 to 7.
271 The optional
272 .Ar bus
273 value is 0 to 255.
274 If not specified, the
275 .Ar function
276 value defaults to 0.
277 If not specified, the
278 .Ar bus
279 value defaults to 0.
280 .Pp
281 The
282 .Ar emulation
283 argument
284 can be one of the following:
285 .Bl -tag -width "amd_hostbridge"
286 .It Cm hostbridge
287 A simple host bridge.
288 This is usually configured at slot 0, and is required by most guest
289 operating systems.
290 .It Cm amd_hostbridge
291 Emulation identical to
292 .Cm hostbridge
293 using a PCI vendor ID of AMD.
294 .It Cm passthru
295 PCI pass-through device.
296 .It Cm virtio-net
297 Virtio network interface.
298 .It Cm virtio-blk
299 Virtio block storage interface.
300 .It Cm virtio-scsi
301 Virtio SCSI interface.
302 .It Cm virtio-rnd
303 Virtio RNG interface.
304 .It Cm virtio-console
305 Virtio console interface, which exposes multiple ports
306 to the guest in the form of simple char devices for simple IO
307 between the guest and host userspaces.
308 .It Cm ahci
309 AHCI controller attached to arbitrary devices.
310 .It Cm ahci-cd
311 AHCI controller attached to an ATAPI CD/DVD.
312 .It Cm ahci-hd
313 AHCI controller attached to a SATA hard drive.
314 .It Cm e1000
315 Intel e82545 network interface.
316 .It Cm uart
317 PCI 16550 serial device.
318 .It Cm lpc
319 LPC PCI-ISA bridge with COM1, COM2, and 16550 serial ports,
320 a boot ROM, and,
321 optionally, the debug/test device.
322 The LPC bridge emulation can only be configured on bus 0.
323 .It Cm fbuf
324 Raw framebuffer device attached to VNC server.
325 .It Cm xhci
326 eXtensible Host Controller Interface (xHCI) USB controller.
327 .It Cm nvme
328 NVM Express (NVMe) controller.
329 .El
330 .Pp
331 The optional parameter
332 .Ar conf
333 describes the backend for device emulations.
334 If
335 .Ar conf
336 is not specified, the device emulation has no backend and can be
337 considered unconnected.
338 .Pp
339 Network device backends:
340 .Sm off
341 .Bl -bullet
342 .It
343 .Xo
344 .Cm tap Ar N
345 .Op Cm \&,mac= Ar xx:xx:xx:xx:xx:xx
346 .Op Cm \&,mtu= Ar N
347 .Xc
348 .It
349 .Xo
350 .Cm vmnet Ar N
351 .Op Cm \&,mac= Ar xx:xx:xx:xx:xx:xx
352 .Op Cm \&,mtu= Ar N
353 .Xc
354 .El
355 .Sm on
356 .Pp
357 With
358 .Cm virtio-net
359 devices, the
360 .Cm mtu
361 parameter can be specified to inform the guest about the largest MTU
362 that should be allowed, expressed in bytes.
363 .Pp
364 Block storage device backends:
365 .Sm off
366 .Bl -bullet
367 .It
368 .Ar /filename Op Cm \&, Ar block-device-options
369 .It
370 .Ar /dev/xxx Op Cm \&, Ar block-device-options
371 .El
372 .Sm on
373 .Pp
374 The
375 .Ar block-device-options
376 are:
377 .Bl -tag -width 10n
378 .It Cm nocache
379 Open the file with
380 .Dv O_DIRECT .
381 .It Cm direct
382 Open the file using
383 .Dv O_SYNC .
384 .It Cm ro
385 Force the file to be opened read-only.
386 .It Cm sectorsize= Ns Ar logical Ns Oo Cm \&/ Ns Ar physical Oc
387 Specify the logical and physical sector sizes of the emulated disk.
388 The physical sector size is optional and is equal to the logical sector size
389 if not explicitly specified.
390 .El
391 .Pp
392 SCSI device backends:
393 .Sm off
394 .Bl -bullet
395 .It
396 .Pa /dev/cam/ctl Oo Ar pp Cm \&. Ar vp Oc Oo Cm \&, Ar scsi-device-options Oc
397 .El
398 .Sm on
399 .Pp
400 The
401 .Ar scsi-device-options
402 are:
403 .Bl -tag -width 10n
404 .It Cm iid= Ns Ar IID
405 Initiator ID to use when sending requests to specified CTL port.
406 The default value is 0.
407 .El
408 .Pp
409 TTY device backends:
410 .Bl -tag -width 10n
411 .It Cm stdio
412 Connect the serial port to the standard input and output of
413 the
414 .Nm
415 process.
416 .It Ar /dev/xxx
417 Use the host TTY device for serial port I/O.
418 .El
419 .Pp
420 Boot ROM device backends:
421 .Bl -tag -width 10n
422 .It Ar romfile
423 Map
424 .Ar romfile
425 in the guest address space reserved for boot firmware.
426 .El
427 .Pp
428 Pass-through device backends:
429 .Bl -tag -width 10n
430 .It Ns Ar slot Ns Cm \&/ Ns Ar bus Ns Cm \&/ Ns Ar function
431 Connect to a PCI device on the host at the selector described by
432 .Ar slot ,
433 .Ar bus ,
434 and
435 .Ar function
436 numbers.
437 .El
438 .Pp
439 Guest memory must be wired using the
440 .Fl S
441 option when a pass-through device is configured.
442 .Pp
443 The host device must have been reserved at boot-time using the
444 .Va pptdevs
445 loader variable as described in
446 .Xr vmm 4 .
447 .Pp
448 Virtio console device backends:
449 .Bl -bullet
450 .Sm off
451 .It
452 .Cm port1= Ns Ar /path/to/port1.sock Ns Op Cm ,port Ns Ar N Cm \&= Ns Ar /path/to/port2.sock No \~ Ar ...
453 .Sm on
454 .El
455 .Pp
456 A maximum of 16 ports per device can be created.
457 Every port is named and corresponds to a Unix domain socket created by
458 .Nm .
459 .Nm
460 accepts at most one connection per port at a time.
461 .Pp
462 Limitations:
463 .Bl -bullet
464 .It
465 Due to lack of destructors in
466 .Nm ,
467 sockets on the filesystem must be cleaned up manually after
468 .Nm
469 exits.
470 .It
471 There is no way to use the
472 .Dq console port
473 feature, nor the console port
474 resize at present.
475 .It
476 Emergency write is advertised, but no-op at present.
477 .El
478 .Pp
479 Framebuffer devices backends:
480 .Bl -bullet
481 .Sm off
482 .It
483 .Op Cm rfb= Ar ip-and-port
484 .Op Cm ,w= Ar width
485 .Op Cm ,h= Ar height
486 .Op Cm ,vga= Ar vgaconf
487 .Op Cm ,wait
488 .Op Cm ,password= Ar password
489 .Sm on
490 .El
491 .Pp
492 Configuration options are defined as follows:
493 .Bl -tag -width 10n
494 .It Cm rfb= Ns Ar ip-and-port Pq or Cm tcp= Ns Ar ip-and-port
495 An IP address and a port VNC should listen on.
496 There are two formats:
497 .Pp
498 .Bl -bullet -compact
499 .It
500 .Sm off
501 .Op Ar IPv4 Cm \&:
502 .Ar port
503 .Sm on
504 .It
505 .Sm off
506 .Cm \&[ Ar IPv6%zone Cm \&] Cm \&: Ar port
507 .Sm on
508 .El
509 .Pp
510 The default is to listen on localhost IPv4 address and default VNC port 5900.
511 An IPv6 address must be enclosed in square brackets and may contain an
512 optional zone identifier.
513 .It Cm w= Ns Ar width No and Cm h= Ns Ar height
514 A display resolution, width and height, respectively.
515 If not specified, a default resolution of 1024x768 pixels will be used.
516 Minimal supported resolution is 640x480 pixels,
517 and maximum is 1920x1200 pixels.
518 .It Cm vga= Ns Ar vgaconf
519 Possible values for this option are
520 .Cm io
521 (default),
522 .Cm on
523 , and
524 .Cm off .
525 PCI graphics cards have a dual personality in that they are
526 standard PCI devices with BAR addressing, but may also
527 implicitly decode legacy VGA I/O space
528 .Pq Ad 0x3c0-3df
529 and memory space
530 .Pq 64KB at Ad 0xA0000 .
531 The default
532 .Cm io
533 option should be used for guests that attempt to issue BIOS calls which result
534 in I/O port queries, and fail to boot if I/O decode is disabled.
535 .Pp
536 The
537 .Cm on
538 option should be used along with the CSM BIOS capability in UEFI
539 to boot traditional BIOS guests that require the legacy VGA I/O and
540 memory regions to be available.
541 .Pp
542 The
543 .Cm off
544 option should be used for the UEFI guests that assume that
545 VGA adapter is present if they detect the I/O ports.
546 An example of such a guest is
547 .Ox
548 in UEFI mode.
549 .Pp
550 Please refer to the
551 .Nm
552 .Fx
553 wiki page
554 .Pq Lk https://wiki.freebsd.org/bhyve
555 for configuration notes of particular guests.
556 .It Cm wait
557 Instruct
558 .Nm
559 to only boot upon the initiation of a VNC connection, simplifying the
560 installation of operating systems that require immediate keyboard input.
561 This can be removed for post-installation use.
562 .It Cm password= Ns Ar password
563 This type of authentication is known to be cryptographically weak and is not
564 intended for use on untrusted networks.
565 Many implementations will want to use stronger security, such as running
566 the session over an encrypted channel provided by IPsec or SSH.
567 .El
568 .Pp
569 xHCI USB device backends:
570 .Bl -tag -width 10n
571 .It Cm tablet
572 A USB tablet device which provides precise cursor synchronization
573 when using VNC.
574 .El
575 .Pp
576 NVMe device backends:
577 .Bl -bullet
578 .Sm off
579 .It
580 .Ar devpath
581 .Op Cm ,maxq= Ar #
582 .Op Cm ,qsz= Ar #
583 .Op Cm ,ioslots= Ar #
584 .Op Cm ,sectsz= Ar #
585 .Op Cm ,ser= Ar #
586 .Op Cm ,eui64= Ar #
587 .Op Cm ,dsm= Ar opt
588 .Sm on
589 .El
590 .Pp
591 Configuration options are defined as follows:
592 .Bl -tag -width 10n
593 .It Ar devpath
594 Accepted device paths are:
595 .Ar /dev/blockdev
596 or
597 .Ar /path/to/image
598 or
599 .Cm ram= Ns Ar size_in_MiB .
600 .It Cm maxq
601 Max number of queues.
602 .It Cm qsz
603 Max elements in each queue.
604 .It Cm ioslots
605 Max number of concurrent I/O requests.
606 .It Cm sectsz
607 Sector size (defaults to blockif sector size).
608 .It Cm ser
609 Serial number with maximum 20 characters.
610 .It Cm eui64
611 IEEE Extended Unique Identifier (8 byte value).
612 .It Cm dsm
613 DataSet Management support.
614 Supported values are:
615 .Cm auto , enable ,
616 and
617 .Cm disable .
618 .El
619 .Pp
620 AHCI device backends:
621 .Bl -bullet
622 .It
623 .Sm off
624 .Op Oo Cm hd\&: | cd\&: Oc Ar path
625 .Op Cm ,nmrr= Ar nmrr
626 .Op Cm ,ser= Ar #
627 .Op Cm ,rev= Ar #
628 .Op Cm ,model= Ar #
629 .Sm on
630 .El
631 .Pp
632 Configuration options are defined as follows:
633 .Bl -tag -width 10n
634 .It Cm nmrr
635 Nominal Media Rotation Rate, known as RPM.
636 Value 1 will indicate device as Solid State Disk.
637 Default value is 0, not report.
638 .It Cm ser
639 Serial Number with maximum 20 characters.
640 .It Cm rev
641 Revision Number with maximum 8 characters.
642 .It Cm model
643 Model Number with maximum 40 characters.
644 .El
645 .Pp
646 HD Audio device backends:
647 .Bl -bullet
648 .It
649 .Sm off
650 .Op Cm play= Ar playback
651 .Op Cm ,rec= Ar recording
652 .Sm on
653 .El
654 .Pp
655 Configuration options are defined as follows:
656 .Bl -tag -width 10n
657 .It Cm play
658 Playback device, typically
659 .Ar /dev/dsp0 .
660 .It Cm rec
661 Recording device, typically
662 .Ar /dev/dsp0 .
663 .El
664 .It Fl U Ar uuid
665 Set the universally unique identifier
666 .Pq UUID
667 in the guest's System Management BIOS System Information structure.
668 By default a UUID is generated from the host's hostname and
669 .Ar vmname .
670 .It Fl u
671 RTC keeps UTC time.
672 .It Fl W
673 Force virtio PCI device emulations to use MSI interrupts instead of MSI-X
674 interrupts.
675 .It Fl w
676 Ignore accesses to unimplemented Model Specific Registers (MSRs).
677 This is intended for debug purposes.
678 .It Fl x
679 The guest's local APIC is configured in x2APIC mode.
680 .It Fl Y
681 Disable MPtable generation.
682 .It Ar vmname
683 Alphanumeric name of the guest.
684 This should be the same as that created by
685 .Xr bhyveload 8 .
686 .El
687 .Sh DEBUG SERVER
688 The current debug server provides limited support for debuggers.
689 .Ss Registers
690 Each virtual CPU is exposed to the debugger as a thread.
691 .Pp
692 General purpose registers can be queried for each virtual CPU, but other
693 registers such as floating-point and system registers cannot be queried.
694 .Ss Memory
695 Memory (including memory mapped I/O regions) can be read by the debugger,
696 but not written.
697 Memory operations use virtual addresses that are resolved to physical addresses
698 via the current virtual CPU's active address translation.
699 .Ss Control
700 The running guest can be interrupted by the debugger at any time
701 .Pq for example, by pressing Ctrl-C in the debugger .
702 .Pp
703 Single stepping is only supported on Intel CPUs supporting the MTRAP VM exit.
704 .Pp
705 Breakpoints are supported on Intel CPUs that support single stepping.
706 Note that continuing from a breakpoint while interrupts are enabled in the
707 guest may not work as expected due to timer interrupts firing while single
708 stepping over the breakpoint.
709 .Sh SIGNAL HANDLING
710 .Nm
711 deals with the following signals:
712 .Pp
713 .Bl -tag -width SIGTERM -compact
714 .It SIGTERM
715 Trigger ACPI poweroff for a VM
716 .El
717 .Sh EXIT STATUS
718 Exit status indicates how the VM was terminated:
719 .Pp
720 .Bl -tag -width indent -compact
721 .It 0
722 rebooted
723 .It 1
724 powered off
725 .It 2
726 halted
727 .It 3
728 triple fault
729 .It 4
730 exited due to an error
731 .El
732 .Sh EXAMPLES
733 If not using a boot ROM, the guest operating system must have been loaded with
734 .Xr bhyveload 8
735 or a similar boot loader before
736 .Xr bhyve 4
737 can be run.
738 Otherwise, the boot loader is not needed.
739 .Pp
740 To run a virtual machine with 1GB of memory, two virtual CPUs, a virtio
741 block device backed by the
742 .Pa /my/image
743 filesystem image, and a serial port for the console:
744 .Bd -literal -offset indent
745 bhyve -c 2 -s 0,hostbridge -s 1,lpc -s 2,virtio-blk,/my/image \\
746   -l com1,stdio -A -H -P -m 1G vm1
747 .Ed
748 .Pp
749 Run a 24GB single-CPU virtual machine with three network ports, one of which
750 has a MAC address specified:
751 .Bd -literal -offset indent
752 bhyve -s 0,hostbridge -s 1,lpc -s 2:0,virtio-net,tap0 \\
753   -s 2:1,virtio-net,tap1 \\
754   -s 2:2,virtio-net,tap2,mac=00:be:fa:76:45:00 \\
755   -s 3,virtio-blk,/my/image -l com1,stdio \\
756   -A -H -P -m 24G bigvm
757 .Ed
758 .Pp
759 Run an 8GB quad-CPU virtual machine with 8 AHCI SATA disks, an AHCI ATAPI
760 CD-ROM, a single virtio network port, an AMD hostbridge, and the console
761 port connected to an
762 .Xr nmdm 4
763 null-modem device.
764 .Bd -literal -offset indent
765 bhyve -c 4 \\
766   -s 0,amd_hostbridge -s 1,lpc \\
767   -s 1:0,ahci,hd:/images/disk.1,hd:/images/disk.2,\\
768 hd:/images/disk.3,hd:/images/disk.4,\\
769 hd:/images/disk.5,hd:/images/disk.6,\\
770 hd:/images/disk.7,hd:/images/disk.8,\\
771 cd:/images/install.iso \\
772   -s 3,virtio-net,tap0 \\
773   -l com1,/dev/nmdm0A \\
774   -A -H -P -m 8G
775 .Ed
776 .Pp
777 Run a UEFI virtual machine with a display resolution of 800 by 600 pixels
778 that can be accessed via VNC at: 0.0.0.0:5900.
779 .Bd -literal -offset indent
780 bhyve -c 2 -m 4G -w -H \\
781   -s 0,hostbridge \\
782   -s 3,ahci-cd,/path/to/uefi-OS-install.iso \\
783   -s 4,ahci-hd,disk.img \\
784   -s 5,virtio-net,tap0 \\
785   -s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \\
786   -s 30,xhci,tablet \\
787   -s 31,lpc -l com1,stdio \\
788   -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\
789    uefivm
790 .Ed
791 .Pp
792 Run a UEFI virtual machine with a VNC display that is bound to all IPv6
793 addresses on port 5900.
794 .Bd -literal -offset indent
795 bhyve -c 2 -m 4G -w -H \\
796   -s 0,hostbridge \\
797   -s 4,ahci-hd,disk.img \\
798   -s 5,virtio-net,tap0 \\
799   -s 29,fbuf,tcp=[::]:5900,w=800,h=600 \\
800   -s 30,xhci,tablet \\
801   -s 31,lpc -l com1,stdio \\
802   -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\
803    uefivm
804 .Ed
805 .Sh SEE ALSO
806 .Xr bhyve 4 ,
807 .Xr nmdm 4 ,
808 .Xr vmm 4 ,
809 .Xr ethers 5 ,
810 .Xr bhyvectl 8 ,
811 .Xr bhyveload 8
812 .Pp
813 .Rs
814 .%A Intel
815 .%B 64 and IA-32 Architectures Software Developer’s Manual
816 .%V Volume 3
817 .Re
818 .Sh HISTORY
819 .Nm
820 first appeared in
821 .Fx 10.0 .
822 .Sh AUTHORS
823 .An Neel Natu Aq Mt neel@freebsd.org
824 .An Peter Grehan Aq Mt grehan@freebsd.org