connection between two VMs on two different hosts on the same network

This is for discussing general topics about how to use VirtualBox.
Post Reply
lulukent
Posts: 5
Joined: 5. Nov 2017, 04:25

connection between two VMs on two different hosts on the same network

Post by lulukent »

Hello,
I am a newbie on using virtualbox and first time posting here. :wink:
I am trying to setup a test environment with two host computers connecting to the same subnet both having internet access.Next I installed Virtualbox manager on both and created one virtual machine on each host.
I want to make the two virtual machines communicate. How can I do that?
I figured out how to make two virtual machines installed on the same host communicate by using "internal network" setting but no clue how to do it when you have two different hosts on the same network.

I have an ideea where I can enable the second NIC on both and setup that as NAT but not sure if I am going the right way.I am hoping for an easier way.Any documentation or link to a youtube like site would be appreciated it.

Thank you
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: connection between two VMs on two different hosts on the same network

Post by socratis »

Two separate hosts and two VMs (one on each host) communicating with each other? I believe it "begs" for the network option to be "Bridged". That way your VMs will act as another computer in your LAN, and you can have your VMs talk to each other and the hosts as peers.

The "Internal" will definitely *not* work, as each internal network is kept private. Per host. Neither won't NAT without the proper port forwarding.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
lulukent
Posts: 5
Joined: 5. Nov 2017, 04:25

Re: connection between two VMs on two different hosts on the same network

Post by lulukent »

not in my lab to confirm functionality but I have a quick question :

if I select bridge mode and VM is setup as DHCP ... is it goanna get an IP address from the same pool with the host computer?

depending on the answer my problem will be : if one VM is a win server with DHCP service installed on host 1 and second VM is a win 10 with DHCP on second host .... who will provide the DHCP for second VM ( same device that provide DHCP for hosts or the VM server?). I kind of need the VM server to provide dhcp to complete my test environment.

Thanks
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: connection between two VMs on two different hosts on the same network

Post by socratis »

lulukent wrote:if I select bridge mode and VM is setup as DHCP ... is it goanna get an IP address from the same pool with the host computer?
Chance are, yes.

As for the 2nd part of the question, it's a little bit complcated from your description alone. Why do you have 2 DHCP servers? One per host? On a LAN? Why?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
lulukent
Posts: 5
Joined: 5. Nov 2017, 04:25

Re: connection between two VMs on two different hosts on the same network

Post by lulukent »

allright ... I thought I was a little confused.

SOHO network with a router and 2 desktops( I called them hosts) wired connected . Both desktop take DHCP from router and are able to go out on the web.(

My lab intention : install Virtualbox manager and one VM machine on each host. First virtual machine is a win 2016 AD with DHCP.Second Win10 client.
I want second VM to be able to join domain on win 2016 and to be able to pickup DHCP from it on a different lan than host machines.

So my fear is when second VM (win10) is asking for DHCp it will take IP from my physical router instead of win 2016 server if used in bridge mode.Does it make sense?
I will try and come back with an answer.
lulukent
Posts: 5
Joined: 5. Nov 2017, 04:25

Re: connection between two VMs on two different hosts on the same network

Post by lulukent »

I switch to bridge on both VM's and they take DHCP addresses from my main router.
Now I can ping each other with those Ip address but I still cannot join win10 VM to server2016 domain :(.
I tried to set static IP address on both ... still no luck ....I have no problem joining the domain from a VM on the same host with the DC.
I can ping by ip and name from workstation VM to DC but when I try to join domain it doesn't find it.

This will keep me awake for a couple night now :) .... all this because we tried in school and it didn't work.Now I try to find a solution on my own.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: connection between two VMs on two different hosts on the same network

Post by Perryg »

Make sure that the clients use the DC's DNS. Actually now that you have the network as it should the rest is outside the scope of this forum.
BillG
Volunteer
Posts: 5105
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: connection between two VMs on two different hosts on the same network

Post by BillG »

As PerryG said, it is outside the scope of this forum. Your problems are with DHCP, DNS and Windows domains, not VirtualBox.

Hints: You should never have two DHCP servers running in the same network. Make up your mind which one you want to use, and make sure that all vms use the DC as their DNS server.

It is possible - I have done it.
Bill
lulukent
Posts: 5
Joined: 5. Nov 2017, 04:25

Re: connection between two VMs on two different hosts on the same network

Post by lulukent »

Thank you guys for help.
I am at the point where I gave static IP addresses to both VMs and win10 configuration has the server2016 ip address as the only DNS.
It gets to the point where is asking me for user and pass for account with domain privileges to add computers to the domain but after that it gives me an error saying that it cannot find the DC.I agree this problem is outside the scope of this forum and I will look for answer somewhere else.The only reason I insisted it was because I had no problem to do it when win 10 VM was on the same host with server2016 VM.

Thank you again for all great support I got.
Have a good day :D
Post Reply