Tweaking VMWare Workstation & reducing Disk Thrashing
I use a VMWare virtual machine for development. Lately though, I have been having issues with my disk thrashing uncontrollably, slowing everything to a crawl.  This especially seemed to happen right after suspending my VM. The disk thrashing seemed to go on for a good 10 minutes before it came back to normal. This made my host machine completely unusable during this time.
With the help of DiskMon from Windows Sysinternals, I confirmed that the disk thrashing was being caused by VMWare. I did a bunch of research, and came up with the following tweaks that not only fixed my thrashing hard drive issues, but also made the VM generally faster for IO operations. I would like to share those tweaks with you here.
My configuration is as follows; but I’m sure you can apply the same tips with different versions of these software as well:
- Host: Windows 7
- Virtualization Technology: VMWare Workstation 7.1.1
- Guest: Windows 7
Tweak settings in VMWare
Disable “Take snapshots in the background” and “Restore snapshots in the background” in VMWare workstation by clicking Edit –> Preferences. Make sure the following checkboxes are unchecked.
Next, open your specific virtual machine’s settings, then navigate to the Options tab, and click on the Advanced item in the settings list. Put a check mark next to “Disable memory page trimming”. This will relieve VMWare from doing extra work, you can find an explanation of this option here.
Create a new Virtual Hard disk dedicated for the Windows Paging File
I chose mine to be about 6000MB or 6GB. If you have the luxury of more than one physical drive in your system, it would be even more beneficial to create this virtual disk on a different physical disk, rather than where the virtual machine resides.
When you create this new virtual drive, be sure sure that you choose the option to pre-allocate all the disk space up front. In my example I have a 80GB main drive and a 6GB pre-allocated drive. VMWare performance will be much better on this kind of a disk.
Next, for the drive you just created, click on the advanced button, and make sure the following settings are set; “Independent Mode” and “Persistent”. Since this drive will only be used for the Windows Paging file, we don’t need to worry about this data being included in snapshots. Not having this drive affected by snapshots will have less overhead on the operation of this drive. We want the windows paging file to function as fast as possible.
Now power up your virtual machine, open disk manager by clicking START and typing diskmgmt.msc. Disk management should see the new disk and ask you if you want to initialize it. After initializing it, do a full NTFS format, and assign any available drive letter. Once the disk is ready for use, you’ll want to change the location of your Windows Paging file. We can do this in the Virtual Memmory settings dialog.
- Click Start
- Right click Computer
- Click Properties
- Click on Advanced System Settings
- Select Advanced tab
- Under Performance click Settings
- Select Advanced tab again
- Under Virtual memory click Change button
Set all the options on this dialog to look like the screen below. In this example the B: drive is my swap drive for the paging file, while my C: drive is for windows.  You cannot completely disable the paging file on the windows drive, which is why I have a custom size set for C: to a minimum and max of 200MB. After you are finished, windows will ask you to reboot.
After re-starting your guest operating system, hopefully you will have noticed some improvement in speed. As for myself, I can say that this has solved my disk thrashing issues.
A further tweaks that you can also apply is to disable the Windows Search Indexing on both the Host and Guest operating system.
Roberto Sebestyen
I found this particular blog post , “Tweaking VMWare Workstation & reducing Disk Thrashing |
NoobTech Blog”, incredibly pleasurable plus the post ended up being a superb read.
Thanks for the post,George