Your Virtual Machine Guests in Hyper-V should be treated like any other Operating System. They should be updated, defragmented, monitored, and fine tuned for performance.
Here is the primary link you will want to reference for installation, configuration, and performance of Hyper-V Virtual Machines: http://technet.microsoft.com/en-us/library/cc753637(WS.10).aspx (Don’t forget to use the Best Practices Analyzer for Hyper-V!)
Specifically, we want to focus on one area in this Perfomance Tip: Creating a Swap Disk to store the Paging File (Pagefile or pagefile.sys). Just like a physical box, the virtual machine can gain performance by moving the Paging File off of the boot drive. This can be acheived as follows:
1) Shutdown your Virtual Machine.
2) Create a Fixed Virtual Disk that is 1.5 times the amount of RAM your Virtual Machine is using. Example, if your VM has 4 GB allocated to it, your Fixed Disk would be 6 GB (I prefer 2 times the amount in my builds, so mine would be 8 GB). If you can store the Fixed Disk on a really fast drive, such as an SSD, the better off you will be. As a general rule, if you can’t afford an SSD (and who can!), try to make sure that your physical hard disks are operating at 7200 RPM or more. It is important to note that the best gains will be achieved by having this fixed virtual disk on a separate physical disk/controller than your boot virtual disk.
3) Attach the Fixed Virtual Disk to your Virtual Machine as an IDE to the second IDE Controller (IDE Controller 1). It is critical that you attach the disk as an IDE and not SCSI as the SCSI controller is synthetic (Its the same reason why you can’t boot from it).
4) Start up your Virtual Machine.
5) With your Swap File (the Fixed Virtual Disk) now in place, you can move the page file by the following. Please note that these instructions are for Server 2008 R2 SP1 but apply to other Windows based Operating Systems:
– Right click on Computer and select Properties, then select Advanced system settings.
– Under the Advanced tab, in the Performance section, select Settings.
– Under the Advanced tab of Performance Options in the Virtual memory section, select Change.
– Uncheck “Automatically manage paging file size for all drives”.
– Set a Custom Size of 1.5 times your VM memory (or 2 times in my case) on the Fixed Disk you determined to use as your Swap Drive. The Initial and Maximum Size should be the same. Example. if 8 GB is 2 times your physical memory, set the Initial and Maximum to 8 GB.
– Reboot your Virtual Machine.
– IMPORTANT: Upon reboot, go back to the Virtual memory settings and make sure to leave at least 16 MB (by setting the Intial and Maximum Custom Size to 16 MB) on the boot drive for paging. While we are moving the primary load to another disk, you may need this in case your Swap Drive becomes unavailable!
– Reboot one final time and enjoy the increased performance.