Exposing web server in VM to your laptop

From EECS 182
Exposing web server in VM to your laptop
Jump to: navigation, search

Your virtual machine (Mint) for EECS 182 is configured with Apache web server, which can be accessed by a web server within Mint at http://localhost or But, what if you want to use your laptop's browser to access the Mint's web server?

By default, that is not possible, but with a simple change to Virtualbox's network configuration, it is possible to enable that. The main thing to realize here is that Mint is a virtual machine with its own network address (identity). To permit the change, do the following:

  1. Go to Settings -> Network for the virtual machine in the Virtualbox Menu. Make sure both NAT and Host-only networking is enabled. It does not matter which adapter is 1 or which one is 2. Hit OK.

  1. Very important: Restart your Mint VM.. Without restarting Mint, the new network settings will not take effect.
  1. Login into Mint and start a Terminal. Type in the "ifconfig" command. Look for a network address that starts with "192.168".

Finding IP Address VM.png

In the above screen, the IP address is

Go to the browser on your laptop. Use the URL (or whatever IP address is reported by ifconfig). It should give the same page as reported by http://localhost within Mint.

You have successfully exposed your web server on Mint to your laptop!

The above URL is only visible within your laptop. It is not visible to the outside world. It is possible to go a step further and expose the web server to the outside world. But, then your laptop needs a public IP address and will need to forward a port on the laptop to the internal address and port 80. Read more on Virtualbox network settings and port forwarding if you are interested in doing that.

Personal tools