New jail has no network access

VirtualBox 7.0.18 running Core 13.3-U5.1

I’m trying to get a jail running so that I can test some procedures before I upgrade my physical server to Scale but I can’t get the jail’s networking to work, hence I can’t install pkg or the software (Plex) I’m trying to work with. I don’t see where I’m going wrong. Can someone advise?

The VM server itself has LAN and internet access. I’m trying to create a new jail in the simplest manner, by supplying only a name, release version (13.3-RELEASE) and selecting DHCP Autoconfigure in the networking config - everything else is default. The jail is created in a few seconds, but will not start, eventually giving the following message:

Error: [EFAULT] + Acquiring DHCP address: FAILED, address received: 0.0.0.0/8 Stopped test3 due to DHCP failure

(Note that I created a jail in exactly this way on the physical server and it worked fine.)

I also tried creating a jail in the VM server without using DHCP: selected VNET, left vnet_default_interface on auto, set vnet0 as the IPv4 interface, gave it a free 192.168.1.x IP address, netmask of 24, IPv4 router set to my local router, left IPv6 Autoconfigure unselected and all v6 settings as default. This matches, as closely as I can get, the settings on the working jails on my physical server. This new jail is created in a few seconds and runs immediately. However, it cannot ping my router or the internet, saying “ping: sendto: Host is down”, nor does my router include the jail in its list of local devices. The jail therefore cannot install pkg, so I can’t install Plex.

For reference: I’ve tried to get the VM on the same version of Core as the physical server (13.3-U1) and hopefully they’re close enough that there aren’t any glaring differences in software or procedures. I’m very much an amateur, though.

Can anyone suggest what I need to do to get the jail working correctly? Thanks in advance.

I think you need to double check the version you’re posting. You are using VirtualBox networking and probably have to configure that correctly to get the jail to see your router. Check your ip info on your VM of TrueNAS and the jail to see where it is getting your info and what it has access to. There are a few options for setting up the networking in VirtualBox

Network settings for the VM:
image

As the VM’s network access appears to be OK (unless anyone can see anything glaringly wrong with this screenshot), I can only assume something’s wrong in the jail.

Further information: I cloned the VM from an existing VM (running 13.0-U5.1) I’ve been using as a testbench for a while. I can’t test whether that original VM’s jails work correctly, because something appears to have messed up it’s UI - lots of buttons and texts are missing, like the cancel/confirm buttons when it asks you to specific a volume to store jails in. I’ll try a clean install and see what that gives me.

image
image

I created a new VM using the Core 13.0-U6.4 .iso, without applying any further updates. I created a user account and group, then added a volume and datasets, wrote some data into one of the volumes over the network from my VM host machine, all without problems. I then tried to create a new jail but ran into the same problems listed here, so I applied the fix given by NickF1227.

I tried again to create a new jail using 13.3-RELEASE, choosing DHCP Autoconfigure IPv4 but leaving all other options as default: the jail was created successfully but wouldn’t run, giving the same error message as before:

image

I edited the jail, setting it to VNET and setting all other options as I described in my first post: as before, the jail started in a few seconds but still can’t ping anything on my LAN or the internet.

Using ifconfig in the shell in the Core VM I can see that its em0 interface has been given a 192.168.1.x IP by my router’s DHCP, but I can’t see any reference to the DHCP server, even though it’s clearly set the VM’s IP.

In the jail, ifconfig doesn’t show the em0 interface, either when vnet_default_interface is set to auto or I manually set it to em0. The IPv4 default router is set to my router in both cases.

I found this topic in which the solution was the resolver settings: I set this to “none” so that the jail would inherit those settings from the Core VM (and I double-checked that the VM’s resolv.conf contained the correct “nameserver 192.168.1.254” entry) but that didn’t fix it. Nor did entering that same value into the resolver field manually.

Running netstat -r in the jail shows the correct IP for the default gateway. If the jail had a working network connection, I assume that it would be trying to talk to the correct DHCP server.

I was thinking that since ifconfig in the jail doesn’t show the em0 interface, it must be an indication that the interface is missing. However, ifconfig doesn’t report that interface in the jails on my physical server either, and they’re working fine. I don’t know enough to know why the jails don’t show this interface but the host does.

To have sub interfaces on an interface you may need to enable “promiscuous mode” in the hypervisor.

This allows the vm to listen to multiple MAC addresses, which may be needed for jail etc networking

1 Like

This was it, thanks very much. I set Promiscuous Mode to “Allow All” and it seems to be working correctly now. For reference, “Allow VMs” made no difference, which makes sense based on my reading of the VirtualBox documentation.

Thanks again.

1 Like