Iam unable to get internet connection inside guest(ubuntu) in virtual box although host(WinXP) has an internet connection. Tried with Nat: In Ubuntu it shows Wired connection connected but unable to browse sites.

Tried with Bridged adapter: In ubuntu it shows that wired connection is not connected.

Yes I use a proxy

I just appended the lines in the file.

"In the window that opens add the following lines modifying as appropriate to the file" can you explain what appropriate is. I am still not able to get connected to internet.

  • Have you installed guest additions? – Mitch Jun 26 '13 at 7:57
  • hey what are the guest additions? – Ravindra Jun 26 '13 at 8:41
  • Take a look at this Post. – Mitch Jun 26 '13 at 9:00
  • 1
    Do you use a proxy from the windows machine? – Warren Hill Jun 26 '13 at 12:58
  • 1
    Ravindra - you appear to have two accounts. Please click the contact-us link at the bottom of this page and request that your two accounts are merged. Thanks. – fossfreedom Jun 26 '13 at 17:57

Step 1:

Open a terminal CTRL+ALT+T and enter

sudo -i; 

You are now logged in as root so have the permissions required to save the files. Keep the terminal open. Type:

gedit /etc/environment

In the window that opens add the following lines modifying as appropriate to the file. By which I mean your proxy is probably not called myproxy.server.com:8080 use the proxy settings from your windows machine.


Save and close gedit.

Internet should now be working (next time you reboot) but you won't get any updates to fix this in the terminal you opened before type

gedit /etc/apt/apt.conf.d/95proxies

A new window will open add the following lines modifying as appropriate

Acquire::http::proxy "http://myproxy.server.com:8080/";
Acquire::ftp::proxy "ftp://myproxy.server.com:8080/";
Acquire::https::proxy "https://myproxy.server.com:8080/";

Save then close the terminal and reboot. All should now work as expected.

  • Awesome! I wish I had seen this earlier - would have saved me hours of fiddling with it... – jan groth May 4 '14 at 23:12

I normally use Bridged. Do you have DHCP enabled in the network settings, so the VM gets an IP-address from the router or dhcp-server? Click the network icon and then Connection Information. See what IP-address the machine has. Is it on the same network as the host? If it's like 192.168.1.xx, can you ping to (if the router has that address)? When I can't browse the internet, it normally means I use NAT for the VM, and it's IP-address is in the 10.x.x.x range. Unless your local network uses the same range, this means you have a local network for host-guest only.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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