LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 03-01-2011, 11:52 PM   #1
ankscorek
Member
 
Registered: Mar 2003
Distribution: Slackware10.2,SUSE,FC,RHL,Vector Linux,WHAX,PHLAK,bt4,ubuntu,debian,aptosid,backtrack,blackbuntu
Posts: 529

Rep: Reputation: 31
virtual box::router with host as xp


Hi friends its been long since i came back here...but now i missed u all and so i am posting another query

I am using win XP as host and ubuntu 9.10 as guest

i am running a PCMCIA card and a ethernet cable on win XP

i need both them on virtual box from where i can do an ip forward from one adapter to the other..


its mainly i want to go in for a router using virtual box so that all data is routed via virtual box and not via the host os which is XP in my case..

router laptop has ethernet connection in the address range of 10.22.xx.xx subnet 255.255.0.0 and

pcmcia network card wireless supporting 802.16 with ip range of 192.168.xx.xxx subnet 255.255.0.0

i want to make the 192 network talk to 10 network using virtual box as a router...no involvement of win XP

the pcmcia card has its own dhcp server and is capable of supporting a mesh architecture....

the host has the driver enabled for the card and hence card works fine on the host

pcmcia card and ethernet card are connected in a bridged mode to the virtualbox.....

i disabled the tcp/ip on the host in the case of pcmcia card..

in the guest pcmcia is not getting any ip address..whereas ethernet is getting some address but i am unable to access the internet from the guest ...the internet is connected via ethernet cable on the host......

subsequently i managed eth4(pcmcia) and eth5(cable) in bridged mode and i also enabled ip fwd =1

here is my routing table

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.22.0.0       *               255.255.0.0     U     0      0        0 eth5
link-local      *               255.255.0.0     U     1000   0        0 eth4
192.168.0.0     10.22.1.1       255.255.0.0     UG    0      0        0 eth5
192.168.0.0     192.168.5.34    255.255.0.0     UG    0      0        0 eth4
192.168.0.0     *               255.255.0.0     U     0      0        0 eth4
default         10.22.1.1       0.0.0.0         UG    100    0        0 eth5
the clients on 192 network still cant access internet..

they cant ping the static ip of the card

they can ping the inbuilt dhcp server ip of this card..


snippet of my /etc/network/interfaces file

Code:
auto eth4
iface eth4 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 10.22.6.171
gateway address is the address of the ethernet cable which is eth5 on virtual box

scenario is that i have 2 machines one virtual box and the other windows

the virtual box has 2 bridged adapters one is a cable and the other is a pcmcia card. pcmcia card is used to connect to the windows machine which is also having a pcmcia card..both cards have been given static ip addresses

these cards have inbuilt dhcp server with ip address

the windows machine is able to ping the virtual box dhcp server address inbuilt in the card but cannot ping the ip address..however when virtual box tries to ping windows dhcp ip address it returns destination unreachable

when i added a unicast entry in the routing table i got this error for the same ping from vb to windows

Code:
connect: Network is unreachable
when i tried to bring my windows machine in the VB then also it was unable to ping the ip it was pinging earlier and also behaved in the same manner as the VB
please someone any suggestions
 
Old 03-02-2011, 04:47 AM   #2
kuyalfinator
Member
 
Registered: Jul 2003
Location: Los Angeles
Distribution: RedHat8 2.4.18-14 RedHat9 2.4.20-8 FreeBSD 5.2.1 Ubuntu 10_4 Mandrake 2.4.21-0.13mdk
Posts: 118

Rep: Reputation: 16
When running a virtual machine, host and guest communicate using NAT. When your on the guest machine, it doesn't know about the host ip. I remember reading the Virtual Box manual about it.
 
Old 03-02-2011, 08:02 AM   #3
ankscorek
Member
 
Registered: Mar 2003
Distribution: Slackware10.2,SUSE,FC,RHL,Vector Linux,WHAX,PHLAK,bt4,ubuntu,debian,aptosid,backtrack,blackbuntu
Posts: 529

Original Poster
Rep: Reputation: 31
but in my case i cant plug into a NAT mode as i have to set it up for a router..

moreover the distant client which is hooked using the pcmcia card cant ping the ethernet cable...

so what do u suggest please

moreover i have disableed the tcp/ip of winxp

