I've got two vms running on a windows host, each with a host-only network and ips in the 192.168.56.XXX range. One of them is running apache and serving some content that I want to access from my windows host.

However, the windows host can't access the apache server at all. The server is running on ipconfig from windows says it's ip for the Virtual Box interface is I tried route add to route 192.168.56.XX traffic, but everything I tried didn't work and I was probably using it wrong.

Any ideas on how to make this work?

13 Answers 13


If you want to communicate with your VMs with 192.168.56.XXX IP, you need the host Virtual Box interface to have an IP on the same range. Your interface don't (169.254).

On a fresh installation of VBox 3.1.8, it creates a new interface named "VirtualBox Host-Only Network" with a static IP address of :

Your interface is most probably misconfigured to use DHCP. Change it to use with netmask and it should work.

  • That does indeed work. But why? The DHCP server is provided by VirtualBox, surely it's a bug for it to be handing out addresses on the wrong subnet? – HughHughTeotl Jul 9 at 20:01

I was able to fix this by giving my server a static address of Then, I was able to ping my guest OS from the host. I also added a host file entry on my host machine to make it easier to access.

I'm still unable to ping the host from the guest... not sure why.


Your VMs are getting IPs like 169.* because their DHCP clients are not finding a DHCP server to give them a lease. Therefore, the IP of the host & IPs of the VMs are not accessible to each other. A static route won't really solve this. You need to figure out why the VMs are not getting an IP lease, or you could try manually setting the IP addresses to the same private Class C (192.168.56.*) that your host is on.


try this:


BTW, could not use powershell script. I needed to create *NdisDeviceType key via Regedit

  • 1
    Welcome to Server Fault! Generally we like answers on the site to be able to stand on their own - Links are great, but if that link ever breaks the answer should have enough information to still be helpful. Please consider editing your answer to include more detail. See the FAQ for more info. – slm Apr 4 '13 at 18:00

Have you set the correct default gateway in your VM? What's the routing table look like on host and guest?


Once you find, install and start the Host-only adapter on your Windows host, if you still can't connect to the VMs, try turning off the Windows firewall for that adapter.

If that works, you can either leave it that way, or use your Windows Firewall-fu to open the correct ports and stuff.


169.254 = No DHCP server found. THis could be either there isnt one or there is a firewalling issue. Depending on your operating system it would also be advisable to check your firewall rules. Windows 7 is quite paranoid!


If you can't ping host from VM, have you try to turn off firewall on host? perhaps it's filtering ICMP request. Turn off the firewall as test, if ping is OK then you should check your firewall configuration that filter ICMP request.


I ran into this issue and it turned out that VBox simply wasn't able to obtain an IP for my Mac guest as it is not a member of our domain. I simply made sure that the host adapter and guest VM were set to the same subnet and then manually set the IP of the guest VM to match the network part of the adapter:

Windows (Host) Host-Only Network Adapter: - Subnet: - IPv4 Address:

Mac (Guest) VM Network Configuration: - Subnet: - IPv4 Address:

Voila! My "Self-assigned IP" warning went away and I could ping Host <=> Guest...

Hope this helps someone!


If you are using Windows, go to Firewall Settings and allow all Virtual Box executables to pass thru. This one does the trick.

[root@classroom ansible]# ping PING ( 56(84) bytes of data. 64 bytes from icmp_seq=1 ttl=128 time=0.238 ms 64 bytes from icmp_seq=2 ttl=128 time=0.473 ms 64 bytes from icmp_seq=3 ttl=128 time=0.357 ms


I had the same problem and I used a combination of the answer provided by Christophe Drevet-Droguet and the text quoted below (which i found at the following link: https://www.vmware.com/support/ws4/doc/network_configure_ws.html)

Although VMnet0, VMnet1 and VMnet8 are available in the network adapter list, they are normally used for bridged, host-only and NAT configurations, respectively.

I was using NAT in my guest VM's network settings and so i fixed the IP and subnet in the VMware Network Adapter VMnet8 properties on Windows 10. And then it worked.


You can use NAT and setting port forwarding. in port forwarding, add new rule HTTP, TCP,, 8888,, 80

Run youn virtualbox than use your browser


Go to File Menu in your virtual box and choose 'Host Network Manager', then check the radio button 'Configure Adapter Automatically'. Then try to ping from your windows host. This worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy