How do I access an IIS web server on a virtualbox from the network of host machine

8

2

I've a site running on IIS on a Windows 8 virtual machine.

http://localhost/RTStreamer/Ticker.html

How do I access that site from outside the host machine? The host machine ip is 168.192.42.1

I've already changed the network of the virtual machine to "Bridged Network" but don't know what is the ip and port to access from the host machine network.

DK39

Posted 2014-08-01T17:42:03.830

Reputation: 199

You'd get it the same way you would with ANY Windows machine. One way: type ipconfig /all in a command-line in the VM to get its current IP information. – Ƭᴇcʜιᴇ007 – 2014-08-01T17:44:29.207

It's not that easy. I've been researching and maybe needing for port forwarding, etc. Why the negative vote? – DK39 – 2014-08-01T18:15:03.353

What's "not that easy"? What I've suggested is how you get the current IP address from the OS. You only need to forward ports if you have the firewall up, and the only port you'd need to forward for HTTP traffic is the usual port 80. What exactly have you tried already, and what were the results? – Ƭᴇcʜιᴇ007 – 2014-08-01T18:22:04.097

@DK39, are you clear that you need to get the IP from within the VM and not the host? Once you have that, you'll need to change your URI to point to the IP of the VM. For example, if your VM's IP address is 168.192.42.100, your URI will be http://168.168.42.100/REStreamer/Ticker.html. "localhost" should always redirect to the machine on which you requested the address, meaning that if you try to reach localhost on the host, you'll only get the host, not the VM. If you run it on the VM, you'll get the VM, not the host.

– Ickster – 2014-08-01T19:29:37.347

Answers

4

Check your network settings in VirtualBox. By default, NAT is selected.

NAT is fine for most purposes, but to access the services of the guest, you have to forward the ports. There is a button at the bottom of the VirtualBox network settings to configure port forwarding.

Your IIS is serving on port 80. You have to create a rule that forwards from guest port 80 to host port 8080.

Now you can browse to http://localhost:8080 on your host.

Timo Stamm

Posted 2014-08-01T17:42:03.830

Reputation: 41

1

Make sure you have the firewall configured accordingly to allow HTTP traffic in the virtual machine.

Below is how to enable it in Windows Firewall, I believe it is disabled by default. Windows Firewall HTTP Inbound Traffic

jjk_charles

Posted 2014-08-01T17:42:03.830

Reputation: 1 087

I've enabled the inbound traffic in the firewall but still cannot access the website on the virtual machine – DK39 – 2014-08-05T13:23:42.960

I hope you have enabled inbound traffic in Virtual Machine, and accessing the site with URL below! http://<<virtual_machine_IP>>/RTStreamer/Ticker.html – jjk_charles – 2014-08-05T15:23:02.943

Yes, I've done that... – DK39 – 2014-08-05T15:25:41.027

0

Ok I got this to work by doing both the port forwarding and firewall rule addition.

Firstly make sure you can hit the website on the guest with the public ip address you discovered by using the console command ipconfig.

Then add a firewall rule for a port and use port 80

Then setup the port forwarding in the virtual box by just specifying the host port as 8080 and the guest port as 80

Then hit the url following url the host http://localhost:8080/{Yoursitename}

Bianca Kourtney Minnaar

Posted 2014-08-01T17:42:03.830

Reputation: 1