ggonmar
ggonmar

Reputation: 839

Accessing a web server on a Virtual Machine from another computer

I have setup a Virtualbox with a Linux environment running a web server. The host is running Windows 7, and I can access the web served by the server in the virtual machine from the host's browser.

However, I would like to be able to access this web server from another computer; say, a colleague on the same network that the host is in. Is there a way of doing so?

Summary:

 Host (win7) interfaces:

  - 172.16.1.15 (internet facing)
  - 192.168.55.1 (VM facing)

Guest (linux with web server running) interface:

  - 192.168.55.2

Web server is reachable from Host (through 192.168.55.1 - 192.168.55.2 interface)

Web server is NOT reachable from other computer on 172.16.1.X network.

Can you guys help me out on what I may be able to do in order to achieve this?

Thank you!

Upvotes: 17

Views: 23654

Answers (1)

ggonmar
ggonmar

Reputation: 839

Well, despite downvotes without any kind of explanation why (thank you!), I have found a way of doing what I intended on Virtualbox settings:

On machine, right click, Settings > Network > Advanced > Port forwarding, and then, fill with corresponding data, i.e.:

  • host ip could be 0.0.0.0,
  • host port should be the port other users will use to access your computer (and thus the VM),
  • guest ip is the VM ip, and
  • guest port should be 80 if it is a web server typically).

Thank you, hope this helps to the next one running into this!

Upvotes: 14

Related Questions