To make it a short answer: It's a network issue.

The way I see the scenario is like this:

enter image description here

Now to correctly see where the problem is, in this case, we need to first check from the outer networks to the inner networks.

  1. Make sure the router has internet. You can use the same host or another device connected to it to check this.

  2. Make sure the Host has internet via the Router or any other source. To check simply send a ping to google.com for example like so: ping google.com.

If Point 1 and 2 are good (Your router is working great and has internet and your host has internet) then we proceed with the Guest and Virtualbox. It may be good to read how Wireless support is handled in VirtualBox by reading Wifi card on an virtualbox's ubuntu

We need to know the following information first:

  • There is no wireless connection inside the virtualbox environment. All "virtual" connections are in reference to cable/wired connected ones. So when you enable a Network card in your virtual guest, it is a virtual wired connection you are creating not a virtual wireless one.

  • The virtual connection from Host to Guest is independent of the type of connection your Host is connected to (Physically connected). If the host is connected via a wired or wireless connection, it does not matter or affect the virtual connection made from the Host to Guest because wired and wireless connections are used in the same way inside the Guest. Something similar to the following image:

    enter image description here

  • If your host does not have internet access, your guest will not have it. The same goes that if your host has internet access and your connection from Host to Guest permits sharing the internet, then the guest will most probably have internet also (Default behavior with Virtualbox).

  • I will be using Virtualbox 4.1.20 which looks different from the one you are using (Might be same, I do not know). I will add the network image just to help and show the differences:

    enter image description here

  • I will be using Ubuntu 12.04 as host and as Guest (This works the same in 12.10 or 13.04). In cases where Windows is the host you need to make sure the firewall is not blocking a particular port the guest will be using.

  • I assume that the Host is not using a proxy, just connected directly to the router via a wireless/wired connection.

  • The output from the Guest is the following with ifconfig and route:

    enter image description here

Now to the points you want to solve:

  1. Configure the network for the VM Ubuntu Server
  2. Get VM to connect to internet
  3. Get router to see the VM

Let me first mention that point 3 will be impossible unless the Virtualbox guess supports port forwarding. Your router will only see transfers made from your Guest as if they were transfers made from the actual Host. So without forwarding (Which is somewhat supported on the latest version) the router will never see the VM, only the Host.

There are of course ways to go around this like telling the host to forward stuff to the guest via the virtualbox engine. Or configuring (Easier I think) the guest for port forward. For example this:

enter image description here

So with this in mind we do the following in the Guest:

  1. Test if the guest has Internet access with the common ping google.com approach.

    If ping works then we know that an internet connection exists. The problem might be resolving the destination site.

  2. Try the following:

    /etc/init.d/network restart and/or dhclient

  3. Verify that /etc/network/interface is correct. My example would be:

    enter image description here

  4. Change the Adapter Type in the Network Options in the Virtualbox Configuration Window.

  5. Test out if the Ubuntu Desktop client or another OS works correctly. (Right now I only have the Desktop iso image of 12.10 and 12.04).


This is most definitely a network issue. To confirm that, try first pinging IPs inside your local network:

ping 10.1.1.1

(which is likely to be your router's IP)

and then pinging IPs in the "outside world"

Also, even if you're running your VM on a laptop which connects via wifi, you don't need to configure wifi on the guest machine - VirtualBox emulates a "wired" network adapter, so your guest OS thinks it runs on a machine which is connected to LAN with a cable.

Configuring networking in VirtualBox is a broad topic (although typical setups normally work out of the box), you need to make sure your VM has a network adapter configured in VM's properties etc.

See http://www.virtualbox.org/manual/ch06.html for more details.

The default VirtualBox setup (NAT) creates a "private" network between your host and guest machines, with the host machine forwarding all traffic coming from the guest machine outside and sending responses back to the guest (similarly to how your router connects your laptop to Internet). The guest does not have an individual IP address in your LAN and can not be accessed from outside your laptop, but you can access Internet from the guest because packets are translated into the LAN by the host machine and then into internet by the router. This explains why you don't see a separate device in your router's settings


Here's what I notice from your question:

  1. The message is: "Failed to fetch . Temporary failure resolving <blah>.ubuntu.com"
  2. You can reach google.com just fine.

I'd say that there is a problem with the domain name service in resolving that address, not in your computer. There's nothing special about doing a domain lookup as opposed to doing a ping. Your network must be working, however it is configured.

I suggest that you change your software sources to use a different Ubuntu archive, perhaps just archive.ubuntu.com.


This is what worked for me:

trying to set up wireless did not work
adding network property details on Ubuntu VM and changing on windows the same did no work

though host was wireless, guest (ubuntu VM) acts as if it is connected by virtual cable so following solved the problem:
Ubuntu VM window > Devices > Network > Network Settings ... > check the box for Cable Connected


/etc/resolv.conf is symlink and will be symlink after you remove it, because resolvconf always resets it.

If you want to use Google DNS, add these lines to your /etc/resolvconf/resolv.conf.d/head :

nameserver 8.8.8.8   
nameserver 8.8.4.4

If you want to get your router to detect your virtual machine, you should use the "Bridged adapter". In Network adapters, change the box, which says "NAT" to "Bridged adapter". If you set it as bridged adapter, the virtual machine gets IP etc. from DHCP server. If your router doesn't have one or you don't have one in your network, then Virtualmachine cannot get the settings automatically and you must specify them by hand.

I'm not sure about that <blah>.ubuntu.com not resolving, but I would suggest you to try another mirror.

I use mirrors.ubuntu.com/mirrors.txt, which always contains the nearest possible mirrors. To use it, add these lines to your /etc/apt/sources.list:

deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse   
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse   
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse   
deb-src mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse   
deb-src mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse    
deb-src mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse

If you want to have backports too, add also these lines:

deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse   
deb-src mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse   

For me http://mirrors.ubuntu.com/mirrors.txt contains:

http://ubuntu.trumpetti.atm.tut.fi/ubuntu/

http://www.nic.funet.fi/pub/mirrors/archive.ubuntu.com/

http://mirrors.nic.funet.fi/ubuntu/

http://archive.ubuntu.com/ubuntu/

because I am in Finland.