bhyve Network seems to stopped working in vm-bhyve (failed to find virtual switch 'public')

I've been using vm-bhyve for awhile with Linux, Windows, and FreeBSD guests. Probably around a month ago, but I'm not exactly sure, the guest will seem to start, but then if I try to connect, I can't. If I then do vm list, it shows that it has stopped. The log will say (failed to find virtual switch.
'public' ).
I have always just created a virtual switch, then run vm switch add public re0. (My ethernet card.) Having looked at vermaden's pages, he also says that one should
Code:
sysrc gateway_enable=YES
sysrc gateway_enable=YES
sysctl net.inet.ip.forwarding=1
host  echo net.link.tap.up_on_open=1 >> /etc/sysctl.conf
sysctl net.link.tap.up_on_open=1
I tried that, and the switch worked. But then when I tried again, once more, I was back to the can't find switch error. It will on occasion work, but it's far more common for it to not work, whether I have the network suggestions above or not. I also tried creating a bridge, but same result, no luck.

This may be connected to the last time vm-bhyve was updated, but I'm not sure. Web searching shows someone opened an issue years ago, but they seemed to think it had to do with an upgrade, and I haven't seen mention since. I've seen the posts here about pass through, but I don't think it's applicable, as I haven't used pass through, just a simple switch create and adding it to the ethernet card.

I'm wondering if it's only an issue for me, so I haven't opened an issue at the github site, When the issue started, I was on 14.3-p6 but I made a fresh install of 15. Again, the vm worked for one or two tries (without me taking any of the steps suggested above by vermaden), but then quickly went back to being unable to locate the switch.

So, aside from the obvious question of Does anyone know what I'm missing, there's also the question of is this a Just Me(TM) problem, or are others experiencing it? I don't want to open an issue if it's just me.
 
Make sure you are on the latest vm-bhyve. There was a version that snuck out missing a new rc.d script to start the bridges. (Split into two to avoid an ordering loop in rc processing.)
 
Eric A. Borisch, it should be the latest, 1.7..0_1. https://freshports.org shows it as the latest.

rootbert

ifconfig_re0="inet 192.168.1.145 netmask 255.255.255.0"
defaultrouter="192.168.1.1"
ifconfig_re0_ipv6="inet6 accept_rtadv"

is the relevant network information. I don't have what vermaden suggested of gateway_enable because I tried it and it didn't help, and I didn't need it in the past.

I should also mention that previously, when I had such an issue I would just destroy and re-create the switch. But these days if I run vm switch destroy public I get a message
Code:
/usr/local/sbin/vm: ERROR: failed to remove virtual switch
 
If you upgraded to FreeBSD 15 please check if there is following error when bridge is created by vm-bhyve:

Code:
ifconfig: BRDGADD xx0: Invalid argument (extended error Member interface may not have an IPv4 address configured)

If it is your case you have to set sysctl net.link.bridge.member_ifaddrs=1 to allow using network interface ("member interface") with IP address and bridge without IP address. Please see details on https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289142
 
Back
Top