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

My hair is in fire trying to make Internet connection work in guest OS.

I have Ubuntu 12.10 machine with VirtualBox 4.1.18 installed from Ubuntu Software Center

I set PC-BSD and FreeBSD to work as GuestOS

Now both GuestOS have no internet connection. I have tried different methods like:

sudo apt-get install dnsmasq and changed the /etc/dnsmasq.d/network-manager config to add except-interface=lo which blocked all of my internet connections.

I also added dns-nameservers to /etc/network/interfaces and restart the network-manager.

Finally I did VBoxManage modifyvm "PC-BSD" --natdnshostresolver1 on and VBoxManage modifyvm "PC-BSD" --natdnshostresolver1 on but to no avail.

I have already tried NAT and different options in Bridged too

I still don't have internet connection in GuestOS, is there anyway I can fix this ? As far as I think the problem is in Ubuntu 12.10 for not sharing the internet, but I don't know how to fix this.

share|improve this question
up vote 7 down vote accepted

After trying this and that, I fixed the problem as follows.

sudo gedit /etc/network/interfaces

I commented out auto lo and added auto eth0. After that I did

sudo service network-manager restart

Now networking works in all VirtualBox guest OSes.

I don't know how this works, but in my Kubuntu 12.04 the network interfaces was set to eth0, so, I thought of giving it a try, and it works.


As per jdthood suggestion, I had to put back the lo for network manager to work properly. After few days when I restart my computer, it started saying Could not detect network and I uncommented out lo, so, now I have both

auth lo
auth eth0

and everything is working fine.

share|improve this answer
If that fixed it then the problem was the missing auto eth0. You should put the auto lo back, though. The lo interface is necessary and should be brought up automatically at boot. – jdthood Mar 15 '13 at 9:16
If your eth0 was not enabled previously, then how did you have internet access at all from the host? As I mentioned in my answer, IF your host has normal internet connectivity, you need to do nothing but configure a NAT interface. – zwets Mar 15 '13 at 10:07
@zwets the host had normal internet connection (wireless) and but internet was not working in Guest. When I changed it to eth0 suddenly everything is working. – Jhilke Dai Mar 15 '13 at 16:17
@jdthood I don't understand what is with lo but certainly it look like it was blocking internet connection to pass to Guest. I use wireless network and everything is working perfectly even after reboot. I really don't know why is eth0 or lo needed but I don't have internet connection problem now. Thanks for formatting the answer, I will check about network in ubuntu in details – Jhilke Dai Mar 15 '13 at 16:23
thanks a million for this fix :) – lackovic10 Oct 15 '13 at 17:25

I am running VBox 4.2.8 in Ubuntu 12.10 with several guests (FreeBSD, Windows 7, Windows Server 2012) and use Bridged Mode, Deny Promiscuous in the network settings for VBox. Everything just works OOB. However, I have forgot to click the "Cable Connected" setting in the past and driven myself up a wall looking too deeply into the issue. So make sure "Cable Connected" is ticked in network settings for your Guest in VBox.

I have never needed to do nat dns resolver on my Guests, so just manage all that within your network settings in PC-BSD.

Hope this helps.

share|improve this answer
the cable connected is on, I have tried both NAT and bridged... IDK what's wrong... I even reinstalled virtualbox, but no internet connection – Jhilke Dai Mar 14 '13 at 18:56

If your (Ubuntu) host has normal internet connectivity, and you create a virtual network card for a guest based on the default NAT configuration, then you are done at the host end. From this point on, VirtualBox (not Ubuntu) handles the traffic from the guest out to the network. As far as Ubuntu is concerned, VirtualBox is just another application using the network. It's no different from e.g. Firefox.

The NAT-ting, DHCP-ing and communicating with the guest is purely VirtualBox's business. Assuming VirtualBox works, what this means is that you'll need to solve this issue at the BSD end. The BSD experts are right next door.

share|improve this answer
I don't think its BSD problem, neither I am saying its Virtualbox problem... the Problem is in Ubuntu 12.10 IMO. I have Kubuntu 12.04 on other machine and I run PC-BSD, FreeBSD, Fedora and OpenSUSE without any internet problem. They are all using default NAT settings... That pc is quiet old and often runs out of memory while using virtualbox. – Jhilke Dai Mar 14 '13 at 19:16

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.