8

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.

  • 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 Aug 1 '14 at 17:44
  • It's not that easy. I've been researching and maybe needing for port forwarding, etc. Why the negative vote? – DK39 Aug 1 '14 at 18:15
  • 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 Aug 1 '14 at 18:22
  • @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 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 Aug 1 '14 at 19:29
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.

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

  • I've enabled the inbound traffic in the firewall but still cannot access the website on the virtual machine – DK39 Aug 5 '14 at 13:23
  • 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 Aug 5 '14 at 15:23
  • Yes, I've done that... – DK39 Aug 5 '14 at 15:25
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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.