churchers/vm-bhyve

When just networkX_type and networkX_device are provided in the VM's config file, no network device is passed to bhyve

Opened this issue · 5 comments

After upgrade to version 1.6.0, when a VM's configuration includes only networkX_type, networkX_device and networkX_mac (i.e. no vm-bhyve bridge), there are no Ethernet device arguments passed to bhyve, and hence no Ethernet interface given to the host VM as can be seen in the log file.

File extract for networking:

...
network0_type="virtio-net"
network0_device="tap0"
network0_mac="58:9c:cc:13:17:34"
...

A temporary workaround is to pass the device explicitly to bhyve e.g. to add in the vm configuration file the following:

bhyve_options="-s 5:0,virtio-net,tap0,mac=58:9c:cc:13:17:34"

(FreeBSD 14.1, pkg latest, v1.6.0, debian VMs using grub)

GogoFC commented

Hey, do you also use switch or just manual network devices?

No vm-bhyve defined switch used. I have a bridge with a specific setup that I use (to also handle jails). The network devices are created outside vm-bhyve and passed on in the config file.

hfvk commented

I have this same issue on FreeBSD 14.2. I have manually configured bridges and tap devices and do not use vm-bhyve switch (leads to other issues in my setup).

Before v 1.6.0 this worked without issues.

Therefore, it would be nice to return the old behavior so that vm-bhyve would support also manual bridge/tap configurations not defined using vm-bhyve switch.

GogoFC commented

I wonder why that happened. I looked at some of the commits and I didn't really see any major changes.

I have two test systems, both are running FreeBSD 14.2 and were working on bhyve v1.5 (rev. 105102). Now:

System A with v1.5 (rev. 105102) works.
System B with v1.6-devel (rev. 106001) does NOT work.

network setup in vm config on both systems:
network0_type="virtio-net"
network0_device="tap0"
network0_mac="..."

System A vm-bhyve.log
Dec 12 20:15:43: [loader: uefi]
Dec 12 20:15:43: [cpu: 4,sockets=1,cores=4]
Dec 12 20:15:43: [memory: 12G]
Dec 12 20:15:43: [hostbridge: standard]
Dec 12 20:15:43: [com ports: com1]
Dec 12 20:15:43: [uuid: ...]
Dec 12 20:15:43: [debug mode: no]
Dec 12 20:15:43: [primary disk: disk0.img]
Dec 12 20:15:43: [primary disk dev: file]
Dec 12 20:15:43: initialising network device tap0
Dec 12 20:15:43: booting

NOTE: "initialising network device tap0"

System B vm-bhye.log
Dec 12 23:10:09: initialising
Dec 12 23:10:09: [loader: uefi]
Dec 12 23:10:09: [cpu: 4,sockets=1,cores=4]
Dec 12 23:10:09: [memory: 8G]
Dec 12 23:10:09: [hostbridge: standard]
Dec 12 23:10:09: [com ports: com1]
Dec 12 23:10:09: [uuid: ...]
Dec 12 23:10:09: [debug mode: no]
Dec 12 23:10:09: [primary disk: disk0.img]
Dec 12 23:10:09: [primary disk dev: file]
Dec 12 23:10:09: booting

NOTE: no information about network initialization.

System B seems to ignore even erroneous network0 statements. For example, even if I try to assign non existent device to the vm, it does not give any error.