Browsing website hosted in the virtual machine from host machine's browser

Make sure the "network card" on the virtual machine is set to use bridged mode. This will give it an IP on the same subnet as your host machine.

Eg. If your host machine is 192.168.1.10, the virtual machine should get 192.168.1.X. This can vary depending on your network setup, but that's the usual case.

I figure you've already done these two, but you should also make sure your web server is set up to accept requests that did not originate from itself (localhost/127.0.0.1), since the server views the host as a separate machine.

And lastly, make sure Windows' firewall or any other firewall you have running on the VM is configured to allow the web server to accept incoming connections.


With bridged network mode I lost internet connectivity in my guest.

Instead I used NAT mode with port forwarding.

This is an example where Apache hosts websites in the guest:

enter image description here