Desktop Virtualization

Virtualization news and reviews

  • Solutions
  • Articles
  • Glossary
  • Contact

Gleb Reys January 21, 2008 7 Comments

Disk Performance Tips for VMware Workstation

Lately I've been doing a lot of research with virtual machines created in VMware Workstation. And one of the first things you become conscious about is that disk performance in your virtual machine is far from being ideal. Don't be too quick to blame VMware though, there's quite a few reasons related to poor I/O, and that's why I decided to give you a few tips to achieve maximum performance.

1. Pre-allocate virtual disk space

By default, your VMware Workstation doesn't pre-allocate space for the disks of your virtual machine. This means that as demand for more space inside your VM grows, new storage units are being reserved by VMware Workstation and allocated from the host OS filesystem.

Naturally, such an approach is very expensive performance-wise, but it's used by the default because it helps you save up space on your host OS filesystem – your virtual machine will only use up as much space as it needs rather than pre-allocating the whole agreed volume of the virtual disk.

Pre-allocation is one of the easiest ways to achieve best performance in VMware Workstation VMs – it creates the file before you get to run your VM, which means when the space is required, your VM will simply use portions of its virtual disk file, without having the VMware Workstation allocating new storage blocks from the host OS filesystem.

Here's how a dialogue might look (this is a VMware Workstation 5 screenshot, but it should look similarly in VMware Workstation 6 as well):

VMware Disk Capacity Allocation

Simply tick the "Allocate all disk space now" option.

2. Disable automatic file protection in your anti-virus software

Quite often, the reason you have a less than perfect I/O in your virtual machine is because you have an anti-virus software actively monitoring your host OS filesystem, and every time VMware Workstation access the virtual disk of your VM this file needs to be scanned by the anti-virus software.

Luckily, you can exclude certain files or directories from being scanned by your anti-virus, and in our case simply making sure .vmdk files are skipped is enough to improve the performance.

In Symantec AntiVirus, this is done using the File System Auto-Protect dialogue:

File System Auto Protect Dialogue in Symantec AntiVirus

As you can see, there's a special option there: Exclude selected files and directories, which is not active by default. Once you turn this option on, the Exclusions button to the right of it becomes active (it's greyed out on this screenshot as you can see).

Clicking the button will give you two options: specify the extensions of the files you'd like to be excluded from the auto-protect, or simply point out the files and directories in your filesystem which should be ignored.

Speaking of VMware Workstation, it's probably easier for you to make the .vmdk extension ignored – this will take care of all the virtual machines and their virtual disk files, wherever they are – you won't have to specify exact directories, and if you ever move your virtual machine to another directory or disk, you won't have to change any of these exclusion options again.

File System Auto Protect Exclusions in Symantec AntiVirus

The extensions dialogue looks like this:

File System Auto Protect Extensions in Symantec AntiVirus

Simply specify the extensions you want ignored, and you're done!

3. De-fragment the host OS filesystem with files for your VMs

This is another very important step: you have to regularly de-fragment the host OS filesystem, because virtual disk files for your VMs are quite large by their nature, and therefore are likely to be defragmented.

With virtual disk space pre-allocation, your will be in a slightly better position, but de-fragmenting the host OS filesystem is still a good idea.

To make it even better, you can create a separate filesystem to store VMs, this way the amount of created/deleted files there will be minimal, thus greatly reducing the filesystem fragmentation.

Filed Under: VMware Tagged With: performance, VMware, vmware workstation

Upcoming topics

  • VMware View 4
  • PCoIP
  • New in xVM VirtualBox 3.1
  • vSphere 4

Comments

  1. JSBertram says

    February 10, 2008 at 5:32 pm

    Once you think about it, it seems obvious to exclude the real-world VM files from AV monitoring on the Host.

    It should also be obvious to install the Anti-Virus software within VMs themselves.

    Shouldn't you also exclude the .VMEM files too?

    JSB

  2. admin says

    February 10, 2008 at 7:55 pm

    Thanks for pointing this out!

    Absolutely, .vmem files are also important enough to be excluded. Performance-wise, it's probably best to have them disabled altogether.

  3. MartyNZ says

    July 31, 2008 at 12:13 am

    I am running 3 development environments on VM Workstation 6.0. I have done as mentioned above but have this problem on all 3 machines.
    I pre-allocated space for each VM when they were created, and installed all the tools I required. Checking the space left available I had about 25% disk space spare. Now after using the VM's for a couple of weeks I'm getting 'low disk space' messages, and when I check, the drives for each VM are all full (0% free) and badly defragmented. Of course they fail the defrag because of lack of space. This is all without installing any more software, and all my working files are kept on the host system. Can you give me any idea what might be happening and how can I fix it?

  4. daleallenc says

    August 11, 2008 at 6:35 pm

    MartyNZ,

    I'd recommend downloading and installing VMware Converter (formerly P2V). The free version requires you to shut down the VMs. You don't really need to convert your virtual hard disks because they're already in the format you need them, but by running them through the utility you 1) will automatically defragment them, 2) can re-size the disks, 3) can pre-allocate the disk size, and 4) can chunk the disks up in 2GB pieces (which makes it easier to defrag later because you'll need less space on the host)

  5. Javidoo says

    October 1, 2008 at 6:47 pm

    Excelent tips!! Certainly could be considered bests practices.

  6. George Bohannon says

    January 31, 2012 at 1:17 am

    I noticed you mentioned using VMware Converter to "chunk the disks up in 2GB pieces". I read somewhere that using the 2GB chunky versions of vmdk is slower than using one big file, but I haven't found anyone to tell me how much slower it is. Do you have an estimate? That would help me decide whether it is worth chunking the vmdk. Thanks.

Trackbacks

  1. Disk Performance Tips for VMware Workstation « Snip IT Blog says:
    November 16, 2009 at 1:47 pm

    […] Posted on November 16, 2009. Filed under: VMWare | Tags: VMWare Workstation | http://www.desktop-virtualization.com/2008/01/21/disk-performance-tips-for-vmware-workstation/ […]

Leave a Reply

Your email address will not be published. Required fields are marked *

See Also

  • Unix Tutorial
  • Basic Unix Commands
  • Advanced Unix Commands
  • SSH port forwarding
  • Unix Tutorial Digest
  • Unix Reference

Advertise Here

If you're interested in advertising your desktop virtualization product on this website, please use the contact form to provide additional information.

Virtualization Software

APPIP ERROR: amazonproducts[
AccessDenied|The Access Key Id AKIAIJB2ICKX5VVPQVJA is not enabled for accessing Product Advertising API. Please sign up for Product Advertising API at https://affiliate-program.amazon.com/assoc_credentials/home.
]
APPIP ERROR: amazonproducts[
AccessDenied|The Access Key Id AKIAIJB2ICKX5VVPQVJA is not enabled for accessing Product Advertising API. Please sign up for Product Advertising API at https://affiliate-program.amazon.com/assoc_credentials/home.
]

Books you should read

  • Mastering VMware vSphere 4 (Computer/Tech)
  • vSphere 4.0 Quick Start Guide: Shortcuts down the path of Virtualization
  • Virtualizing Microsoft Tier 1 Applications with VMware vSphere 4

Recently Written

  • Follow Up on Hardware Virtualization
  • Open VM Tools or VMware Tools?
  • The End of the Road?
  • Desktop Virtualization in 2016
  • What Are Your Thoughts On VirtualBox 5.0?

Basic Unix Commands

Basic Unix Commands
  • ls command
  • mkdir command
  • man command in unix
  • cd command - change directory
  • uname command

Useful links

  • Solaris Blog
  • Unix Tutorial Unix Tutorials and System Administation Tips

Unix/Linux Reference

Unix Reference
  • check CentOS version
  • check Raspbian version
  • SSH port forwarding
  • unix commands
  • visudo tutorial
  • mtime unix
  • lrwxrwxrwx
  • Unix Tutorial digest

Advanced Unix Commands

Advanced Unix Commands
  • ln command - symlinks
  • tune2fs unix command - filesystem parameters
  • du command - disk usage
  • lsb_release command
  • find unix command

Virtualization Glossary

  • VDI
  • Virtual Machine
  • Sun xVM suite

Copyright © 2023 · Streamline Pro Theme on Genesis Framework · WordPress · Log in