Alternatively or in addition to the above to install bhyve:
pkg install vm-bhyve bhyve-firmware bhyve-rc-3 grub2-bhyve
Output:
To ensure binaries built with this toolchain find appropriate versions
of the necessary run-time libraries, you may want to link using
-Wl,-rpath=/usr/local/lib/gcc48
For ports leveraging USE_GCC, USES=compiler, or USES=fortran this happens
transparently.
===> NOTICE:
This port is deprecated; you may wish to reconsider installing it:
Unsupported by upstream. Use GCC 6 or newer instead…
Message from vm-bhyve-1.1.8_1:
To enable vm-bhyve, please add the following lines to /etc/rc.conf,
depending on whether you are using ZFS storage or not. Please note
that the directory or dataset specified should already exist.
vm_enable="YES"
vm_dir="zfs:pool/dataset"
OR
vm_enable="YES"
vm_dir="/directory/path"
Then run :
vm init
If upgrading from 1.0 or earlier, please note that the ‘guest’
configuration option is no longer used.
Guests that are not using UEFI boot will need either loader=“grub”
or loader=“bhyveload” in their configuration in order to make sure
the correct loader is used.
Message from bhyve-rc-3:
Configuration is done completely though rc.conf.
The rc script won’t touch any devices for you (neither disk, nor tap)
so you need to make sure all of those have been initialized properly.
General setup:
kldload vmm
net.link.tap.up_on_open=1
Make it persistent:
echo "net.link.tap.up_on_open=1" >> /etc/sysctl.conf
cat >> /boot/loader.conf << EOF
vmm_load="YES"
EOF
Minimal example:
cat >> /etc/rc.conf << EOF
cloned_interfaces="tap0 bridge0"
bhyve_enable="YES"
bhyve_diskdev="/dev/zvol/anything/bhyve/virt"
EOF
ifconfig tap0 create
ifconfig bridge0 create
service bhyve start
tmux list-sessions
tmux attach -t bhyve
service bhyve status
service bhyve stop
Multi profile configuration example:
cat >> /etc/rc.conf << EOF
cloned_interfaces="tap0 tap1 bridge0"
bhyve_enable="YES"
bhyve_profiles="virt1 virt2"
bhyve_virt1_diskdev="/dev/zvol/anything/bhyve/virt1"
bhyve_virt2_tapdev="tap1"
bhyve_virt2_diskdev="/dev/zvol/anything/bhyve/virt2"
bhyve_virt2_memsize="8192"
bhyve_virt2_ncpu="4"
EOF
ifconfig tap0 create
ifconfig tap1 create
ifconfig bridge0 create
service bhyve start # start all
service bhyve start virt2 # start individual
tmux attach -t bhyve_virt1
tmux attach -t bhyve_virt1
service bhyve stop virt2 # stop individual
service bhyve stop # stop all
(by default ctrl-b d detaches from tmux).