====== Bhyve ======
===== Documentation =====
* [[/bhyve]]
* [[https://www.freebsd.org/doc/handbook/virtualization-host-bhyve.html|Handbook: Chapter 21.7: FreeBSD as a Host with bhyve]]
===== Tutorials =====
==== References ====
* Ubuntu 18.04 vs. bhyve (hazardous.org, 2018.5.17)
* Install Ubuntu on %%FreeBSD%% with byhve (www.davd.eu, 2017.4.2)
===== Management tools =====
* [[https://www.freshports.org/sysutils/cbsd|cbsd]]
* [[https://www.freshports.org/sysutils/iohyve|iohyve]]
* [[https://www.freshports.org/sysutils/vm-bhyve|vm-bhyve]]
* [[https://www.freshports.org/devel/libvirt|libvirt]]
==== libvirt ====
* [[https://libvirt.org/drvbhyve.html|Bhyve driver documentation (libvirt.org)]]
* [[https://people.freebsd.org/~rodrigc/libvirt/libvirt-bhyve.html|Notes about libvirt and bhyve by rodrigc@ (people.freebsd.org/~rodrigc)]]
=== Failed attempt at running bhyve with libvirt ===
Notes:
* For some reason libvirtd does not create a //virbr0// bridge. I created //bridge0// manually and it seems to work.
* I'm using //vtnet0// as this %%FreeBSD%% machine is already running inside a libvirt.
* It is possible that the host host machine does not support virtualization inside a virtual guest.
Steps:
- Configuration:
* %%FreeBSD%% version: 12.0-CURRENT r333017
* libvirt version: 4.2.0
- Install libvirt and download an ISO installation file of %%FreeBSD%%.
- Create an img file:
truncate -s 20G moinguest.img
- Configure network:
bridge='bridge0'
eth='vtnet0'
sudo ifconfig tap0 create
sudo sysctl net.link.tap.up_on_open=1
sudo ifconfig "$bridge" create
sudo ifconfig "$bridge" addm "$eth" addm tap0
sudo ifconfig "$bridge" up
- Configure host:
for mod in vmm if_tap if_bridge nmdm
do
if ! kldstat -qn "$mod"
then
sudo kldload "$mod"
fi
done
# Make sure everything is fine.
virt-host-validate bhyve
- Create //moinguest.xml//:
moinguestdf3be7e7-a104-11e3-aeb0-50e5492bd3dc221hvmdestroyrestartdestroy
- Start libvirtd:
sudo service libvirtd onestart
- Run guest:
sudo virsh -c 'bhyve:///system' "define /usr/home/mpts/h/bhyve/moinguest.xml"
sudo virsh -c 'bhyve:///system' "start --console moinguest"
and fail:
Domain moinguest defined from /usr/home/mpts/h/bhyve/moinguest.xml
error: Failed to start domain moinguest
error: internal error: Child process (/usr/sbin/bhyveload -m 2048 -d /usr/home/mpts/h/bhyve/moinguest.img moinguest) unexpected exit status 1
=== Troubleshooting ===
* See what would be executed:
virsh domxml-to-native bhyve-argv domain.xml
----
{{tag>HowTo Virtualization}}