Networking – How to access Virtual machine server from another host on the same network

apache-http-servernetworkingvagrantvirtualbox

I have a OSX host machine named A. It has a guest vagrant/virtualbox VM running ubuntu with apache web server. I can access the server page from the host by going to 192.168.44.44. I want to be able to access the same page from another machine, B, that is on the same local network. So far I can only ssh between From A into B and vice versa. Do I need to configure the router to forward anything? If so what exactly I need to forward? I tried doing the forwarding in the router as you see below but when I hit save, I get an invalid ip message: enter image description here

And here are my virtualbox network configs:

enter image description hereenter image description here

Best Answer

On the preferences window of your virtualbox (not the virtual machine) go to network and open the properties of your natnetwork.

There locate the port forwarding button (clic on it)

In the resulting window add your rule, the name is not relevant.

First your computer IP and port, then the IP of your virtual machine attached to your NATNETWORK and the port.

In my case used 192.168.1.102:8069 for the host and 10.0.2.7:8069 for the guest.

So now I can access my server from any computer on my LAN.

I hope this is useful for you.

Best regards,

Related Question