8

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.

splattne
  • 28,508
  • 20
  • 98
  • 148
user29402
  • 183
  • 1
  • 1
  • 3

5 Answers5

4

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 ;)

Kedare
  • 1,786
  • 4
  • 20
  • 37
0

When you use a NAT you don't need to fill the Guest IP, filling the HOST IP (127.0.0.1) and the ports will be enough, so doing it, it will work:

example of NAT configuration

Stuggi
  • 3,506
  • 4
  • 19
  • 36
0

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.

tombull89
  • 2,964
  • 8
  • 41
  • 52
0

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.

0

I have already posted this answer on Stack Overflow

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

Mozart
  • 101
  • 1
  • 3