Skip to content

Instantly share code, notes, and snippets.

@kaworu
Created May 8, 2015 18:40
Show Gist options
  • Save kaworu/32543f950a5df911244a to your computer and use it in GitHub Desktop.
Save kaworu/32543f950a5df911244a to your computer and use it in GitHub Desktop.
# pkg install sysutils/grub2-bhyve # port will pull gcc...
config from https://www.freebsd.org/doc/handbook/virtualization-host-bhyve.html
# kldload vmm
# sysctl net.link.tap.up_on_open=1
# ifconfig tap0 create
# ifconfig bridge0 create
# ifconfig bridge0 addm re0 addm tap0
# ifconfig bridge0 up
# sysctl net.inet.ip.forwarding=1
# sysctl net.inet6.ip6.forwarding=1
(http://serverfault.com/questions/602292/bridged-networking-with-bhyve-and-freebsd-guests-does-not-work)
// from the openbsd dir
get install57.iso from http://www.openbsd.org/ftp.html
# truncate -s 24G disk.img
# cat device.map
(hd0) ./disk.img
(cd0) ./install57.iso
# grub-bhyve -m device.map -r cd0 -M 1024M bhyve0
grub> kopenbsd -h com0 (cd0)/5.7/amd64/bsd.rd
grub> boot
# bhyve -c 2 -m 1024M -A -H -P -s 0:0,amd_hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0,mac=00:50:56:00:6d:cd -s 3:0,virtio-blk,./disk.img -s 4:0,ahci-cd,./install57.iso -l com1,stdio -W bhyve0
http://www.openbsd.org/faq/faq4.html
[answer yes to com0]
# grub-bhyve -m device.map -r hd0 -M 1024M bhyve0
grub> kopenbsd -h com0 -r sd0a (hd0,openbsd1)/bsd
grub> boot
# bhyve -c 2 -m 1024M -A -H -P -s 0:0,amd_hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0,mac=00:50:56:00:6d:cd -s 3:0,virtio-blk,./disk.img -l com1,stdio -W bhyve0
http://remiphilippe.fr/ip-configuration-on-openbsd-with-online-net-aka-dedibox/
# cat /etc/mygate
178.63.43.193
# cat /etc/hostname.vio0
inet 178.63.43.248 255.255.255.192
!route add -inet 178.63.43.193/32 -link -iface $if
inet6 2a01:4f8:120:5388:0:b:248:1 112
/* OUPS */
# bhyvectl --destroy --vm=bhyve0
# kldunload vmm
# kldload vmm
# grub-bhyve ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment