Getting Multiple Virtual PCs to Work Together
I'm a big fan of using multple Microsoft Virtual PC images, especially for demos and development. My current machine has a second hard disk that is dedicated to images that I use for such work.
One of the problems I've run into in the past is getting multiple Virtual PC instances to talk nicely together over a network - regardless of whether the host machine is connected or not. On frequent occasions I've turned up to do demos only to find out that Virtual PC #1 cannot see Virtual PC #2 on the network - even though they are on the same machine!
This week I've been putting together a demo that involves 4 Virtual PCs talking to each other simultaneously (showing interop between different vendors). I put in some time working out a foolproof way to get each Virtual PC to talk to each other, and also be able to use the network adapter of the host machine.
Here's how I nailed it:
1. Shutdown all of the Virtual PCs that you want to connect together (they must be turned off - suspend state is not good enough).
2. In the Virtual PC console, select one of the Virtual PCs and select "Settings"
3. In the Setting window, go down to "Networking"
4. Under the "Number of network adapters", select "2" from the combo box.
5. Set the first adapter to the network interface of your machine (e.g. Intel/PRO/1000 MT Mobile Connection).
6. Set the second adapter to "Local only"
7. Start the Virtual PC - log in and make sure that two network adapters have been recognized.
8. Assign the first network adapter (Local Area Connection) to DHCP - or whatever settings you use on the network connected to your host machine.
9. Set the second network adapter (Local Area Connection 2) to a static, private class C IP address (e.g. 192.168.200.1, with a subnet mask of 255.255.255.0). Set the default gateway to 192.168.200.254. Don't worry about DNS settings.
10. Repeat Steps 2 - 9 for all your Virtual PCs - make sure you give each Virtual PC a unique IP address in step 9, but within the range of your subnet (e.g. 192.168.200.2, 192.168.200.3 etc. for my example).
11. On each Virtual PC edit the hosts file (found in c:\windows\system32\drivers\etc directory). Add the name of all the other Virtual PCs, together with their IP address.
12. Make sure that the Internet Firewall on adapter #2 is set correctly for the type of applications that you want to work between the Virtual PCs.
That's it! - from any Virtual PC you will now be able to both access any other Virtual PC using the hostname and/or IP address you allocated on the second network card. You should also be able to access the outside world using the first network adapter.
Comments
- Anonymous
February 10, 2005
We've had numerous problems using VPCs in the past, so I was glad to find your article! I'll try your process in our QC lab this week, and perhaps save a bunch of people a bunch of heartache!
- Matt -
////////////////
/ Matt Comstock
/ Senior Software Developer
/ Covance Central Diagnostics
/ www.Covance.com - Anonymous
February 10, 2005
This is a much MUCH easier approach than the one I've seen recommended by others (who shall remain nameless). Thanks for posting this!! - Anonymous
February 12, 2005
Another approach that I use with no problem is setting the network adapter for the virtual machines on "Microsoft Loopback adapter" (it must be installed first on host machine from Control Panel -> Add Hardware) - Anonymous
February 13, 2005
I'm missing something here and that is time synchronization. It's essential that the host PC's are running with their clocks synchronized.
Even a slight diversion causes problems with logging on to a domaincontroller on another host PC. - Anonymous
April 29, 2006
PingBack from http://zahradil.info/2005/11/22/zdroje-virtual-pc.html - Anonymous
June 23, 2006
The comment has been removed - Anonymous
February 23, 2007
The basic strategy is to build your SharePoint server in a virtual machine (VM or VPC), and keep all