In my last article on virtualization with Microsoft's Virtual PC 2004 SP1, I covered how you can use Differencing Disks to your advantage. However, in retrospect, this article was posted a bit out of order. The article below should have been posted first. Before you start building out your Virtual PC's, you should first be aware of how to squeeze out every last drop of performance. After all you're running a machine within a machine, so it's going to be a bit slower than the host, and thus, why not make it as fast as possible!
In this article, I'll outline some of the things I do with all my VPCs in order to keep them up to speed. Some of these things I've picked up along the way from my own experience, from the Virtual PC newsgroup, virtualization blogs, webcasts, and other sources. One disclaimer: I did receive a list of some performance things from someone who I wanted to give credit to, but he claimed he got the list from someone else and he wasn't sure who that was so he didn't want to claim credit for something that was someone else's work. Thus, some of the techniques listed here may not be original, so please don't take it that I'm trying to play them off as such.
Most of the items in this post will have only a tiny effect on your virtual machines. However collectively, they should help over the long haul, and surly squeeze a bit more performance out of your virtual environment... now, onto performance!
A Little Organization
First things first, let's get organized! I love BGINFO from www.sysinternals.com. When all of my VPC's boot up, I have them set to update the desktop so I can see the following information (you can view a sample from a VPC I recently ran up to test & get used to ISA 2004):
If you're interested, you can download my BGINFO settings file and
click to enlarge
- The more memory you have, the better. I've run full blown developer VPCs with the configs above with only 768MB in the host OS. Personally, I would try to get 2GB on your host OS and dedicate at least half of that to a VPC.
- Put all your VPC's on a separate drive from you OS drive. This reduces contention. The best option IMHO is to get one of those self powered USB 2.5" disks like this one. Spend the extra money for the faster drive (5400 RPM), you'll notice an improvement if you do. With that being said, I'm running a 3.5" drive that requires external power... but I primarily use it at work so portability wasn't the biggest factor... honestly the biggest factor was the $10 instant rebate and $40 mail in rebate which made this 80GB 7200RPM drive cost less than $40. Can't beat that!
- Keep the drive where you store your VHD files defragmented.
- Keep your VHD files as defragmented as possible: VHD's are massive... the fewer fragments they are in the faster they'll run. I use a tool called contig from SysInternals to analyze and defragment a specific file. Here's what contig looks like:
Shut off your AntiVirus software: unless you can exclude VHD and VSV files from being monitored by AntiVirus applications, shut it down... it's just more disk contention that you have to deal with.
Kill Unnecessary Services on Startup
Every time your machine boots up, various services are started automatically. Many are important and required, but some just aren't needed within a disposable or hosted environment such as a VPC. Some of the services I always kill are:
- Help & Support
- Print Spooler
- Error Reporting Service
- Task Scheduler (unless my VPC contains SharePoint, or another app that needs it)
An easy way to do this is to create a batch file that stops each of these services on startup. I used the same method that I used for updating my desktop with updated system info. Feel free to download and use my batch file. Just add a shortcut to the startup Start menu folder for the All Users profile and set it to run minimized... same deal as before.
Disable Visual Enhancements
Unless you're an avid reader of the Virtual PC Guy's WebLog and follows his Gaming under Virtual PC posts, you don't need to have your VPC have the most optimal visual experience (than again, maybe you do... but you're sacrificing performance for it).
Trimming the visual enhancements from your VPC is very simple. First, disable your video hardware acceleration:
click to enlarge
Next, you need to disable the visual enhancements in the OS. These are the fading & sliding menus, smooth font edges, etc.
Disable System Protection/Safeguards
If you're running WindowsXP as the guest OS (the OS within your VPC), you should disable the system restore process that helps you rollback changes to your environment. It's an unnecessary monitoring service, one you can duplicate using VirtualPC's undo disks.
click to enlarge
Another setting enabled on a default install is the OS will create a memory dump file on a system failure. While this information is helpful if you're on a PSS call troubleshooting a BSOD or if you're handy with WinDbg and understand the intricacies of debugging, I don't deem it necessary... and it's quite easy to disable:
Disable System User Friendly Settings & Accessibility
Finally, there's one last setting to disable. By default, Windows will search for network drives and printers. Yet again, it may be helpful in day-to-day usage, but within a VPC, I don't deem it necessary. This setting can be found in the folder options dialog.
click to enlarge
As mentioned at the beginning of this article, each of these tweaks on their own won't yield a noticeable improvement. However, collectively they should squeeze a bit more performance out of your Virtual Machines.