How do I access an IIS web server on a virtualbox from the network of host machine
Solution 1
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.
Solution 2
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.
James S
Updated on September 18, 2022Comments
-
James S over 1 year
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.
-
Ƭᴇcʜιᴇ007 almost 10 yearsYou'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. -
James S almost 10 yearsIt's not that easy. I've been researching and maybe needing for port forwarding, etc. Why the negative vote?
-
Ƭᴇcʜιᴇ007 almost 10 yearsWhat'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?
-
Ickster almost 10 years@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.
-
-
James S almost 10 yearsI've enabled the inbound traffic in the firewall but still cannot access the website on the virtual machine
-
jjk_charles almost 10 yearsI hope you have enabled inbound traffic in Virtual Machine, and accessing the site with URL below! http://<<virtual_machine_IP>>/RTStreamer/Ticker.html
-
James S almost 10 yearsYes, I've done that...