Page 1 of 1

NAT functionality of VBox compared to VMWare

Posted: 17. Apr 2010, 14:42
by MheAd
Hi guys,
I've been mostly using different VMWare products when it comes to virtualization and can't quite understand the logic behind NAT function in VirtualBox.

As comparison, in VMWare, when using NAT, every guest would get access to the outside world using the virtual interface from the host as gateway. Also, every guest would get an unique, internal network IP assigned to its own interface.

On VBox, on the other hand, it works pretty much the same way except the fact that every guest gets the same internal address (10.0.0.15 in my case). Because of this, if guests are supposed to reach each other, one must create an additional, host-only interface to all guests. Same goes out to if the actual host needs to communicate with the guests (unless port forwarding in Vbox is used).

I'm simply wondering why is it done this way in Vbox and whether there is possibility to override this during creation of guest VMs, or at least modify the existing VMs - so I can give them an unique 10.0.0.0/24 address on NAT - thus make them able to reach the outside world AND communicate with eachother with no need of an additional host-only interface?

Re: NAT functionality of VBox compared to VMWare

Posted: 17. Apr 2010, 15:38
by kebabbert
Bridged network doesnt suffice?

Re: NAT functionality of VBox compared to VMWare

Posted: 17. Apr 2010, 16:33
by MheAd
kebabbert wrote:Bridged network doesnt suffice?
Not for my needs. And, essentially, NAT and Bridged networking are two different things.

Re: NAT functionality of VBox compared to VMWare

Posted: 20. Apr 2010, 11:06
by Sm0k1n
I was wondering the same thing, but unfortunately I was not able to get any machines on the same NAT. My solution is to have them all on an internal network and get another VM to act as a router between the internal network and the outside world. It works just like a regular private network even though it's a bit of an overkill to have another VM that just routes traffic...

Re: NAT functionality of VBox compared to VMWare

Posted: 20. Apr 2010, 14:40
by MheAd
Sm0k1n wrote:I was wondering the same thing, but unfortunately I was not able to get any machines on the same NAT. My solution is to have them all on an internal network and get another VM to act as a router between the internal network and the outside world. It works just like a regular private network even though it's a bit of an overkill to have another VM that just routes traffic...
Strange indeed.
I solve the problem by letting all VMs using NAT function as their main interface (the same 10.0.2.15 IP address that they get) and also add an additional Host-only interface with an unique static address (or let built in DHCP handle this on that network). That way, all of the VMs are able to reach the outside world (via NAT), communicate with eachother (via Host-only network) and even reach to / be reached by the actual physical host (which also gets vboxnet0 interface with an address on the same host-only net). That way I eliminate the need of an extra VM that acts as gateway - but it's a cool experiment - I've done that too :)

Basically, the main difference in networking logic between VMWare and Vbox is this NAT-thing.
By _only_ using NAT on VMware I get directly the effect above - with no need for extra host-only interface, as every NAT-ed VM gets an individual internal network IP and can do all the things I mentioned above.

So the question still remains how the developers of VBox were thinking. The NAT on VMWare lives more up to its name/function.

Re: NAT functionality of VBox compared to VMWare

Posted: 20. Apr 2010, 15:09
by Sm0k1n
MheAd wrote:...
So the question still remains how the developers of VBox were thinking. The NAT on VMWare lives more up to its name/function.
I think it's a matter of security and ease of use. By just clicking on NAT in the networking options you get internet access and you don't have to worry about any of the machines messing around with each other.
It would be best if there is the option to have NAT networks behave kind of like the internal networking thing. You just add the name of the network to each vm and it's done. :roll: Or... the devs could add an option to enable/disable external access to the internal network. :)

Re: NAT functionality of VBox compared to VMWare

Posted: 20. Apr 2010, 15:19
by MheAd
Sm0k1n wrote:
MheAd wrote:...
So the question still remains how the developers of VBox were thinking. The NAT on VMWare lives more up to its name/function.
I think it's a matter of security and ease of use. By just clicking on NAT in the networking options you get internet access and you don't have to worry about any of the machines messing around with each other.
It would be best if there is the option to have NAT networks behave kind of like the internal networking thing. You just add the name of the network to each vm and it's done. :roll: Or... the devs could add an option to enable/disable external access to the internal network. :)

Well, that's exactly how NAT function in VMWare works. It's not more complicated in any way - it gives you direct connection to the internet + it adds these features that nobody forces you to use. You don't have to mess with networking / IP addresses in any way (if you don't want to) - everything is done automatically (internal DHCP function) in VMware. So VMWares NAT works pretty much the way you wish VBox should :)

And I hope devs will make it that way in future. I mean, until not that long time ago even the bridged networking forced one to do a lot of work. But now it works just like the one on VMWare. Hopefully, in one of these days, same will happen to NAT.