Skip to content

Instantly share code, notes, and snippets.

@kylejohnson
Last active July 7, 2018 21:16
Show Gist options
  • Save kylejohnson/d2e0471d7425298ca5bdfc2ac20b02f3 to your computer and use it in GitHub Desktop.
Save kylejohnson/d2e0471d7425298ca5bdfc2ac20b02f3 to your computer and use it in GitHub Desktop.
Quick instructions for setting up an Ubuntu VM on a FreeBSD host with the bhyve hypervisor using the vm-bhyve tool.
  1. Edit /etc/rc.conf
cloned_interfaces="bridge0 tap0 tap1 tap2 lagg0"
ifconfig_bridge0="addm lagg0 addm tap0 addm tap1 addm tap2"
vm_list="unifi zm1 grafana"
  1. Create a tap for grafana, and add it to the bridge.
ifconfig tap2 create
ifconfig bridge0 addm tap2
  1. Edit the template to use the new tap
#  /bhyve/.templates/ubuntu.conf
loader="grub"
cpu=2
memory=1024M
network0_type="virtio-net"
network0_switch=""
disk0_type="virtio-blk"
disk0_name="disk0"
disk0_dev="sparse-zvol"
network0_device="tap2"
  1. Create the VM with a 16G disk
ls /bhyve/.iso
vm create -t ubuntu -s 16G grafana
vm install grafana ubuntu-16.04.1-server-amd64.iso
  1. Install via console.
vm console grafana
#  May need to hit ENTER again to refresh the screen, though his ENTER gets sent to the guest.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment