Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is VirtualBox NAT networking fundamentally different than VMWare NAT?

I'm trying to debug a problem I'm having understanding the difference between the NAT network adapter in VirtualBox and the NAT network adapter in VMWare Fusion. So far, I can configure VMWare and achieve my desired result, but I cannot achieve this in VirtualBox. In a VMWare VM, I'm able to use a NAT network adapter to achieve the following:

  • The guest is assigned it's own unique IP address
  • The guest has access to the outside Internet
  • The host can ping the guest and ssh to it
  • The guest can ping the host and ssh to it
  • The guest can resolve (internal) domain names just like the Host

I thought I saw that this was possible in VirtualBox, but now I'm thinking it's not possible. Perhaps there is some option that is close to VMWare, in which I manually modify /etc/resolv.conf in the guest to match that of the host? I did find a few questions that seem to indicate I should instead be using Bridged mode in VirtualBox, e.g. this question: Can't ping to VirtualBox instance , in which both answers appear to suggest VirtualBox's NAT adapter doesn't support the functionality I want:

It is quite obvious that when you are using NAT it will be impossible to ping host after NAT. It is how the NAT works... even if you will have real not virtual host the bechaviour will be the same.

and

You need to change networking mode from NAT to bridged, and ping should start working in both directions.

Also, answers to this question seem to back up the above: How to ping ubuntu guest on VirtualBox

Is it true that a NAT adapter in VirtualBox cannot be ping'ed from the Host OS?

like image 999
blong Avatar asked May 09 '14 15:05

blong


People also ask

What is NAT networking in VirtualBox?

Network Address Translation (NAT) is the simplest way of accessing an external network from a virtual machine. Usually, it does not require any configuration on the host network and guest system. For this reason, it is the default networking mode in Oracle VM VirtualBox.

What's the difference between the setting of NAT bridged and internal networking in VirtualBox?

NAT mode will mask all network activity as if it came from your Host OS, although the VM can access external resources. Bridged mode replicates another node on the physical network and your VM will receive it's own IP address if DHCP is enabled in the network.

What is NAT Network in VMware?

Network address translation — or NAT — is a networking option that first appeared in VMware Workstation 3.0. NAT provides a simple way for virtual machines to use most client applications over almost any type of network connection available to the host.

What is the difference between NAT and bridged in VMware?

With bridged networking, the VM is accessible from the network. "NAT" on the other hand shares the hosts network connection by assigning the VMs an IP address from a private network, and translates network requests from the guest. This way the host appears as a single system to the network.


1 Answers

I have used virtual box for years and I also have 2-3 years experience in computer networking.

Yes, in virtual box you can't ping the guest that use NAT from the host and this also how NAT works in real life. In real life, if you want to be able to contact a host behind NAT, you have to set a port forwarding rules where the connection to a certain port of the router will be forwarded to a certain machine. This must be done on the router.

To enable port forwarding in virtual box environment, select the Network pane in the virtual machine’s configuration window, expand the Advanced section, and click the Port Forwarding button. Note that this button is only active if you’re using a NAT network type – you only need to forward ports if you’re using a NAT (http://www.howtogeek.com/122641/how-to-forward-ports-to-a-virtual-machine-and-use-it-as-a-server/).

like image 62
yogipriyo Avatar answered Sep 30 '22 18:09

yogipriyo