vbox FreeBSD VirtualBox - no internet connection

Hello!
I have one problem (simple as I think).
Some time ago I have installed FreeBSD 14.3 in VirtualBox, but can't make internet connection working there.

So facts:
my base OS: FreeBSD 13.5-RELEASE-p8. I have PF, simple rules, but ever when I disable PF problem remains.

my guest OS (VirtualBox): 14.3-RELEASE
In VirtualBox settings I have NAT settings.

rc.conf settings:
defaultrouter 192.168.3.1
ifconfig_em0 inet 192.168.3.2 netmask 255.255.255.0

resolve.conf
nameserver 192.168.0.1 - this is my real router (my base OS connects to this home router).

when I do ping 8.8.8.8 I see
ping: No route to host

What have I missed?
 
Some time ago I have installed FreeBSD 14.3 in VirtualBox
FYI, 14.3 is end-of-life. 14.4 is the only supported version from the 14 branch.

In VirtualBox settings I have NAT settings.
"NAT" in VirtualBox is using a dhcp server.

https://www.virtualbox.org/manual/topics/networkingdetails.html#network_nat .
Network Address Translation (NAT)
...
The virtual machine receives its network address and configuration on the private network from a DHCP server integrated into Oracle VirtualBox. The IP address thus assigned to the virtual machine is usually on a completely different network than the host. As more than one card of a virtual machine can be set up to use NAT, the first card is connected to the private network 10.0.2.0, the second card to the network 10.0.3.0 and so on. If you need to change the guest-assigned IP range, see Fine Tuning the Oracle VirtualBox NAT Engine.

If you stay with "NAT", configure in /etc/rc.conf:
Rich (BB code):
ifconfig_em0="DHCP"
Remove "defaultrouter".

Second network option: Create a VirtualBox "NAT Network" with a LAN IP you wish, attach the VMs network interface to the network, configure guest OS network interface accordingly and set the "defaultrouter" variable.

when I do ping 8.8.8.8 I see
ping: No route to host
In my experiance, ping(8) is non-functional in VirtualBox, use drill(1) instead, for example, or fetch a file:
fetch https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/meta
 
Back
Top