2

I installed Ubuntu Server 16.04.3 in two Virtualbox virtual machines, and then I created a NAT network and a DHCP server with the following commands from the host machine:

$ vboxmanage natnetwork add --netname testlab --network "10.10.10.0/24" --enable
$ vboxmanage dhcpserver add --netname testlab --ip 10.10.10.1 --netmask 255.255.255.0 --lowerip 10.10.10.2 --upperip 10.10.10.12 --enable

I configured the Network setting of each virtual machine to use the Adapter 1 attached to 'Nat Network' testlab.

The two virtual machines can ping each other with these settings, but they cannot access the Internet. If I ping 8.8.8.8, I have a 100% packet loss and I am unable to install any package:

$ apt-get update && apt-get upgrade
Temporary failure resolving ‘gb.archive.ubuntu.com’

Both have an empty /etc/resolv.conf and the same /etc/hosts files.

I need to have them connected to each other and the Internet for testing purposes. One should act as a server, the second one as a client, and the machine acting as a server should be connected to the Internet.

I have no idea why the two servers cannot connect to the internet as Virtualbox NAT Network. Any ideas?

1

Changing network address range solved the issue.
I still do not know why the 10.10.10.0/24 address range does not work.
See at the Virtualbox forum.

0

I had a similar problem with NatNetworking in VirtualBox just recently where guests were able to ping each other but not connect to the network (but they had been previously, the configuration was sound something had clearly just died, this seems especially prevalent on macOS).

This answer wasn't posted anywhere, I found it by digging through VBoxManage's help prompts. (The ifconfig suggestion didn't work for me.)

Run these in a command line to restart the NatNetwork server:

VBoxManage natnetwork stop  --netname NatNetworkName
VBoxManage natnetwork start --netname NatNetworkName

Note that enabling and disabling (both from the UI or the GUI) wasn't enough; these lines seem to be more exhaustive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.