I have gone through a lot of links available on internet to fix the issue of Ubuntu VM unable to access internet, but I found no solution. I use this laptop in my office (not from home). It could be specific to my environment, therefore I am creating this question here. Following are the details.
Problem Statement:
1) Ubuntu VM is unable to connect to internet. (eg. Can’t connect to www.google.com)
2) Ubuntu VM is able to connect to Host and thus able to browse web sites internal to the company.
I have the following software on my Office Laptop.
1) OS Windows 7 Professional. (Host)
2) Oracle VirtualBox Version 4.3.2.
3) Ubuntu 12.04 Desktop LTS Virtual Machine (Guest)
The VirtualBox network setup for Ubuntu VM is as below:
Adapter 1
Attached to : “NAT”
Name: no name
Advanced
Adapter Type: Intel PRO/1000 MT Desktop (82540EM)
Promiscuous Mode: Allow VMS
MCA Address: 080027E2E304
Cable Connected is ticked
There is no port forwarding
Adapter 2
Attached to: Host-only Adapter
Name: VirtualBox Host-Only Ethernet Adapter
Advanced
Adapter Type: Intel PRO/1000 MT Desktop (82540EM)
Promiscuous Mode: Allow VMS
MCA Address: 080027B5740B
Cable Connected is ticked
There is no port forwarding
The guest is able to ping host and host is also able to ping guest. This could be the reason why guest is able to only access internal web sites. The main problem is guest is not able to browse web sites external to the office, i.e it cannot connect to internet. Following is the ifconfig output from ubuntu.
eth0
Link encap:Ethernet HWaddr 08:00:27:e2:e3:04
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fee2:e304/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:99 errors:0 dropped:0 overruns:0 frame:0
TX packets:291 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:17115 (17.1 KB) TX bytes:33151 (33.1 KB)
eth1
Link encap:Ethernet HWaddr 08:00:27:b5:74:0b
inet addr:192.168.56.101 Bcast:192.168.56.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:feb5:740b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:65 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3848 (3.8 KB) TX bytes:11496 (11.4 KB)
lo
Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:119 errors:0 dropped:0 overruns:0 frame:0
TX packets:119 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:15122 (15.1 KB) TX bytes:15122 (15.1 KB)