Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 have the following setup:

  • Windows host running virtualbox
  • Ubuntu server as a guest

I've enabled a second networking interface in Virtualbox - a bridged one - so I can connect to the instance via ssh, http etc

(note: this has always worked using ubuntu desktop using the GUI to configure networking, but now I'm using ubuntu server and doing it manually in ubuntu)

This is roughly what I do:

I have the instance running and I can, eg. ping and I get an IP address I stop the server, enable the second adapter in virtualbox I start the instance again I can see that the interface is listed using ifconfig -a I open /etc/network/interfaces and add the eth1 controller, so my interfaces file looks like this:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet dhcp

and when I restart using /etc/init.d/networking restart everything seems to work - ie. ifconfig gives me this:

eth0  Link encap:Ethernet  HWaddr 08:00:27:ad:75:94
      inet addr:  Bcast:  Mask:
      inet6 addr: fe80::a00:27ff:fead:7594/64 Scope:Link
      RX packets:1074 errors:0 dropped:0 overruns:0 frame:0
      TX packets:318 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:1301455 (1.3 MB)  TX bytes:26248 (26.2 KB)

eth1  Link encap:Ethernet  HWaddr 08:00:27:73:f7:37
      inet addr:  Bcast:  Mask:
      inet6 addr: fe80::a00:27ff:fe73:f737/64 Scope:Link
      RX packets:464 errors:0 dropped:0 overruns:0 frame:0
      TX packets:243 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:65921 (65.9 KB)  TX bytes:32173 (32.1 KB)

lo    Link encap:Local Loopback
      inet addr:  Mask:
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:16436  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

And I can connect to the instance using ssh, so networking is working..

however, DNS resolving seems to be not working, because when I ping any website (eg. it just times out..

I checked /etc/resolv.conf and everything looks fine (in fact, looks the same as the one on my ubuntu desktop instance.

Any ideas?

share|improve this question
up vote 1 down vote accepted

Please provide the output of sudo ip route list. I think your queries leave the box on one interface while they come back on another and your kernel will throw them away..
Try do disable the unbridged interface and retest the connectivity again:

usr@srv % sudo ifdown eth0
usr@srv % nslookup

If this doesn't work: are you able to ping to


If you use bridged networking there is no need to use VirtualBox as NAT.
The problem was, as expected, that DNS is configured to ask via eth0, the shorter way is through eth1, so the answer comes via eth1. Your kernel however doesn't expect any message on eth1 and drops them..

share|improve this answer
wait.. so you mean I don't need the default NAT networking controller that virtualbox creates and that I can simply change it to a bridged one? (I am able to ping to google's and use it for dig) – arnorhs Apr 25 '11 at 13:01
So your net is working with both interfaces enabled and only DNS doesn't? Have you tried DNS lookups with disabled eth0? – binfalse Apr 25 '11 at 13:03
yes, net is working on both, but dns doesn't.. exactly.. I just tried a dns lookup using only eth1 - with eth0 disabled.. and that WORKED.. it seems like I don't need two networking interfaces on the virtualbox instace... I just need a bridged one! wow, thanks a lot.. been stressed here (leaving on a trip in a few hours) – arnorhs Apr 25 '11 at 13:10
If you can modify your answer to the solution (not using two controllers in virtualbox for this purpose, just one) - and essentially trying to disable eth0 - I can approve the answer! thanks again – arnorhs Apr 25 '11 at 13:12

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.