Updated:5.20: Multiples Guests communicating with [NAT ?]

This is for discussing general topics about how to use VirtualBox.
Post Reply
Ivan_Gorrion
Posts: 3
Joined: 18. May 2012, 09:50

Updated:5.20: Multiples Guests communicating with [NAT ?]

Post by Ivan_Gorrion »

I can now post links so check my second post for more details.

tl;dr (is that right ?) or condensed if you will (please do!)
Windows Server 2008 and 7 VMs using NAT need to have static IP addresses 192.168.2.X and ping each other but can't
CentOS (will need to talk to those but for now trying with other OSes) static IP 192.168.2.X ping and SSH other VMs using NAT ? (Bridge would work but Windows NAT so would be nice to have them all the same)

Thanks for taking your time to read this and any help you can provide would be greatly appreciated.
Last edited by Ivan_Gorrion on 20. May 2012, 14:18, edited 3 times in total.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Multiples Guests communicating with each other [NAT ?]

Post by Perryg »

Don't confuse your LAN NAT with the VirtualBox NAT.
You should use VBox Bridged mode to connect to your LAN NAT. If you also use the VirtualBox NAT the guests will *not be able to talk to each other.
Ivan_Gorrion
Posts: 3
Joined: 18. May 2012, 09:50

Re: Multiples Guests communicating with each other [NAT ?]

Post by Ivan_Gorrion »

@Perryg: is it possible to have something and not know about it ? Or well I suppose you could ask people what type of CPU they have and ask if they have one. But right I don't recall having a LAN NAT could you elaborate on that ? Or maybe the answer is in my longer post below ? Sorry it's a bit rough. But yeah from my findings VMs with NATs can't communicate with each other but what does one do when the instructors says that you must do so ?

Topic at hand (school assignment):
First: Two Windows (Server 2008 & 7)VMs on the same network [outside of the actual physical network (so no contact with the host or the outside world)] need to be able to communicate with each other. e.g. ping, smb, etc. ? and their adapter has to be NAT.
Host computer is running Windows 7 x64 8GB of RAM dual-core processor ethernet connection to school network. Virtualbox 4.X with extensions.
Guests have Guest Additions Server 2008, 7, CentOS 6.2 all are x86 and have 2GB of RAM.
Second: Windows 7 & CentOS have to be able to communicate with each other.
Host: My computer Arch Linux x64 8GB RAM quad-core ethernet connection to router. Virtualbox 4.1.14_OSE with extensions
Guests so far: CentOS 6.2 x86, Ubuntu 12.04 x86, Ubuntu 12.04 x64. And I guess Fedora 16 x64, Windows XP Pro x86, KfreeBSD x64 (varying 2-4GB RAM). Yes to all for Guest Additions.

Assignment says CentOS has to either have NAT or Bridged connection. Seeing as instructor said that the Windows boxes have to be in NAT it seems practical to keep it all the same.
I noticed that when running multiple machines they all have 10.0.2.15 as their IP address.

Any enlightenment would be greatly appreciated.
Last edited by Ivan_Gorrion on 20. May 2012, 14:18, edited 3 times in total.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Updated:5.20: Multiples Guests communicating with [NAT ?

Post by mpack »

I think you would be well advised to boil your question down to one or two sentences, if you expect anyone to bother reading it.
Ivan_Gorrion
Posts: 3
Joined: 18. May 2012, 09:50

Re: Updated:5.20: Multiples Guests communicating with [NAT ?

Post by Ivan_Gorrion »

Lol, first they say make it as detailed as possible now cut it down. No one likes to read. Wait I do no one likes to read really terrible ramblings and that I can agree with sorry for my poor English skills. But I've cut it down quite a bit and left out what I've tried and searched for I'll post that here this post in case anyone feels like it. If it needs to be trimmed even more let me know and I'll ask someone to help me squeeze out as much as I can and to fix my terrible grammar and spelling.

Stuff I've tried not needed for this but figured I should throw it in there:
First search I find is: http://security.stackexchange.com/quest ... -lab-setup
Not exactly sure what this Iszi person is saying (sounded a bit off to me) but it sounds like NAT and Bridge are the only ways to communicate between VMs.
Then I find this: viewtopic.php?f=8&t=4375 which seems to indicate to me that communication between two machines using NAT cannot communicate with each other. Although I don't know this Frank (Who works for Oracle ? If so I would figure he knows his stuff but maybe I'm wrong) and the post is old so I look around some more. And this is a Networking teacher so one would hope he knows what he's doing. Although he didn't seem to be aware of the difference between port 21 and 22 till someone told him he was trying to SSH via the FTP port but whatever. And his answer to when a student asks for help is something along the lines of, "You're stupid go figure it out yourself." Hence, why I got called I guess (even though this isn't really my department but with an attitude like that I figured I'd give it a shot)
There was a post to this: http://www.virtualbox.org/manual/ch06.h ... rkingmodes
But it didn't really seem to help out ? Unless I missed something ? Maybe about port forwarding ?
Then I end up here: http://www.virtualbox.org/manual/ch09.html#changenat
Which does sort of help with a further part of the assignment which is changing the IP addresses to 192.168.0.X on all systems. Which was doable on Server 2008 and 7 but they couldn't communicate with one another.
Changing the addresses on the Linux machines here locally on LiveCD and the installed ones with guest additions etc. were changeable but again no communication could be established between them. I did not follow this step though seeing as I'm not fully aware of what it'll do if this is the required stepped if someone could inform me of that that would greatly be appreciated!

Next step was to use the search box on this site. I found: viewtopic.php?f=1&t=26757&p=119375&hili ... er#p119375
Says it's only possible via Host-Only which is not what the teacher wanted. And maybe this is only for laptops seeing as the posted did say it was just for laptops. All hosts are desktops.
No good wants to communicate with the host and using host-only ? if understood correctly: viewtopic.php?f=1&t=40867&p=183897&hili ... er#p183897
This looks more like what we are looking for except it says it's ONLY possible with host-only not what the teacher wants: viewtopic.php?f=1&t=26536&p=118447&hili ... er#p118447
Again host-only. That is what this poster's instructor told them to do. But a pentest is completely and utterly different from ping and smb I'm sure: viewtopic.php?f=1&t=23430&p=103611&hili ... er#p103611
I don't think this is anything like what is needed but it does talk about port forwarding which is what I'm thinking needs to be done for all these guests to communicate with each other when they use NAT ? Although that doesn't sound right in my head: viewtopic.php?f=1&t=17080&p=72791&hilit ... her#p72791
And the rest I found I couldn't decypher as in no one replied to the posts.

Also it says in the first post I read http://www.virtualbox.org/manual/ but I'm still not entirely sure how to get things done.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Updated:5.20: Multiples Guests communicating with [NAT ?

Post by Perryg »

Well I read some of this and can say that there are a lot of instructors out there that do not really understand the concept at all.
Yes you do need to isolate the test domain from the local domain and VirtualBox can do that for you. First like I said the local LAN for most users when using a non-routable IP address range is considered to be using NAT (network address translation). If you try to use the VirtualBox NAT these too are non-routable specifically designed to isolate guests and will not be able to talk to each other unless you use port forwarding. Not a real easy approach considering that you will be trying to forward a port to several machines. If you want this to actually work and in the easiest way you should use the Internal network mode provided by VirtualBox for just this scenario. It emulates a network switch and the guests will all see that they are connected to a virtual network switch.

The easiest and for most the best way to use and test Windows domains in VirtualBox
Setup Windows Domain in VirtualBox

Remember that if the guests do not need to see the Internet you do not need to setup the Virtual router.
Post Reply