Configure host in Windows VirtualBox to reach local webserver

If you are developing a website on Linux or Mac you may want to check the behavior of the website in Windows with the Internet Explorer or with the latest Microsoft Edge web browser. I am developing the most projects local in a Docker container, a Vagrant box or for example on a local Apache server. Sometimes also with the build in webserver of PHP or grunt-contrib-connect. The type of local webserver is not that important, more important is the fact that the webserver is not reachable from outside. Developing on my Linux machine and switching to an Windows machine in my network to check the behavior of the website is no option as workflow. Luckily is Microsoft providing Free Virtual Machines from IE8 to MS Edge.

Install Windows VirtualBox

As example I will try the virtual machine Microsoft Edge on Win 10 Stable (14.14393) with the platform VirtualBox. I have downloaded the file After unzipping the archive file I have a MSEdge - Win10_preview.ova file that can be opened with VirtualBox.

Import Windows VirtualBox

VirtualBox should ask for the import settings.

VirtualBox Import Windows

The import may take a while and the VirtualBox Manager should look something like that afterwards. We just need to push the Start button.

VirtualBox Overview

The Windows VirtualBox machine should start up and the desktop should look like the following one.

Windows 10 desktop

Start a local webserver on the host machine

Let us start a local webserver on the host machine. For my example the webserver has just a index.html file with the following content.

<!DOCTYPE html>
    <h1>Hello Windows</h1>

I will use the build in PHP server with port 8181. The following command is started in the directory of the index.html.

php -S
PHP 5.6.29-0+deb8u1 Development Server started at Sun Jan 15 21:06:56 2017
Listening on
Document root is /
Press Ctrl-C to quit.

A quick check on shows me that the webserver is working.

Hello Windows HTML

Accessing the webserver with the Windows VirtualBox

You may have already tried, but using the IP from the Windows VirtualBox does not make much sense to reach the webserver of the host machine. The IP of the host machine is for the Windows VirtualBox. Let us put into the Windows webbrowser.

Windows Edge

Edit Windows hosts file

Windows has also a hosts file. We will create an entry for our IP in that file. Open Notepad as admin. You can do that by searching for Notepad and opening the context menu with the right click of your mouse.

Notepad Admin

Just open the file C:\Windows\System32\drivers\etc\hosts with Notepad, add the following line and save the file.

It should be possible to reach the local webserver on the host machine again with the Windows web browser, but now with in the bar.

Next Previous