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!


14 comments:

  1. Thanks for this post. I was trying to establish a connection between the two guest VMs I have and this write up helped me do that.

    Rohit

    ReplyDelete
  2. You sir are a star. Thank you from Jersey.

    Phil

    ReplyDelete
  3. Thank you so much, exactly what I needed.

    ReplyDelete
  4. perfect, thanks a lot

    ReplyDelete
  5. Works like a champ, thank you very much!

    ReplyDelete
  6. Thanks a lot
    - Vaibhav

    ReplyDelete
  7. thank you! just realized virtualbox diff from hyperV in adapter

    ReplyDelete
  8. thank you very much :-)

    ReplyDelete
  9. Not working for me in kali linux.I have changed the mode to "Bridge mode" after stopping VM.It still gives me request timeout error.

    ReplyDelete