bhyve Bhyve: Internet access with Ubuntu 24.04 guest

Hi all,

I have a server running FreeBSD 14.1 with some Ubuntu Linux guests. Today I tried to set up a new VM with newest Ubuntu version 24.04 and cannot get internet access from the VM, while accessing the local network works. When setting up the VM I used the same configuration as for a Ubuntu 22.04 VM that I set up a couple of months before:

Code:
loader="grub"
grub_run_partition="gpt2"
grub_run_dir="/grub"
grub_run_file="grub.cfg"
cpu=2
memory=2048M
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0"
disk0_dev="sparse-zvol"
uuid="d85cd2cc-473c-11ef-af33-bc5ff4cb7409"
network0_mac="58:9c:fc:0b:46:41"

During install I noticed, that the installer was not able to reach the Ubuntu package server, but I was able to install anyway.
When trying to install the latest updates I noticed, that the VM is not able to reach the internet:


rb@openhab4:~$ sudo apt update
Ign:1 http://security.ubuntu.com/ubuntu noble-security InRelease
Ign:2 http://archive.ubuntu.com/ubuntu noble InRelease
Ign:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease
Ign:4 http://archive.ubuntu.com/ubuntu noble-backports InRelease
Err:5 http://security.ubuntu.com/ubuntu noble-security Release
404 Not Found [IP: 2001:bf0:244:244::122 80]
Err:6 http://archive.ubuntu.com/ubuntu noble Release
404 Not Found [IP: 2001:bf0:244:244::122 80]
Err:7 http://archive.ubuntu.com/ubuntu noble-updates Release
404 Not Found [IP: 2001:bf0:244:244::122 80]
Err:8 http://archive.ubuntu.com/ubuntu noble-backports Release
404 Not Found [IP: 2001:bf0:244:244::122 80]


So I tried a ping:

rb@openhab4:~$ ping www.google.com
PING www.google.com (2a00:1450:4001:80e::2004) 56 data bytes
From 2001:16b8:a02d:c948:464e:6dff:fef8:7526 icmp_seq=1 Destination unreachable: Administratively prohibited
From 2001:16b8:a02d:c948:464e:6dff:fef8:7526 icmp_seq=2 Destination unreachable: Administratively prohibited



On an older VM running Ubuntu 22.04 with the same vm-bhyve configuration it works:

rb@jellyfin:~$ ping www.google.com
PING www.google.com(fra24s06-in-x04.1e100.net (2a00:1450:4001:829::2004)) 56 data bytes
64 bytes from fra24s06-in-x04.1e100.net (2a00:1450:4001:829::2004): icmp_seq=1 ttl=60 time=8.00 ms
64 bytes from fra24s06-in-x04.1e100.net (2a00:1450:4001:829::2004): icmp_seq=2 ttl=60 time=5.46 ms


The message "Destination unreachable: Administratively prohibited" directed me to the iptables firewall settings on the VM, but there are no rules defined.

The virtual switch setup looks like this:

root@mortimer# vm switch list
NAME TYPE IFACE ADDRESS PRIVATE MTU VLAN PORTS
public standard vm-public - no - - em0



root@mortimer# vm switch info
local: _netgraph,: bad variable name
------------------------
Virtual Switch: public
------------------------
type: standard
ident: vm-public
vlan: -
physical-ports: em0
bytes-in: 236026785 (225.092M)
bytes-out: 141614070 (135.053M)

virtual-port
device: tap4
vm: openhab4

virtual-port
device: tap3
vm: jellyfin

virtual-port
device: tap2
vm: openhab

virtual-port
device: tap1
vm: mqtt

virtual-port
device: tap0
vm: grafana



What does Ubuntu 24.04 differently than 22.04 in regards to network access? Anyone has a hint?
 
Hi,
Try with uefi instead of grub:
I wonder what uefi vs. grub does regarding network setup, but I ditched the VM and created a new one with loader="uefi", but that doesn't even boot the install image.
 
I wonder if this might help it not booting the install image. https://www.davidschlachter.com/misc/freebsd-bhyve-uefi-shell

For what it's worth, I have this for Debian

loader="uefi" graphics="yes" cpu=1 memory=2G network0_type="virtio-net" network0_switch="public" disk0_type="ahci-hd" disk0_name="disk0.img" graphics="yes" graphics_wait="yes" uefi_vars="yes"

I've only used it on occasion, and it sometimes gives me the issue that I can't ssh to it on the LAN unless I've opened up vncviewer and manually login. It will be at the login prompt for a text login, which is how it's configured, that is, to text login and then type startx. As it was just to test something, I've never tried to troubleshoot it.

Now, this one isn't systemd but it's Devuan, and this boots without a problem, and once I use vm start devuan I can ssh into it without any issue.
loader="uefi" graphics="yes" xhci_mouse="yes" cpu=1 memory=4096M network0_type="virtio-net" network0_switch="public" disk0_type="virtio-blk" disk0_name="disk0.img" uuid="5f865966-b266-11ee-ba73-b8ca3abc453f" network0_mac="58:9c:fc:09:8f:d8" bhyve_options="-A"
Not sure if I need the bhyve_options line, but at one point, various systems with GUI needed it and I added it in. I only manually configured the loader, graphics , xhci_mouse, memory and bhyve_options the rest was automatic. (I'd already created a public switch). This was with vm-bhyve.
 
I wonder what uefi vs. grub does regarding network setup, but I ditched the VM and created a new one with loader="uefi", but that doesn't even boot the install image.
Probably not that much but bhyve is a bit tricky sometimes so I thought useful to start with a config file known to be working.

So I've just tested both iso "ubuntu-22.04.4-live-server-amd64.iso" and "ubuntu-24.04-live-server-amd64.iso" with sysutils/vm-bhyve by using a similar config file to the one I've linked before, in both cases the installation went "almost" successful: I could not update the system during the installation but I had the choice to finish the installation without updating which is convenient in this situation.
After the first reboot I figured out the dns was KO so I manually edited /etc/resolv.conf , added nameserver 1.1.1.1, after that the network worked and the update went fine.
Note that this is only a temporary solution (resolv.conf is overwritten at every reboot) , but I won't investigate more than that because I am not interested that much in how ubuntu network works exactly, but at least you know that the install procedure is working.
 
Back
Top