Windows – Bridged vs. NAT: a Virtualbox and VMWare Comparison

nat;networkingvirtualboxvmware-workstationwindows

I installed VMWare Workstation 7.1.x and Virtualbox 4.0.8 on two different hosts, so I could compare.

I set the virtual network adapter on both to NAT, which was successful for both. The result:

Virtualbox address: 10.10.2.13
VMWare address: 192.168.0.20

The IP assigned to the VMWare guest was expected. But I was surprised by the IP address given to the virtualbox. These machines are on my home network, which only have NAT addresses (192.168.x.x), so when I saw the 10.10.2.x – I was somewhat amazed.

Then I switched both VMs to use bridged networking. The VMWare guest continued to use a NAT address, but the Virtualbox started using a NAT address as well.

In short, I suppose the VMWare guest behavior is what I expected. The Virtualbox behavior was strange to me. If anything, I would have expected the Virtualbox to have done the opposite (use a NAT address for a NAT lan adapter, and a non-NAT address for bridged routine). Don't get me wrong, I was surprised to see the non-NAT address with Virtuabox – under any configuration.

But can someone explain to me why I got the results that I did? And how/why was the IP address 10.10.2.x "working" on my home network?

Keep in mind that both VM guests had successful networking at all times.

Best Answer

This all looks normal to me.

Anything under 10.0.0.0/8 (and also 172.16.0.0/12) are perfectly normal NAT addresses. When you put your VMs in NAT mode, the software is essentially acting as it's own dhcp server for the guest machines and will do translations to the host network, so that all the guests on a particular host share an IP with the host. Anything in any of those ranges are fair game for NAT. It appears that VMWare uses a 192.168.0.0/24 range by default, and VirtualBox uses a 10.0.0.0 range. Both are just fine, and neither is better than the other (though I personally prefer 10.0.0.0 ranges because there are 255 times more addresses available).

It sounds like maybe you expected NAT mode to use the NAT between your host network and the internet, but that just doesn't happen. In fact, that is what bridge mode does. Switching to bridged mode means your VM guests are now connected directly to your home router's dhcp server for addresses. VirtualBox and VMWare will both now get addresses from the same place. VMware will have changed as well, it's just that the old mode and the new mode were assigning addresses from similar pools.

Related Question