I have installed Windows Server 2008 on the latest version of Sun Virtual box. I have some web sites hosted in the Windows Server virtual machine.

How can I access the websites hosted on the virtual machine from the host machine? Currently, the network adapter is set to work in NAT mode.

Thanks in advance.

up vote 4 down vote accepted

I don't recommend using the NAT mode, prefer the Bridged mode that will make the VM acts like a real PC on the network or the Host-Only for a closed network (don't forget to configure the "host" on the same network on the host-only), then you'll just have to go to the IP of your server in your browser ;)

You need to set up a bridge connection in your VirtualBox

Then on windows you need to install microsoft webmatrix http://www.microsoft.com/web/gallery/install.aspx?appid=WebMatrix

Run this as an administrator and it'll allow you to setup your bridged IP address instead of local host under settings on the webpage.

ps. remeber to either add webmatrix to the windows firewall or shut the windows firewall off.

If you set the virtual addaptor to bridged mode this will give the virtual machine an IP address from your DHCP server (if you have one). try giving the host a static IP of 192.168.2.2 and the guest 192.168.2.3 (subnet mask 255.255.255.0) and see if you can ping between them. Also note bridge mode is not the same as host-only so you will need to have it connected to a network for this to work.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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