Create a private network inside my Windows 7 machine

My Main Rig is a Windows 7 Professional laptop. On this machine is two Virtual Machines, both of which are also Windows 7 Professional. I need these VMs to be able to see each other but I also need them to access to the internet.

Currently they are all connected to the public internet at the hotel I am staying at but I am unable to see the other machines because this is a public network.

What I need to do is create a private network amongst my physical machine and the two virtual machines that reside within it. How can I do that?

I found how to make it think the public network a private network, but not how to create a private network that exists within the machine while still seeing the outside world.

My Google-fu hasn't revealed much - maybe I am using the wrong terms.

UPDATE: I added an additional NIC to both VM's and set them to local. I then started the VMs and tried to create a new network. However I can now see other machines on the hotel network and presumably they can see me (not desired). Can anyone give a detailed explanation of how to set this up or a link to a site that does? I can't be the only person who wants a private internal network on their PC?!

UPDATE2: Found this that describes what I want to do. Will try tomorrow to see if it works - seems I was almost there.

UPDATE3: Seems it didn't work. Added bounty which will be awarded for anyone who can do a step by step guide for getting two virtual machines to communicate. Extra cudos for using MySQL & Apache on the VMs!


Solution 1:

To have the VMs on a separate network that is private to your PC, use the Microsoft Loopback Adapter. The Microsoft Loopback adapter is a testing tool for a virtual network environment where network access is not available. It sets up a virtual network adapter that is private to your computer.

To install, see this : How to install a Loopback Adapter in Windows 7.

After it is installed, from within Virtual PC :

  1. Select your virtual machine
  2. Go to the Settings
  3. Click the "Networking" setting
  4. For your network adapter, select "Microsoft Loopback Adapter"

Now, you should be able to see your other running Virtual PC instances that also share the same loopback adapter, while this virtual network is inaccessible from outside your computer.

If you need to use Internet from within the VMs, see this article :
Configuring NAT via using the Microsoft Loopback Adapter and Internet Connection Sharing.

Solution 2:

What VM product are you using? VMware? VirtualBox? MS Virtual PC? Most of them use NAT by default, which is what you would want if you desire to have those VMs be able to reach the internet.

Also how are you checking that these machines are "visible" to the public network? The host machine will be able to see the VMs because whether you use host-only, NAT, or bridged mode, your host Windows 7 will be able to see them. Only bridged mode should make the VMs visible to the public network. NAT mode makes your host PC act like a NAT router, so only your main host machine would actually be visible, but if you look at the network on the host machine, the VMs will still be visible because your host will be browsing both the public side AND the internal VM network.

So, to really see if those machines ARE ACTUALLY visible to the public network, you would need to use a device other than the host PC to try to look at them from the outside.