How i can connect internet in linux

Closed
Khabiba - Sep 3, 2009 at 12:39 PM
 x0r - Oct 15, 2009 at 08:02 PM
Hello,
I am using two windows on one system. Window xp which is main window and linux in virtual box but i dont know how to internet internet in linux how it is working well in xp. any body can help me
Related:

2 responses

sadgurl Posts 697 Registration date Thursday May 14, 2009 Status Member Last seen November 24, 2010 219
Sep 3, 2009 at 01:25 PM
Hye, what program are you using to emulate the linux environement? normally they have tool to allow configure virtual hardware on real one, just map the virtual lan on your existing one (if you use a Ethernet connection for internet)
1
its not always that simple....

1st. make sure you Virtual Machine has Bridged access to your network. this is a MUST
this procedure depends on which virtual machine you use, in VM player its an easy icon on bottom right.

TO BECOME THE ROOT USER
to become root user type $sudo su (on some distros su=sulogin ) and enter your password when prompted.
(should go from USER$ to root#)


2. check which IP youve been assigned, if any at all. by typing ifconfig (do this as root)

if there is ONLY the loopback address (127.0.0.1), or if your IP isnt in the same domain as your windows computer (any of the first 3 octets are differant) do the following...

1. Determine which interface the Virtual Machine is using, maybe called "eth0"
(if have no clue type "vi /etc/network/interfaces" and choose the first ethX one you see (should be 0))
2. type #: ifconfig eth0 xxx.xxx.xxx.xxx (where xxx is each octet)

so if you windows XP has an IP address of 192.168.10.10, then you should type:
# ifconfig eth0 192.168.10.20

3. type ifconfig again to see if the correct address has been assigned to you.
4. try to ping the XP box, type #ping xxx.xxx.xxx.xxx (where xxx.xxx.xxx.xx is the XP IP address)
you should get a response ~ 1ms (should be 100% recieved)

IF IT STILL DOESNT WORK
5. type #: ifconfig eth0 up (Ive noticed that sometimes this is necessary after a proper address has already been assigned - at least on backtrack4)


worst case scenario. edit (using vi) /etc/network/interfaces
remove DHCP, and add in own assignments like this:

iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254

Thats the basics... avoid doing this in ANY gui, cause you wont learn a thing...
if you bridge your network and the internet just works, still do this, and assign yourself a static IP address.

I actually just bridged my Macbook Pros Airport adapter as a ethernet interface in linux, so i can get internet in linux without an ethernet cable. did the whole thing from the terminal..

good luck
0