Monday, March 26, 2012

Unable to ping Guest VM in VirtualBox

Download: Fast, Fun, Awesome

Suppose you have installed guest OS (such as Windows, Ubuntu, etc) in VirtualBox and want to ping it from host OS then you might not be able to ping it,  if Network adapter is configured as NAT mode adapter in VirtualBox for the VM.

To solve this problem. First shutdown your gust VM. Second, change the Guest VM's network adapter settings of "Attached to" from "NAT" to "Bridged Adapter".  Also change "Name" to "vmnet1" or  any other similar name.

The cause of this problem is, in NAT mode the IP headers of any packets that are going out the guest VM are re-written to match the hosts network settings. But VirtualBox does not do any kind of reverse NAT, not even for packets originating from the host machine.  It only does it for established connections.

Hope this helps!