Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Well i have setup a VM in Virtual Box in a PC (label as PC2) and i have hosted a webservice in the VM (IIS).

PC2 - Windows Server 2003 VM - Windows 7 x86

Now i want to access the webservice from another PC (label as PC1) within a network which PC1 has connected. Following diagram will be helpful to get the clear idea.

enter image description here

So the LAN is But virtual network ports ip is by defualt. In the VM its ip from DHCP by defualt. (ipconfig gives you ip address like, subnet mask and gateway as

at this point i can ping PC1 ( from VM ( but i cannot ping from PC 1. even if i make VM and PC2 virtual ports ips to some static range, from VM i cant ping any IP.

How to solve this situation? Thanks in advance

share|improve this question

migrated from Nov 26 '12 at 9:49

This question came from our site for professional and enthusiast programmers.

up vote 2 down vote accepted

If you just used the default Network settings in your VM, it will be NAT with DHCP. That means you get a LAN IP from your VirtualBox DHCP Server and you can't really access the machine from the outside.

Check out the VirtualBox Manual on Networking:

I guess bridged neworking should be best. You should configure a static IP address.

EDIT: Concerning the edit removing "host-only networking": It's true that you can't see the VM from outside. But you get virtual interfaces (vboxnetX) on your host machine. So if you route it through, it should work. The setup is more complicated, but the VM is less exposed.

share|improve this answer
thanks i sorted it out by making it as Adapter and restarted the VM – Keizer Nov 27 '12 at 14:27

You should either expose IP address of VM to external network and NOT make it DHCP, either set up packet routing on PC2 so it will work as proxy (which i've no idea how will you do it on Windows, on Linux it is way easier).

As an option you can setup web-server on PC2 and make it proxying to VM, but again in this case u better off with static IP for VM and not DHCP.

Third option would be combine all of machines into VPN where PC2 will be a router/server. But that is too complex on Windows to set up.

share|improve this answer
well i make it static and set it as a bridge adapter same happens where i can get a network range ip on VM bt cannot ping from outside – Keizer Nov 26 '12 at 11:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .