posted on Thursday, November 10, 2005 12:06 AM by BayerWhite

Running VirtualPC Images Effeciently

I have not been a real big fan of using VPC until recently with the Betas and releases of Visual Studio and SQL 2005. Now I can’t stop creating images with different environments for testing Service Packs, OS, Project Server, VS/SQL2005, etc. I want to share with you and also record the steps I used for making my images run efficiently. The information I present are tricks that I have learned from two major VPC users, Andrew Connell and Virtual PC’s Guy. These guys have taught me about base disks and differencing disks. The base disk is the foundation for what ever you are trying to build. A good reference for measuring what is added to a base disk is adding things that take awhile to load and that can be used as a base for multiple images as well. The differencing disk is an image that builds on the base and allows for other changes while making sure the base image is left untouched.

Three things before we get started…

  • My experience has been to have a minimum of 1gb of RAM
  • Make sure you have VPC SP1 installed
  • Install the Virtual Machine Additions

1. Open VPC Console and from the File menu click “New Virtual Machine Wizard”

2. Use the default selection “Create a Virtual Machine” then click “next”

3. Browse to where you want the VPC image to be saved then click “next”

4. Select the OS that you will load on your image then click “next”

5. Select the RAM amount allocated to your image then click “next”

6. This is your first image so select “A new virtual hard disk” then click “next”

7. The default for where the hard disk is saved should be the same location where the VPC config you created earlier resides…click “next”

8. You should see a summary of what you just did in wizard and you are ready to create your image.

9. Load your OS, service packs, etc.

10. After you have everything loaded, go ahead and run the “disk defrag”

11. After defragging your image select the “CD” from the menu of your image and browse to the directory of where you installed VPC. Mine is in Program Files/Microsoft Virtual PC/Virtual Machine Additions/Virtual Disk Precompactor.iso

12. Your image will now undergo precompacting. Once this is complete, from the CD menu, release the precompactor.iso

13. Stop your image and from the File menu, select “Virtual Disk Wizard” then click “next”

14. Select “Edit an existing virtual image” then click “next”

15. Browse to the same location where your base disk resides then click “next”

16. Use the default value of compact it and let it run

17. Now click the settings button and disable “undo disk”

18. Delete the VPC setting file and set the base hard disk image to read-only

19. You are now ready to create a differencing disk!

20. Repeat steps 1-5

21. Here is where you create the differencing disk. Now change the default selection to “An Existing virtual hard disk”

Use your differencing disk for loading and testing software. If something goes wrong with the differencing disk, you can always create another one from the base disk and bypass reloading the OS and SPs that take forever.

Comments

# re: Running VirtualPC Images Effeciently

Wednesday, December 14, 2005 2:13 PM by flachance
Quick (maybe n00b) question:
Step 10, do you mean run the "disk defrag" in the VPC or the host PC?

Thanks!

# re: Running VirtualPC Images Effeciently

Monday, December 19, 2005 7:00 AM by BayerWhite
Good Question,

After loading your OS and SP's to your new VPC image, defrag the VPC HD. This makes sure that everything is running as effective as possible:)

# WWF-Attribute 'Class' not found on the root activity

Monday, January 02, 2006 10:29 PM by Bayer White - .Net Made Easy!
   There is a bug when adding breakpoints within workflows,using the WWF Runtime...

# WF-Attribute 'Class' not found on the root activity

Tuesday, January 03, 2006 5:22 AM by Bayer White - .Net Made Easy!
   There is a bug when adding breakpoints within workflows,using the WF Runtime engine,...

# re: Running VirtualPC Images Effeciently

Tuesday, January 10, 2006 12:40 PM by Joe Landau
Doesn't this do just the same thing as having an Undo disk enabled in VPC? I tried it, and it didn't seem any faster, but required a pretty lengthy setup. I must be missing something--I don't see the advantage.

# re: Running VirtualPC Images Effeciently

Tuesday, January 10, 2006 1:59 PM by BayerWhite
Hey Joe,

Check out http://ts2blogs.com/blogs/donroe/archive/2005/12/19/512.aspx. Don Roessler does a great job explaining defragging. Hopefully this will answer your question:)

# re: Running VirtualPC Images Effeciently

Thursday, January 19, 2006 1:07 PM by Joel
One other thing to further enjoy your VirtualPC meanderings. Sysprep your images.

I like to use a similar list of steps to yours, with a few modifications. I'll list them here, leaving the reader to research the applicable technologies if you're not familiar with them:

1. Create a Microsoft Loopback Adapter on the host system. Set the IP Address to something like 192.168.2.1, subnet 255.255.255.0.

1. Create source .vmc and .vhd files, using the loopback adapter from the host for the network connection, loading the OS (creating any drive partitions required), service packs, and any other apps. Don't forget to format extra partitions. Tweak your desktop the way you like it, etc.

2. **Sysprep** the VirtualPC image, running the setup utility first. I usually set it to auto-respond to everything except the PC name. Make sure the same domain name is specified.

3. Shut down the VirtualPC image, and remove it from the VirtualPC console, so you're never tempted to use it.

4. Browse to the .vhd file, and copy-paste-rename it as many times as you want, for as many PC's as you want.

5. Create a new VirtualPC using an existing drive image, and point the settings at one of the copies you made. Make sure the new virtualPC is set up to use the host system loopback adapter.

6. When you start it up, a mini-setup will run, where you can specify a new PC name.

7. The mini-steup will reboot the computer. Once rebooted, change the network adapter IP Address to something ling 192.168.2.3, subnet 255.255.255.0

Repeat steps 4 - 7 as many times as needed, for as many PC's as needed.

Now, you can have an entire network of virtual PC's running on 1 PC! Talk about a great way to test client-server or 3-tier applications!

One warning though, keep in mind that all these PC's are using the same processor and RAM on the host system.

# WF-Attribute 'Class' not found on the root activity

Monday, June 19, 2006 7:37 PM by Bayer White - .Net Made Easy With WF
   There is a bug when adding breakpoints within workflows,using the WF Runtime engine,...