VM Performance Checklist - Before you Complain that your Virtual Machine is Slow
I continue to meet folks who complain that their Virtual Machine performance is slow. Yes, it would be great if VMs somehow were able to self-tune the relationship between themselves and the host OS, but that's sadly not the case.
When you're running an OS within and OS and maintaining a FileSystem within a FileSystem, not to mention sharing a hard drive spindle, there's lots of opportunities for things to go very slowly.
If you're experiencing poor VM performance, I would encourage you to go through a Performance Checklist.
Also, before you start, remember what you goals are. You'll not get your VMs running at 100% of native speed, at least not this year, so just stop aiming for that as a goal.
Here's some more realistic goals:
- Ideally Virtual PC performance is at:
- CPU: 96-97% of host
- Network: 70-90% of host
- Disk: 40-70% of host
Try to make all of these changes if you can. If you can't do one or more of these recommendations, then you can't complain. ;)
Virtual PC Performance Checklist
- Make sure your Host Operating System's disk is defragmented.
- This includes the System Disk (the disk your OS boots off of) as well as the Disk that holds your Virtual Hard Disk File.
- For a quick fix, use a single-file defragmenter like Contig from SysInternals. With the Virtual Machine shut down, run Contig -a to analyze single file fragmentation and run without -a to defragment the file.
- Run Fewer Applications.
- I'm continually amazed when folks complain about VM performance and when I get to their desk I see that they are running Outlook. That 200+megs could be better used by the system. Are you running a VM or checking your email? Consider checking your email on a schedule, or using Outlook Web Access while you work on your VM.
- If you have 2 GIG or more of memory, consider running your Host Operating System without a Paging File. This doesn't mean you get to keep 50 applications, plus Outlook running all at once, but it does take the pressure off your Host OS's disk, and you might find things run considerably snappier.
- Run the Virtual Machine on a separate spindle.
- There's no better tip, as anyone who has run VMs (I've been using VMWare since it was in Beta) will tell you. The #1 bottleneck is disk.
- Try to use a 7200RPM or 10000RPM drive for your VM disk
- Use USB2 or SATA or Fireware.
- If you're using USB2, make sure the Eternal Hard Drive is on it's own USB root hub, all alone. Don't share it with your keyboard, mouse, or webcam.
- Optimize your VM for your current task.
- Personally, I use and highly recommend Invirtus Virtual Machine Optimizer for this. It's inexpensive if you value your time. Considering getting a site license and actually do the math at how much time it'll save your company when you're trying to convince your boss. I run it over lunch on a VM and move on. You can also do a lot of the work manually if you have the time using tools like XPLite and CrapCleaner (although less so with CrapCleaner if the box is already fresh).
- Remove any application that's not needed.
- Shut down every service you can possibly get away with.
- Enable Hardware Assisted Virtualization
- If you've got this on your computer, turn it on. There IS some concern about really sophisticated Trojans that can use this technology for evil, but for me, it's all good as it speeds most Guest Operating Systems (especially non-Microsoft ones) up quite a bit.
- Give your Virtual Machines LESS MEMORY
- I've found that 512 megs is just about the Ideal Amount of memory for 90% of your Virtual Machines. Don't bother trying to give them 1024 megs, it's just not worth the pressure it'll put on the Host Operating System.
- Considering making a custom Windows install for your VMs.
- Rather than going to all the effort to REMOVE things, why not create a Windows installation that can be shared across your organization that doesn't include the crap ahead of time. There's a Windows Installation Customizer called nLite that lets you prepare Windows installations so they never include the stuff you don't want. Makes it easier if Solitaire is never installed, eh?
- Make sure the Guest Operating System is defragmented.
- Jeff likes this free Disk Defragmenter that runs in that "Text Mode" place before Windows really starts up. This allows it to get at files that don't always get defragmented.
- Squish your VM Hard Drive.
- Again, I use Invirtus so it does this for me, but you can also zero out the free space on your VM hard drive with the Virtual PC Pre-Compactor that comes with Virtual PC when hosting Windows, and there are Linux options for shrinking VM hard drives as well.
- Don't use NTFS Compression on the Virtual Machine Hard Drive File in the Host Operating System
- NTFS Compression doesn't work on files larger than 4 gigs, and can cause corruption.
- Don't Remote Desktop or VNC into Host Operating Systems that are hosting Virtual Machines.
- If you're remoting into a machine where THAT machine is running a VM, note that to the Remote Desktop protocol (and VNC) the VM just looks like a big square bitmap that is constantly changing. That guarantees you slow performance. If you can, instead, Remote Desktop into the Virtual Machine itself.
- Make sure you've install the Virtual Machine Additions (or Tools, or Utilities, or Whatever)
- Virtual PC and VMWare and Parallels all include drivers and tools that improve the performance of your Virtual Machine. They are there for good reason, make sure you've installed them.
- Also, if you're running a Virtual Machine created under and older version, like Virtual PC 2004, and you're now running under a newer one, like 2007, pay attention to the upgrade warnings and install the latest drivers and Virtual Machine Additions.
- Optimize Painting and the "Perception of Responsiveness"
- If you're running a VM, you don't need to have eye candy like menu fades, smooth scrolling or shadows.
- Turn off wallpaper
- Turn off Window Dragging and Shadows under Menus (under Effects in the Display Control Panel). Consider removing all effects like fading as well as ClearType.
- Consider running the Classic Theme if you're running an XP VM, or consider "net stop themes" altogether.
- Turn off the Mouse Pointer Shadow in the Mouse Control Panel.
- Turn off Mouse
- Use TweakXP or change the Registry to remove the Menu Delay for the Start Menu and other Menus via the MenuShowDelay setting in HKEY_CURRENT_USER\Control Panel\Desktop.
Did I miss any tips?