VirtualBox Ubuntu can not connect to internet

5

3

I am running an Ubuntu 13.04 in the VirtualBox on Windows7. The network option is NAT.

The problem is I can use apt-get command to get some package on the internet like : curl. I can access those share computers on my Win7.

it is really wired that I just sent an email using Thunderbird. But I can not access internet through Firefox.

However, I can not access the internet through Firefox. And no response while ping www.google.com.

That's all!

leo

Posted 2013-09-21T11:41:41.873

Reputation: 51

can you show us some more information? open a console (ctrl t), type sudo ifconfig, also test DNS, (again in console) "ping www.google.com" and finally "ping 8.8.8.8" – Sverre – 2014-07-21T04:16:41.477

Answers

6

It looks like you have not set up the DNS service on your Ubuntu guest. The following commands should take care of that.

sudo su
echo "nameserver 8.8.4.4" >> /etc/resolv.conf
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
exit

MariusMatutiae

Posted 2013-09-21T11:41:41.873

Reputation: 41 321

agree, seems like a DNS problem. – Sverre – 2014-07-21T04:17:59.560

2

Use NAT mode instead of Bridged Mode, make sure your connection works, if it does, then there's something wrong with the Network settings you used in Bridged mode, if it doesn't it's probably your network card, router, or something else.

Mars

Posted 2013-09-21T11:41:41.873

Reputation: 282

0

Sometimes VirtualBox doesn't add networks automatically. From the main menu (not a specific machine) goto:

File >> Preferences >> Network

Add network by pressing + sign at the right column.

enter image description here

enter image description here

Xaqron

Posted 2013-09-21T11:41:41.873

Reputation: 148

0

On the Settings for the Ubuntu VM change the network option to Bridged Adapter. Some information from the VirtualBox manual:

With bridged networking, VirtualBox uses a device driver on your host system that filters data from your physical network adapter. This driver is therefore called a "net filter" driver. This allows VirtualBox to intercept data from the physical network and inject data into it, effectively creating a new network interface in software.

The VirtualBox networking engine may not be working as intended, which may be causing the issues you're seeing.

Additional Info: An advantage of using the Bridged Adapter option is that it would make the VM appear as a physical device on your network, therefore allowing you to share folders/files just like you would be able to with a physical device. This is particularly useful when setting up a Server VM.

Yass

Posted 2013-09-21T11:41:41.873

Reputation: 3 276

Hi, Thanks you. I just tried your idea. But still can not connect to internet. The internet connection tray (on the top right of the screen) turns into that like wireless connection from the double arrow. And massage says disconnected. And I even lost Thunderbird connection. when I ping www.google.com . It says "Ping unkown host www.google.com" – leo – 2013-09-22T00:29:37.453

When you use the Bridged Adapter option, does the drop-down show the name of your physical adapter? For example, mine says Intel(R)..... – Yass – 2013-09-22T08:49:50.163

yes, the setting page like below: /////////////////////////////////////// Enable Network Adapter Attached to: Bridged Adapter Name: Inter(R) 82579LM Gigabit NetWork Connection Advanced Adapter Type:PCnet-FAST III(Am79C973) Promiscuous Mode:Allow VMs MAC Address:080027C3B7E Cable connected /////////////////////////////////

Still can not surf internet on Firefox. But can send email using Thunderbird. – leo – 2013-09-22T10:31:32.063