VMWare/VirtualBox: Not able to ping Host-Only network adapter from windows host to linux guest

hostnamepingvirtualboxvirtualhostvmware-workstation

Scenario:

  • Windows host running XP SP3
  • (Virtual) Ubuntu Server 10.04 (fresh install, only selected "LAMP Package" option during installation.
  • Tested on VMWare Player / VirtualBox

I can ping by ip from one box to the other with no problem. When i try to ping by host name (in linux or windows), i get a message telling me that the host could not be found.

I've been reading the docs and searched throught the forums of VMWare and VBox, but as this is my first attempt to run a linux box i feel i'm missing some configuration or package installation to make this work.

Note: i need the linux box to use a host-only adapter because we`re setting up a virtual machine for development and the LAMP stack in it must be local for the workstations that will use it. We don't want to user bridged adapters because if we do, we'll need to set up a different name for each VM copy to be used.

Best Answer

Since each Ubuntu VM will appear only on a workstation's host-only network, the VM can be given a static hostname and IP address. Put that hostname/address mapping into your LAN's local DNS server, and that will allow each XP workstation to ping its Ubuntu VM by name.

Conversely, in order for the VM to ping the workstation by name, you need some way of communicating the workstation name/IP mapping to the VM. The name used for the workstation need not be the same as its name on the LAN, so the simplest option is to give the workstation a static name/address on the host-only network, and put this mapping into the VM's /etc/hosts file.

With these configurations, you should be able to copy the VM to each workstation, configure the host-only network in VirtualBox, and go.