I have Ubuntu 14.04 server installed on a Virtual Machine with VirtualBox. I've enabled host-only networking in the VM's settings. When I do ifconfig | grep addr
I get an inet addr: 192.168.56.101. I went through the steps in this post: How can I access Apache (on VirtualBox guest) from host? but it's simply not working. When I ping the server, all I get are packet timeouts. I'm trying to make my host and guest talk to each other so that I can test some networking code. Any ideas?
1 Answer
192.168.56.101 is an address given by virtualbox's internal DHCP server if you select host-only networking, but it doesn't mean that it will magically be able to communicate with your host system, this needs some extra configuration to ensure that routes are properly set up. The easiest way to get host and guest to talk to each other is to select bridged networking, in this case the guest (VM) will appear to be connected to the same network as the host. This depends on having a DHCP server on your home or work network to assign an address to the VM which will appear like just another computer on the network. Either that, or configure an IP address for it manually.