I am having some difficulty getting vm-bhyve working. Actually, I am having difficulty getting bhyve to work at all, but I opted to try vm-bhyve because it seems easier to use and manage compared to the native tools.
I am trying to run a Linux guest (I have tried Ubuntu and Fedora) using vm-bhyve. I followed along with the quickstart guide on the vm-bhyve GitHub:
The virtual machine runs, but the console does nothing (although I think this is because Fedora doesn't have a text/terminal installer. Ubuntu does and I was able to get into the VM and go through the installation). But the bigger issue is that there's no network from the virtual machine.
I'm not sure where I'm going wrong. I can't find anything on how to get vm-bhyve to work other than the handful of wiki pages on the GitHub. Is there a reason my VM's don't have any networking? I am running PF but disabling it does nothing.
I am trying to run a Linux guest (I have tried Ubuntu and Fedora) using vm-bhyve. I followed along with the quickstart guide on the vm-bhyve GitHub:
Code:
pkg install vm-bhyve grub2-bhyve uefi-edk2-bhyve
zfs create pool/vm
sysrc vm_enable="YES"
sysrc vm_dir="zroot/vm"
vm init
cp /usr/local/share/examples/vm-bhyve/* /mountpoint/for/pool/vm/.templates/
vm switch create public
vm switch add public em0
vm iso "www.download.com/fedora.iso"
vm create fedora
vm install fedora fedora.iso
vm console fedora
The virtual machine runs, but the console does nothing (although I think this is because Fedora doesn't have a text/terminal installer. Ubuntu does and I was able to get into the VM and go through the installation). But the bigger issue is that there's no network from the virtual machine.
Code:
root@server:/zroot/vm # vm list
NAME DATASTORE LOADER CPU MEMORY VNC AUTOSTART STATE
fedora default grub 2 4096M - No Bootloader (14361)
root@server:/zroot/vm # vm switch list
NAME TYPE IFACE ADDRESS PRIVATE MTU VLAN PORTS
public standard vm-public - no - - em0
root@server:/zroot/vm # vm switch info
------------------------
Virtual Switch: public
------------------------
type: standard
ident: vm-public
vlan: -
physical-ports: em0
bytes-in: 772438 (754.333K)
bytes-out: 94887323 (90.491M)
virtual-port
device: tap0
vm: fedora
root@server:/zroot/vm # ifconfig
em0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=812099<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,VLAN_HWFILTER>
ether 44:39:c4:39:99:f8
inet 192.168.1.19 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.1.101 netmask 0xffffffff broadcast 192.168.1.101
inet 192.168.1.100 netmask 0xffffffff broadcast 192.168.1.100
inet 192.168.1.102 netmask 0xffffffff broadcast 192.168.1.102
inet6 fe80::4639:c4ff:fe39:99f8%em0 prefixlen 64 scopeid 0x1
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
inet 127.0.0.1 netmask 0xff000000
groups: lo
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
lo1: flags=8008<LOOPBACK,MULTICAST> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
groups: lo
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
pflog0: flags=141<UP,RUNNING,PROMISC> metric 0 mtu 33160
groups: pflog
vm-public: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether aa:ec:55:b9:82:1f
id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
maxage 20 holdcnt 6 proto stp-rstp maxaddr 2000 timeout 1200
root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
member: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 6 priority 128 path cost 2000000
member: em0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 1 priority 128 path cost 20000
groups: bridge vm-switch viid-4c918@
nd6 options=1<PERFORMNUD>
tap0: flags=8903<UP,BROADCAST,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: vmnet-fedora-0-public
options=80000<LINKSTATE>
ether 58:9c:fc:10:ff:89
groups: tap vm-port
media: Ethernet autoselect
status: no carrier
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
I'm not sure where I'm going wrong. I can't find anything on how to get vm-bhyve to work other than the handful of wiki pages on the GitHub. Is there a reason my VM's don't have any networking? I am running PF but disabling it does nothing.