maybe some iptable entries or route table entries

Last edited by ankscorek; 03-02-2011 at 08:21 AM.
 
Old 03-02-2011, 08:09 AM   #4
kuyalfinator
Member
 
Registered: Jul 2003
Location: Los Angeles
Distribution: RedHat8 2.4.18-14 RedHat9 2.4.20-8 FreeBSD 5.2.1 Ubuntu 10_4 Mandrake 2.4.21-0.13mdk
Posts: 118

Rep: Reputation: 16
The Virtual Box manuals have secret commands and you just have to search the manual. Its all NAT when dealing with host and guest communications. Oh, don't forget about ports.

The physical router has something to do with ports too. If I get this right, your trying to get two guest machines to communicate with each other. NAT and ports may be it.

Oh, don't forget to check your firewall as well.

Last edited by kuyalfinator; 03-02-2011 at 08:13 AM. Reason: NATs, Ports, Firewall
 
Old 03-02-2011, 08:24 AM   #5
ankscorek
Member
 
Registered: Mar 2003
Distribution: Slackware10.2,SUSE,FC,RHL,Vector Linux,WHAX,PHLAK,bt4,ubuntu,debian,aptosid,backtrack,blackbuntu
Posts: 529

Original Poster
Rep: Reputation: 31
i did a wireshark for the traffic

but cud not make much out of it..ARP was detecting the address but was not getting any echo...

plus maybe i feel i need some iptables and routing entries

there is no firewall and no port blocking as of now
 
Old 03-02-2011, 05:26 PM   #6
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
I cannot guarantee this will work, using a type 1 virtualization solution like XEN that can do PCI passthrough would be better as you could give full control of the PCMCIA card to the VM, but I digress.

First put both virtual network adapters in the VM in bridged mode, do this in the virtual machine properties while the machine is turned off. Select one virtual adapter bridged to the built in network device and the second one to the PCMCIA wireless card.

This will pull an address from DHCP on the 10 network (if it's setup that way, otherwise you will need to set up static settings) On the wireless adapter the VM won't see it as a wireless adapter, so you will need to set up the ad hoc network broadcast in Windows. Theoretically this will work. I have bridged put a VB VM in bridged mode to a wireless card before but never trying to broadcast it as an AP but to be used as a client. I authenticated to the AP in the host and even though the host didn't pull an address I could pull on in the VM. I don't think this will work because Linux really needs control of the wireless adapter to put it in master mode which is what allows it to be used as an AP or wireless router. As another side note not all wireless adapters can be put in "Master Mode" and depending on the driver the card may support it, but the driver doesn't
 
Old 03-02-2011, 06:27 PM   #7
kuyalfinator
Member
 
Registered: Jul 2003
Location: Los Angeles
Distribution: RedHat8 2.4.18-14 RedHat9 2.4.20-8 FreeBSD 5.2.1 Ubuntu 10_4 Mandrake 2.4.21-0.13mdk
Posts: 118

Rep: Reputation: 16
You must tell the virtual machine to open ports to communicate with the host and other systems that is seperate from the host.
 
Old 03-02-2011, 08:09 PM   #8
ankscorek
Member
 
Registered: Mar 2003
Distribution: Slackware10.2,SUSE,FC,RHL,Vector Linux,WHAX,PHLAK,bt4,ubuntu,debian,aptosid,backtrack,blackbuntu
Posts: 529

Original Poster
Rep: Reputation: 31
Quote:
You must tell the virtual machine to open ports to communicate with the host and other systems that is seperate from the host.
please amplify

scheidel i am using it in bridged mode and ip is set to static and from there the issues are of communication from vb to winxp which is not on the same machine but on a different machine which is totally a different set of hardware

Last edited by ankscorek; 03-02-2011 at 08:11 PM.
 
Old 03-02-2011, 08:19 PM   #9
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
Can you ping out from the VM to the 192 network? It seems like it is either not bridging properly or perhaps the DHCP server on the card is screwing things up. Can you tell us hat card it is model, brand etc...
 
Old 03-02-2011, 10:48 PM   #10
kuyalfinator
Member
 
Registered: Jul 2003
Location: Los Angeles
Distribution: RedHat8 2.4.18-14 RedHat9 2.4.20-8 FreeBSD 5.2.1 Ubuntu 10_4 Mandrake 2.4.21-0.13mdk
Posts: 118

Rep: Reputation: 16
Quote:
Originally Posted by ankscorek View Post
please amplify

scheidel i am using it in bridged mode and ip is set to static and from there the issues are of communication from vb to winxp which is not on the same machine but on a different machine which is totally a different set of hardware
Check the Sun Virtual Box manual under the docs directory of your virtual box installatin. Its titled "Virtual Network - Network Address Translation (NAT)" You are going to do a port forwarding going through NAT. You are going to specify what the guest port will using and match it with what the host port will communicate with. The example they provide is as follows:

Code:
VBoxManage setextradata "Linux Guest"
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP
VBoxManage setextradata "Linux Guest"
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22
VBoxManage setextradata "Linux Guest"
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222
What I did to save myself retyping it is place the command in a batch file and would call it the service I am using following the guest and host ports. So, for example, this is the SSH_GuestPort_HostPort = SSH_port22_port222.

Last edited by kuyalfinator; 03-02-2011 at 10:52 PM. Reason: Added example code from Sun Virtual Box Manual and batch file naming example
 
Old 03-02-2011, 11:32 PM   #11
ankscorek
Member
 
Registered: Mar 2003
Distribution: Slackware10.2,SUSE,FC,RHL,Vector Linux,WHAX,PHLAK,bt4,ubuntu,debian,aptosid,backtrack,blackbuntu
Posts: 529

Original Poster
Rep: Reputation: 31
Quote:
r perhaps the DHCP server on the card is screwing things up.
I agree here...but once i have provided static ip is the DHCP server still screwing?

Quote:
Check the Sun Virtual Box manual under the docs directory of your virtual box installatin. Its titled "Virtual Network - Network Address Translation (NAT)" You are going to do a port forwarding going through NAT. You are going to specify what the guest port will using and match it with what the host port will communicate with. The example they provide is as follows:
thanks today i will test this i suppose...however i am in a bridged mode and not NAT mode

Last edited by ankscorek; 03-03-2011 at 04:29 AM.
 
Old 03-03-2011, 07:56 PM   #12
ankscorek
Member
 
Registered: Mar 2003
Distribution: Slackware10.2,SUSE,FC,RHL,Vector Linux,WHAX,PHLAK,bt4,ubuntu,debian,aptosid,backtrack,blackbuntu
Posts: 529

Original Poster
Rep: Reputation: 31
well these suggestions did not get me working as i am in a bridged mode..

i was wondering if someone can point me to a 4G microtik like routerOS iso

maybe i can use it on my virtual box
 
Old 03-06-2011, 03:19 AM   #13
kuyalfinator
Member
 
Registered: Jul 2003
Location: Los Angeles
Distribution: RedHat8 2.4.18-14 RedHat9 2.4.20-8 FreeBSD 5.2.1 Ubuntu 10_4 Mandrake 2.4.21-0.13mdk
Posts: 118

Rep: Reputation: 16
Did you check if the router your using isn't blocking NAT?
 
Old 03-06-2011, 08:41 PM   #14
ankscorek
Member
 
Registered: Mar 2003
Distribution: Slackware10.2,SUSE,FC,RHL,Vector Linux,WHAX,PHLAK,bt4,ubuntu,debian,aptosid,backtrack,blackbuntu
Posts: 529

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by kuyalfinator View Post
Did you check if the router your using isn't blocking NAT?
this is a nice suggestion..router i am assuming ur referring to the router on the virtual machine..the interfaces on the virtual maachine are in bridged mode..now where do i check for the NAT? secondly the iptables rules are also in place..thirdly i am only using the virtual machine tcp/ip stack as i have disabled the tcp/ip on the host
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux host with windows guest virtual box Hioushi Linux - Virtualization and Cloud 8 02-17-2011 05:35 PM
how to set up host network in virtual box sunils1973 Linux - Virtualization and Cloud 1 01-20-2011 12:17 PM
sharing between virtual box and a host Clouds Linux - Networking 4 02-13-2009 11:19 AM
A good distro to use as a virtual box host krimsonking Linux - Distributions 1 11-04-2008 01:42 AM
Router Virtual Host Problem E-Oreo Linux - Networking 1 09-15-2004 07:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 09:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration