Internet not working on a VirtualBox Linux machine

4

I installed VirtualBox on a Windows 7 PC and installed Xubuntu (Ubuntu with XFCE) on it. Now on the Windows, I am connected to the internet through a LAN which automatically authenticates to connect to the network(because its my work computer). I have also installed the guest additions on this virtual machine (Xubuntu). I tried both NAT and bridging to set up internet connection but I still cannot connect to the internet.

For NAT: The browser doesn't say website not found but it keeps trying to load it forever and the network status monitor (the one provided by VirtualBox) doesn't show any green light (no incoming packets).

For Bridging: Same as for NAT but the network status monitor shows incoming packets and outgoing packets. But internet still doesn't work.

I tried a lot of different things but none worked.

mtahmed

Posted 2011-09-08T02:59:43.440

Reputation: 153

Answers

5

I just upgraded the the latest version of VirtualBox and had the same problem. In the networking settings, open 'advanced' and make sure the 'cable connected' box is checked. When I upgraded, it unchecked and caused me about an hour of frustration before I figured it out.

Z.K.

Posted 2011-09-08T02:59:43.440

Reputation: 51

How is this an answer to anything? This is just a rant! Please avoid posting rants in answer spaces. If you really want to say something like this, post it in the comments to the appropriate question/answer. Thank you. – mtahmed – 2013-01-18T23:34:46.237

4mtahmed - please allow me to disagree, i am having this problem right now and found this post. Z.K.'s answer solved the problem for me, indeed the 'cable connected' box was unchecked after an upgrade. Thanks Z.K! – Shlomi – 2014-04-11T21:07:53.297

1

Do you have multiple network cards/devices showing in Xubuntu? I have seen this issue before where the guest connects to a network without internet.

You could try making the guest connect to a network that has internet avaliable. In your case this would be the networking device that is connected as NAT through the host.

F21

Posted 2011-09-08T02:59:43.440

Reputation: 225

No Xubuntu shows only one network card (eth0). And with bridging, the guest network adapter gets an IP similar to the host IP but on NAT, the guest IP is completely different? Is this supposed to happen? – mtahmed – 2011-09-08T13:34:42.457

1

Do you have multiple network adapters in Windows? If so, check that Virtual Box is using the adapter that has access to the Internet.

Stacey Richards

Posted 2011-09-08T02:59:43.440

Reputation: 1 292

No I only have one adapter and VirtualBox is using that one I believe. – mtahmed – 2011-09-08T13:33:16.687

1

I'm new to VirtualBox myself, but using FreeBSD guest I had no problem when using NAT on the interface.

Did you run a DHCP client for interface when trying NAT? What's the output of ifconfig?

Nornagest

Posted 2011-09-08T02:59:43.440

Reputation: 74

dhclient executes successfully and ifconfig shows that if have one lo (loopback) and one eth0. Their ips are as mentioned in a comment to one of the other replies. – mtahmed – 2011-09-08T13:35:58.663

That's a good start to narrow the problem down. You should activate connection sharing for the internet connection of your host system, this might be the problem. – Nornagest – 2011-09-08T13:41:15.600

I have already shared the internet connection, doesn't work. Also, VBox installed a "Host-Only" network adapter on the Windows machine; does that need to be enabled for bridging/NAT? – mtahmed – 2011-09-08T13:46:56.743

If you want to do some reading, the manual is quite good: http://www.virtualbox.org/manual/ch06.html

The Host Only adapter should be enabled. I hope you already rebooted your host - this might always help with Windows. ;-) Your guests IP via NAT should be 10.0.2.x, try pinging 10.0.2.2, your hosts IPs (the Host Only adapter, your usual NIC and maybe your internet gateway). Which of these work?

– Nornagest – 2011-09-08T13:59:56.757

I pinged my gateway, the DHCP servers, the DNS, all work. But I still cannot access the internet. – mtahmed – 2011-09-08T14:31:03.753

0

Virtual Box has a tiny oblivious icon that must be clicked to enable the connection. Right click on the networking icon, that will show a disconnected cable icon. See this link for an image of the menu option to click.

norootsquash

Posted 2011-09-08T02:59:43.440

Reputation: 21

Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change. – DavidPostill – 2015-01-12T08:52:32.110

Done! updated with a description, thanks for the suggestion @DavidPostill – norootsquash – 2015-01-20T20:02:58.897