LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 11-18-2013, 11:15 PM   #1
chakra1
LQ Newbie
 
Registered: Nov 2013
Posts: 15

Rep: Reputation: Disabled
How to communicate between two VirtualBox VMs running on same host


I am running two VM instances of RHEL/CentOS on my VirtualBox instance running on host Windows 7. The problem is when I am executing `VBoxManage list vms -l | more` and then sunsequently `VBoxManage guestproperty get <uuid> "/VirtualBox/GuestInfo/Net/0/V4/IP"`, I can see the same IP for both the VMs. I have set the internal networking `intnet` for both the VMs using Networks --> Adapter 2 --> PCnet-FAST III (Internal Network, 'intnet') and my understanding was that eth1 may have been the local network interface for the VMs. But both their IP is showing as 10.0.2.15. Is there a way I can access the IPs in the private VM network for the two VMs.

NOTE: I can also access only a single VM instance when accessing through Putty SSH client. And it is connecting to the proxy 127.0.0.1:2222 always. Thus I am not being able to distinguish between the VMs. I need separate instance accesses to run server and client codes on separate instances in a client-server architecture

I am attaching the VBoxManage command line outputs as executed on the host. I am running 1.3_2 and 1.3_3 sandboxes but both have same IP as shown below in bold:

C:\Program Files\Oracle\VirtualBox>VBoxManage list vms
"Hortonworks Sandbox 1.3" {4914b5c7-1395-47f5-80ef-8fbec8cadbd4}
"Hortonworks Sandbox 1.3_1" {f103f5d2-f949-4d67-a81e-c63ddc5335dc}
"Hortonworks Sandbox 1.3_2" {fc2b9f50-bf4a-4a5d-8189-22d62c7e1d67}
"Hortonworks Sandbox 1.3_3" {5976fff1-7a0d-4eca-bedf-7756f7076dbd}
C:\Program Files\Oracle\VirtualBox>VBoxManage guestproperty get fc2b9f50-bf4a-4a
5d-8189-22d62c7e1d67 "/VirtualBox/GuestInfo/Net/0/V4/IP"
Value: 10.0.2.15

C:\Program Files\Oracle\VirtualBox>VBoxManage guestproperty get 5976fff1-7a0d-4e
ca-bedf-7756f7076dbd "/VirtualBox/GuestInfo/Net/0/V4/IP"
Value: 10.0.2.15


On the VM sandbox 1.3_2, I ran the below command to get the local IP for eth0 as below:
[hue@sandbox ~]$ arp -an
? (10.0.2.2) at 52:54:00:12:35:02 [ether] on eth0
[hue@sandbox ~]$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.2.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1002 0 0 eth0
default 10.0.2.2 0.0.0.0 UG 0 0 0 eth0


Any ideas how can I find the distinct IPs for the different sandboxes?

NOTE: I tried to run the VBoxManage dhcpserver but it asks for `--ip` option and `--netmask` which I have provided as below with the following output:

C:\Program Files\Oracle\VirtualBox>VBoxManage dhcpserver add --netname intnet --
netmask 10.0.2.*
Oracle VM VirtualBox Command Line Management Interface Version 4.3.0
(C) 2005-2013 Oracle Corporation
All rights reserved.

Usage:

VBoxManage dhcpserver add|modify --netname <network_name> |
--ifname <hostonly_if_name>
[--ip <ip_address>
--netmask <network_mask>
--lowerip <lower_ip>
--upperip <upper_ip>]
[--enable | --disable]

VBoxManage dhcpserver remove --netname <network_name> |
--ifname <hostonly_if_name>


Syntax error: You need to specify --ip option


While trying to enable the dhcpserver, it already exists:

C:\Program Files\Oracle\VirtualBox>VBoxManage dhcpserver add --netname intnet --
ip 10.0.2.15 --netmask 255.255.255.0 --lowerip 10.0.2.101 --upperip 10.0.2.254 -
-enable
VBoxManage.exe: error: DHCP server already exists

Last edited by chakra1; 11-18-2013 at 11:48 PM.
 
Old 11-19-2013, 04:26 AM   #2
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 515

Rep: Reputation: 102Reputation: 102
If both have the same internal IP address, you wont be able to distinguish them.
Those VMs were cloned? If so, you might check their MAC addresses.
 
Old 11-19-2013, 05:15 PM   #3
jefro
Guru
 
Registered: Mar 2008
Posts: 11,965

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
I am not surprised that both have same IP address. Not sure it is by design or not however. One post suggested that you put two nic's in one of the machines and then use the second one.

Might ask why you are using nat. I do use it often but is it needed? Can you use static ip's in clients?

https://www.virtualbox.org/manual/ch06.html
 
Old 12-05-2013, 05:38 PM   #4
markotitel
Member
 
Registered: Feb 2009
Location: Titel - Serbia
Posts: 164

Rep: Reputation: 18
https://www.virtualbox.org/manual/ch06.html

Check section 6.6 .

If I correctly understood your problem I beleive this is the answer.
 
Old 12-09-2013, 01:19 AM   #5
julialloyds45
LQ Newbie
 
Registered: Dec 2013
Posts: 2

Rep: Reputation: Disabled
Thank u for such valuable answer, It will help me a lot....
 
Old 12-09-2013, 03:43 AM   #6
markotitel
Member
 
Registered: Feb 2009
Location: Titel - Serbia
Posts: 164

Rep: Reputation: 18
You are welcome...
 
  


Reply

Tags
clientserver, putty, ssh access, virtualbox


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Running 64bit Slackware on 32 VirtualBox host? barry_lamb Slackware 8 04-01-2013 12:35 PM
VMs on different servers cannot communicate sanaz Linux - Virtualization and Cloud 3 02-10-2013 05:26 PM
How to connect an ossec agent installed on Virtualbox to host machine running on Cent sriramdas Linux - Virtualization and Cloud 0 01-17-2013 08:44 AM
Access server running on localhost on host system through virtualbox guest OS Jean-Luc Besson Linux - Virtualization and Cloud 3 05-15-2012 04:19 PM
How secure is windows XP running as a virtualBox guest on a Slackware 12.2 host garyg007 Slackware 6 03-30-2009 12:15 PM


All times are GMT -5. The time now is 06:43 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration