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 "" --enable
$ vboxmanage dhcpserver add --netname testlab --ip --netmask --lowerip --upperip --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, 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?

2 Answers 2


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


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 (on host) 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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .