Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Ethernet LAN connection from windows 7 to ubuntu 12.04 through virtualBox

I have Ethernet LAN network on my IBM laptop 64-bit which runs on Windows 7. I have installed VirtualBox 4.2.14 in order to run Ubuntu 12.04. The problem is how to configure the network.

The network on VB is set by Host only Ethernet adapter, IP4 address and mask are set by default. Ubuntu network on virtualBox are set by two adapters. Adapter 1 set to NAT and adapter 2 is set to host only adapter.

When I run Ubuntu I get connection on to internet as shown below. However, I cannot open the web browser. I have defined the network using /etc/network/interfaces without success. What is the exact info on /etc/network/interfaces that I need to have for eth2 and eth3?

nassar@nassar-VirtualBox:~$ sudo ifconfig -a
[sudo] password for nassar:
eth2      Link encap:Ethernet  HWaddr 08:00:27:f4:b9:04  
          inet addr:138.221.60.201  Bcast:138.221.61.255  Mask:255.255.254.0
          inet6 addr: fe80::a00:27ff:fef4:b904/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:120 (120.0 B)  TX bytes:9267 (9.2 KB)

eth3      Link encap:Ethernet  HWaddr 08:00:27:e2:b3:ae  
          inet addr:138.221.60.201  Bcast:138.221.61.255  Mask:255.255.254.0
          inet6 addr: fe80::a00:27ff:fee2:b3ae/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:22 errors:0 dropped:0 overruns:0 frame:0
          TX packets:73 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4039 (4.0 KB)  TX bytes:10837 (10.8 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:66 errors:0 dropped:0 overruns:0 frame:0
          TX packets:66 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4806 (4.8 KB)  TX bytes:4806 (4.8 KB)


nassar@nassar-VirtualBox:~$  route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         138.221.60.1    0.0.0.0         UG    0      0        0 eth3
138.221.60.0    0.0.0.0         255.255.254.0   U     0      0        0 eth2
138.221.60.0    0.0.0.0         255.255.254.0   U     1      0        0 eth3
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth2




nassar@nassar-VirtualBox:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 138.221.60.201 icmp_seq=1 Destination Host Unreachable
From 138.221.60.201 icmp_seq=2 Destination Host Unreachable
From 138.221.60.201 icmp_seq=3 Destination Host Unreachable
From 138.221.60.201 icmp_seq=4 Destination Host Unreachable
From 138.221.60.201 icmp_seq=5 Destination Host Unreachable
From 138.221.60.201 icmp_seq=6 Destination Host Unreachable
From 138.221.60.201 icmp_seq=7 Destination Host Unreachable
From 138.221.60.201 icmp_seq=8 Destination Host Unreachable
From 138.221.60.201 icmp_seq=9 Destination Host Unreachable
From 138.221.60.201 icmp_seq=10 Destination Host Unreachable
From 138.221.60.201 icmp_seq=11 Destination Host Unreachable
From 138.221.60.201 icmp_seq=12 Destination Host Unreachable
From 138.221.60.201 icmp_seq=13 Destination Host Unreachable
From 138.221.60.201 icmp_seq=14 Destination Host Unreachable
From 138.221.60.201 icmp_seq=15 Destination Host Unreachable
From 138.221.60.201 icmp_seq=16 Destination Host Unreachable
From 138.221.60.201 icmp_seq=17 Destination Host Unreachable
From 138.221.60.201 icmp_seq=18 Destination Host Unreachable
From 138.221.60.201 icmp_seq=19 Destination Host Unreachable
From 138.221.60.201 icmp_seq=20 Destination Host Unreachable
From 138.221.60.201 icmp_seq=21 Destination Host Unreachable
^Z
[1]+  Stopped                 ping 8.8.8.8



nassar@nassar-VirtualBox:~$ ping www.google.com
ping: unknown host www.google.com



nassar@nassar-VirtualBox:~$ sudo lshw -C network
  *-network:0             
       description: Ethernet interface
       product: 82540EM Gigabit Ethernet Controller
       vendor: Intel Corporation
       physical id: 3
       bus info: pci@0000:00:03.0
       logical name: eth2
       version: 02
       serial: 08:00:27:f4:b9:04
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 66MHz
       capabilities: pm pcix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000 driverversion=7.3.21-k8-NAPI duplex=full ip=138.221.60.201 latency=64 link=yes mingnt=255 multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:10 memory:f0000000-f001ffff ioport:d010(size=8)
  *-network:1
       description: Ethernet interface
       product: 82540EM Gigabit Ethernet Controller
       vendor: Intel Corporation
       physical id: 8
       bus info: pci@0000:00:08.0
       logical name: eth3
       version: 02
       serial: 08:00:27:e2:b3:ae
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 66MHz
       capabilities: pm pcix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000 driverversion=7.3.21-k8-NAPI duplex=full ip=138.221.60.201 latency=64 link=yes mingnt=255 multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:9 memory:f0820000-f083ffff ioport:d240(size=8)



nassar@nassar-VirtualBox:~$ lspci -nnk | grep -iEA3 "(network|ethernet)"
00:03.0 Ethernet controller [0200]: Intel Corporation 82540EM Gigabit Ethernet Controller [8086:100e] (rev 02)
    Subsystem: Intel Corporation PRO/1000 MT Desktop Adapter [8086:001e]
    Kernel driver in use: e1000
    Kernel modules: e1000
--
00:08.0 Ethernet controller [0200]: Intel Corporation 82540EM Gigabit Ethernet Controller [8086:100e] (rev 02)
    Subsystem: Intel Corporation PRO/1000 MT Desktop Adapter [8086:001e]
    Kernel driver in use: e1000
    Kernel modules: e1000
share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.