From 17722c169c4622734b2fe8a443720a432af4a822 Mon Sep 17 00:00:00 2001
From: Conrad Meyer
The bhyve driver in libvirt is in its early stage and under active development. So it supports
-only limited number of features bhyve provides. All the supported features could be found
-in this sample domain XML.
+only limited number of features bhyve provides.
@@ -48,10 +47,21 @@ disk device were supported per-domain. However,
up to 31 PCI devices.
+Note: the Bhyve driver in libvirt will boot whichever device is first. If you
+want to install from CD, put the CD device first. If not, put the root HDD
+first.
+
+Note: Only the SATA bus is supported. Only (The <disk> sections may be swapped in order to install from
+cdrom.iso.)
+Note the addition of <bootloader>.
+Example config
cdrom
- and
+disk
-type disks are supported.
+
<domain type='bhyve'>
- <name>bhyve</name>
- <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
<memory>219136</memory>
<currentMemory>219136</currentMemory>
<vcpu>1</vcpu>
@@ -76,6 +86,7 @@ up to 31 PCI devices.
<driver name='file' type='raw'/>
<source file='/path/to/cdrom.iso'/>
<target dev='hdc' bus='sata'/>
+ <readonly/>
</disk>
<interface type='bridge'>
<model type='virtio'/>
@@ -85,6 +96,53 @@ up to 31 PCI devices.
</domain>
+Example config (Linux guest)
+
+
+<domain type='bhyve'>
+ <name>linux_guest</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>131072</memory>
+ <currentMemory>131072</currentMemory>
+ <vcpu>1</vcpu>
+ <bootloader>/usr/local/sbin/grub-bhyve</bootloader>
+ <os>
+ <type>hvm</type>
+ </os>
+ <features>
+ <apic/>
+ <acpi/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <disk type='file' device='disk'>
+ <driver name='file' type='raw'/>
+ <source file='/path/to/guest_hdd.img'/>
+ <target dev='hda' bus='sata'/>
+ </disk>
+ <disk type='file' device='cdrom'>
+ <driver name='file' type='raw'/>
+ <source file='/path/to/cdrom.iso'/>
+ <target dev='hdc' bus='sata'/>
+ <readonly/>
+ </disk>
+ <interface type='bridge'>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ </interface>
+ </devices>
+</domain>
+
Guest usage / management
@@ -119,6 +177,20 @@ to let a guest boot or start a guest using:
start --console domname+
NB: An bootloader configured to require user interaction will prevent
+the domain from starting (and thus virsh console
or start
+--console
from functioning) until the user interacts with it manually on
+the VM host. Because users typically do not have access to the VM host,
+interactive bootloaders are unsupported by libvirt. However, if you happen to
+run into this scenario and also happen to have access to the Bhyve host
+machine, you may select a boot option and allow the domain to finish starting
+by using an alternative terminal client on the VM host to connect to the
+domain-configured null modem device. One example (assuming
+/dev/nmdm0B
is configured as the slave end of the domain serial
+device) is:
cu -l /dev/nmdm0B+
@@ -157,5 +229,25 @@ An example of domain XML device entry for that will look like:
Please refer to the Storage documentation for more details on storage management.
+It's possible to boot non-FreeBSD guests by specifying an explicit
+bootloader, e.g. grub-bhyve(1)
. Arguments to the bootloader may be
+specified as well. If the bootloader is grub-bhyve
and arguments
+are omitted, libvirt will try and boot the first disk in the domain (either
+cdrom
- or disk
-type devices). If the disk type is
+disk
, it will attempt to boot from the first partition in the disk
+image.
+ ... + <bootloader>/usr/local/sbin/grub-bhyve</bootloader> + <bootloader_args>...</bootloader_args> + ... ++ +
Caveat: bootloader_args
does not support any quoting.
+Filenames, etc, must not have spaces or they will be tokenized incorrectly.