Virtual Network in Microsoft Virtual PC

For various reasons, I find myself needing to switch from VirtualBox to Microsoft Virtual PC. Virtual PC lacks the easy snapshot feature, but it has one significant advantage. Everyone else on the project is using it. This makes it possible to share virtual hard drives with each other, something that is surprisingly difficult with VirtualBox. And these virtual hard drives can be hosted with Microsoft Virtual Server for staging in the integration environment.

The virtual network that I built in VirualBox did not port to Virtual PC or Virtual Server. Virtual Server has no NAT capability, and Virtual PC's NAT does not let the VMs talk directly to each other. I had to find a new way to accomplish the same result. Fortunately, with a little help (OK, a lot of help) from Virtual PC Guy (on loopback, NAT and ICMP), I got it working.

Here's his solution
Go to Ben's blog to follow his detailed instructions on installing the Microsoft Loopback Adapter. Please note that in Vista you have to switch control panel to the classic view in order to find the Add Hardware icon. And the wizard is slightly different: manually select, network adapters, Microsoft, Microsoft Loopback Adapter. When it gets installed, it creates a new adapter called "Local Area Connection 2". I renamed this to the more meaningful "Virtual Network".

In Vista you can change the IP address of the loopback adapter, which according to Ben is impossible in XP. Just go to the Network Connections page. (The simplest way I've found to get there is to open the menu formerly known as Start, right-click Network, properties, and then "Manage Network Connections".) Once there, you can rename the connection or change its properties. I set my virtual network's IP to "10.123.1.1" and the subnet mask to "255.255.255.0" to avoid any routing collisions.

In Virtual PC, open the network settings and set Adapter 1 to "Microsoft Loopback Adapter". Then start up your VMs and configure their IP settings. My VMs are configured thus:

  • MLP-AD (active directory and DNS)
    • IP: 10.123.1.100/255.255.255.0
    • GW: 10.123.1.1
    • DNS: 127.0.0.1
  • MLP-WSS (SharePoint)
    • IP: 10.123.1.101/255.255.255.0
    • GW: 10.123.1.1
    • DNS: 10.123.1.100

The loopback adapter does not respond to ICMP pings from within the VMs, so you can't ping your default gateway to see if your configuration is working. But you can ping the VMs from each other, and you can ping machines outside of the virtual network.

5 Responses to “Virtual Network in Microsoft Virtual PC”

  1. Lars.lindmark Says:

    It seems like you are doing the same thing as i want to do, but i can't get it working.

    I have a vista machine and installed vpc2007 and installed win2003 server and additional wss.

    And i want my Pc to view pages on my virtual wss.
    But it is not working.
    My virtual pc itself works fine!!!

    Do you have any tips

  2. Michael L Perry Says:

    Are you running multiple VMs? If so, try hitting the WSS virtual machine from the other one. If this doesn't work, then make sure that the loopback adapter is selected for both machines.

    Even if you aren't running multiple VMs, you should be able to do what you are trying to. Check the IP address and subnet mask of the loopback adapter. The IP address of the VM should be within the same subnet. So if, for example, the loopback adapter is at 192.168.23.45 and 255.255.255.0, and the VM is at 10.123.1.103, then it won't work. The host machine won't know to route packets down the virtual network, and they won't make it to the VM. Change the loopback adapter to 10.123.1.1.

    One final test would be to see if you can get to the Intenet from the VM. If you cannot, make sure that the default gateway of the VM is the IP address of the loopback adapter, and that you have shared your Internet connection on the host with the loopback adapter.

    HTH

  3. Seth Hildebrand Says:

    You will want to make sure your VMs are not configured to 'Pause' when not in use. They must continue to run (be active) in the background for your pings between the VMs to work.

  4. Adventures in Software » Blog Archive » Forms Authentication and the Active Directory membership provider Says:

    [...] If you didn’t set up AD yourself, you will need to talk to the person who did. Get a connection string, username, and password that gives you read-only access to the server. If you would like to try this yourself before involving your network operator, you can set up a virtual network in Microsoft Virtual PC. [...]

  5. Seth hildebrand | Jaykaymotors Says:

    [...] Virtual Network in Microsoft Virtual PC – Adventures in SoftwareFeb 7, 2013 … Seth Hildebrand Says: December 12th, 2007 at 3:29 pm. You will want to make sure your VMs are not configured to ‘Pause’ when not in use. [...]

Leave a Reply

You must be logged in to post a comment.