4

I have Windows 2008 Server installed in a VirtualBox and I'd like to be able to access the default website (localhost) from the host OS (Windows 7).

In IIS, I have set a hostname for the default website, which I've named 'webserver'. THen I've added the following line to my hosts file (dns)

127.0.0.1 webserver

Now, if I browse to http://webserver in the guest OS, it works just fine.

But how do I access it from the host OS ?

4 Answers 4

4

As far as I know the default IP address for virtual box if using NAT is 10.0.2.15, but still you can verify that using ipconfig.

Nat enables you to access your virtual box guest OS even if your host OS is not connected to a router/access point.

You can map a port from your host OS to the guest OS as follows.

  • Got to your vbox guest OS's settings
  • Click on the network Tab
  • Make sure attached to is set to NAT
  • Click on advanced then port forwarding
  • Then you will see a screen where you can map host ports to guest ports

Virtual Box NAT port forwarding

2

If your virtual machine is connected to the internet, it's basically using your physical PC as a router. That is, the host OS is assigning some private address (e.g. 192.168.X.X).

You need to put that in your browser to access the virtual server from the host OS. I've never used Windows Server, but under Windows you'd find your IP by typing

ipconfig

at the command prompt.

1
  • got it working:) i needed to map the ip of my guest os to 'webserver' in the hosts file of my host os. that's all.
    – Sam
    Commented Apr 18, 2012 at 18:06
2

Go your Virtual Machine's network settings in Virtualbox.

Set the network card not as attached through NAT, but through BRIDGED ADAPTER. If you have multiple adapters on your host machine, select the main one, the one you're using to obtain an IP from your router.

Now your guest virtual machine is on the same network as your host's.

Hence you can simply access the webserver through the Virtual Machine's computer name. Ex. http://virtserv
(Mind well: not the virtual machine's name in Virtualbox, but the COMPUTER NAME in the guest windows installation).

0

All you have to do is use the IP address of the host operating system. In the host operating system open the command prompt and type ipconfig. Find the IPv4 address: E.G.

IPv4Address........ : 10.1.1.100--If there are multiple then try them all

Go into the Virtual Machine OS and open a browser. Type the url:

http://10.1.1.100/optionalPathInfo

This will open the host IIS site from the VM browser.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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