Multiple Spindles Putting your .VHDs on a separate file from your C: drive is the single best thing you can do to improve Virtual PC performance. The performance gains of a second hard drive nearly always outweigh any slow access issues, so even if you only have an older 4800 rpm external drive, go ahead and use it. A separate USB/Firewire external drive or a multibay drive to host your .VHDs is well worth the investment.
Note: People often ask about host drive partitioning - there's not performance gain by logically partitioning your host drive. It may make it easier to manage/clean up the drives, but could also increase fragmentation. Recommendation is to keep everything on a single partition.
Happy, Healthy Drives - Defragging & Compacting your Drives
Background on Fragmentation: The computer writes information disk into concentric circles on the hard drive, called tracks. Each track is divided into small sections, called sectors. When a file is written, the computer puts it into the first open sector. If the file is bigger than the sector, it gets written across multiple sectors. When a file is deleted, that sector frees up and is listed as open. The sector isn't physically deleted - instead, it's marked as clear, and eventually it'll be overwritten by new data. That's why recovery software can retrieve deleted files off a computer, even if it's been deleted, recycle bin is empty, etc. In Virtual PC, this can make a .VHD file larger than the amount of data it actually contains, because some of its space is taken up by open sectors that haven't yet been overwritten. Virtual PC has a wizard that will compact .VHD files and free up space. Fragmentation occurs when a files is written into open sectors that aren't physically continuous on the disk, which happens over time as scattered sectors are marked as free. Defragging moves the files around, lining their individual sectors up together physically, so the magnetic read/write head in the drive doesn't have to move so much. With Virtual PC, we experience two levels of fragmentation: files inside the VPC are fragmented across the virtual drive, and the .VHD file itself can get fragmented, especially if you've loaded then deleted a lot of VHDs or other large files. A lot of the performance issues we can experience with Virtual PC are the result of drive fragmentation. These steps will defrag your Virtual PC hard drive, compress it to a smaller file size, and optimize its location on the host drive.
How to Defrag:
1. Defrag your Virtual drive.
a. Launch the Virtual Machine, log in as an administrator
b. Remove any Installation temporary folders or un-needed folders
c. Empty the Recycle Bin
d. Go to Start/Programs/Accessories/System Tools and run Disk Defrag
e. This can take 10 minutes to 30 minutes to run
f. Do this at least 3 teams, until it defrags quickly
2. "Zero out" your Virtual Drive.
a. Go to http://toolbox/details/details.aspx?ToolID=22494 and download the .ISO file to your host machine
b. Go into the Virtual PC, go under the CD menu and choose "Capture ISO Image". Point it to the file you downloaded
c. The precompactor will start automatically and crank along for about 15 minutes
(We need to do this to clear out any sectors that have yet to be overwritten in the .VHD)
3. Compact your Virtual Drive
a. Shut down any running Virtual PCs
b. Under the Virtual PC console, select “File” then “Virtual Disk Wizard”
c. Select “Examine or Modify existing disk image”
d. Select the disk image file you wish to compact
e. Select “Compact the disk image”
f. Select “Use original file” (or a separate file if you require)
g. Finishing the Wizard will compact the file. This may take a long time
4. Defrag your host drive (the one the .VHD files are sitting on)
a. Shut down all applications on your laptop.
b. On your laptop go to Start/Programs/Accessories/System Tools and run Disk Defrag
c. Do this at least 3 times as well - until it defrags quickly
Note: The host defrag step takes the longest - it can take 30 minutes to several hours to run. You'll need at least 15% of the disk free to run the defrag optimally. If you have really large files (like VHDs) they may not defrag - it'll tell you in the log report when it's done. If that happens, move them off your main drive to a backup location, run step 5 again, then move them back onto your drive.
Tip: If you zip up VHDs you won't use for a while, you can compress them to about 50% their original size. If you're working with standard images, just delete the VHDs and restore them from the TAN
Optimize Your Guest Machine Performance
You can do a little tweaking to your guest machine if your demo is running Windows XP to improve its importance and (most importantly) reduce its disk activity. In theory, the DemoRUs, TAN, BSGP, SST and MBS teams should do this to their images before they ship them to us, but it's an easy thing to forget. Remember to shut down and save changes to commit these settings to the VHDs.
Visual Effects. Disabling some of the Windows XP special effects and visual enhancements in the Virtual PC can make the demo feel “snappier” when opening menus and windows.
1. Open Control Panel from the Start menu and choose “System”.
2. Choose the “Advanced” tab.
3. Select the “Settings” button under the Performance section.
4. Check the “Adjust for best performance” box and click “Apply” to apply the settings.
Notes: If you choose the “Custom” option, you can selectively enable or disable specific effects. I usually turn "Use Visual Styles" back on so it has the Windows XP look and feel, but turn off all the animated menus, fade effects, cursor shadows, menu shadows, etc. I also use a custom background to tell my VMs apart.
Video Acceleration. Ensure that the Virtual Machine is using the full video acceleration of the host (For Windows XP, Display properties -> settings -> advanced -> troubleshoot -> and move the 'Hardware acceleration' slider all the way to the right)
Turn Off Remote Desktop. Unless you need it in the demo, disable Remote Desktop in your Virtual PC. Otherwise it runs in the background watching for RA calls.
1. Go back to Control Panel/System/Advanced
2. Choose the “Remote” tab
3. Make sure both “Allow Remote Assistance…” and “Allow users to connect…” are unchecked and click OK.
Turn Off System Restore. You don't need it for demo, especially if you're using Undo Disks in Virtual PC.
1. Go back to Control Panel/System/Advanced
2. Choose the “System Restore” tab.
3. Check the “Turn off System Restore on all drives” box and click OK – confirm OK when asked if you’re sure you want to disable System Restore
Folder Options. The way that items in folders are displayed can have an impact on the perceived speed of the operating system. Follow these steps to optimize folder views in Windows XP.
1. Open My Computer.
2. Open the C: Drive (Local Disk).
3. Choose “Folder Options” from the “Tools” menu.
4. Make sure “Use Windows classic folders” is selected.
5. Select the “View” tab.
6. Uncheck the “Automatically search for network folders and printers” option.
7. Click “Apply”.
8. Click the “Apply to All Folders” button.
9. Click OK to close the Folder Options dialog.
NTFS Compression (Advanced). In theory, if your host CPU is powerful enough (P4), switching on the NTFS disk compression technologies inside the virtual machine can increase performance.
Mouse Cursors. Use a flat mouse cursor inside a Virtual PC and a 3D cursor in host environment.
Optimize your Host Machine Performance
Your "host machine" is your laptop. Little things, like closing Internet Explorer, PowerPoint, and Outlook are very helpful in keeping your demos running fast.
Close other apps. Shut down other applications, especially Outlook, before running Virtual PC
Start VPCs One at a Time. With demos that require more than one machine, wait until the first virtual machine has completed loading, logged in and the hard disk and network lights have calmed down before launching the next virtual machine. This also helps prevent fragmentation on your host drive.
Hide the Virtual PC Console. Minimize the Virtual PC application (the console) as this displays a reduced view of the active sessions.
Optimize the Virtual PC Application Performance Settings. (In the Virtual PC console, go to File/Options to access these advanced settings.) Set “CPU Time” to “Allocate more CPU time to the active window” if you're doing a demo with a single VHD image. If you have a demo with a SharePoint server, set the performance to "Divide Time Equally." Set “Virtual PC background performance” to “Run at maximum speed”
Install More RAM. Increasing the memory will reduce the amount of disk paging the operating system has to perform; as disk i/o is most likely to be the slowest component of the host machine, switching off the page file and increasing memory may provide additional performance.
General Demo Tips & Resources
Use a desktop backgrounds to enable identification of virtual machines and their purpose
Create custom background with branding or call-to-action (nicely done)
Run demos at 800x600 if possible - easier to see, less bandwidth in Live Meeting (at lets you resize sharing pane and keep LM controls up)
Screen height to room depth ratio is 1:8 (i.e. 5' high screen can been seen from 40' away)
Consider using the largest standard mouse cursor and turn on mouse trails so it's easier to follow along
Super-Geek Tip!
Create a RAM Disk large enough to accommodate the VHD image file (plus additional space for expansion) and assign a drive letter to it. Copy the virtual machine to this location and run the image from the RAM Disk drive. Incredibly fast but you need 5-10 gigs of RAM.