Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running Ubuntu-Server 12 LTS inside a VM (using VirtualBox with Ubuntu 12 as the host). I have 2 nics set-up in VirtualBox, eth0 is NAT and is used to connect to the outside world and eth1 is Host-Only (with DHCP provided by VirtualBox) so I can access the VM from the host machine.

When I first log in, ifconfig does not display eth1 (as expected) and running sudo dhclient eth1 brings the interface up and gets an IP address as expected. All good so far.

So then I edited /etc/network/interfaces to include the following:

auto eth1
iface eth1 inet static

After a reboot, eth1 appears in ifconfig as expected with its static ip but then apt-get update fails claiming 'temporary failure resolving '.

If I comment out the new interface definition and reboot again, it all works fine. If I just use dhclient to bring eth1 up, it all works fine but I'd quite like to not have to do that everytime I boot the VM.

I'm not sure where to start with this one, I'm not a native to Ubuntu-land. Any help would be greatly appreciated!

Edit: For clarity, once the system is up and either working or not, no amount of changing files and restarting the networking service seems to change it. It's either working or not until a complete reboot.

share|improve this question
Comment out gateway, reboot, then test apt-get and accessing VM from host machine. – Eric Carvalho Jun 11 '13 at 17:07
That solved it! Thank-you! I guess I was trying to give it too much info. – bugsduggan Jun 11 '13 at 17:12
up vote 1 down vote accepted

Just remove the gateway from eth1 config:

auto eth1
iface eth1 inet static
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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