SEARCH

How-To Geek

Improve VMware VM Performance by Defragmenting Virtual Disks

Have you noticed your VMware virtual machines sees like they’re sluggish and slow to respond?  Here’s how you can quickly defragment your virtual disks to make them fast as they were originally.

Just like a hard drive on a normal computer, the virtual hard drive on a virtual machine can become defragmented over time.  In fact, if your virtual disk is setup to dynamically expand over time, then fragmentation can become a serious problem, especially if your hard drive is low on free space.  You may notice your virtual machines running slower or being less responsive, and VMware itself may even notify you that your virtual disk is too fragmented.

Here’s what you’ll need to do.  First, while your virtual machine is running, run the default disk defragmenter as normal inside the virtual machine.  This may take some time if you haven’t done it in a while, and may also slow your whole computer down while it’s running.

image

Once the virtual machine’s OS has finished defragmenting, shut down the virtual machine.  Then, open your VMware virtual disk properties.  To do this in VMware Workstation, double-click on the Hard Disk info on the virtual machine’s main page.

sshot-2010-10-07-1-15-12-08

Alternately, if you’re using VMware Player, right-click on the virtual machine’s name and select Virtual Machine Settings.

image

Then select the Hard Disk entry from the Hardware tab if it’s not already selected.  If your virtual machine has multiple virtual disks, you may wish to repeat these steps on each virtual disk.

image

Click the Utilities button

image

VMware will start defragmenting your virtual disk.  This may take a while depending on your virtual machine’s size and how often you defragment it.

image

Once it’s done, you’ll be notified that the defragment is completed.

image

To improve performance even more, you should also regularly defragment your host computer’s hard drive.  This is not much of a problem in Windows 7 and Vista since they automatically keep your hard drive defragmented, but if you’re using XP, you might want to setup automatic disk defragmenting.  Alternately, if you’d like more defragmenting control, you can always run the defrag command in an elevated command prompt for a wide range of analysis and defrag options.

image

Most of us don’t think much about defragmenting virtual machines, but it can seriously improve your virtual machines’ performance.  We’re big fans of the free VMware Player, and if you have more advanced needs, VMware Workstation is a great option as well.  The great thing is, no matter which one you’re using, you can still keep your virtual machines running at top speed with a quick defrag.  If you’d like more info about VMware desktop virtualization products, check out some of our article below:

VMware Workstation 7 Review

Run XP Mode on Windows 7 Without Hardware Virtualization with VMware Player

Create an XP Mode for Windows 7 Home Versions & Vista

Run Ubuntu in Windows 7 or Windows in Ubuntu with VMware Player

Matthew digs up tasty bytes about Windows, Virtualization, and the cloud, and serves them up for all to enjoy!

  • Published 10/7/10

Comments (4)

  1. Raymond

    Does this defragmenting also apply to VirtualBox?

  2. Daniel

    The windows defragger is slow and inefficient in a ‘normal’ system, so in a VM environment, it’s going to be as bad, if not worse. I think the speed and thoroughness of defrag is important in a VM environment so that CPU/disk resources are not tied down for this task and the system can get back to work…windows defrag is not a good choice for a VM scenario.

  3. Victor

    What effect does defraying have on thin provisioned volumes? Does a defrag make a thin volume use up more disk space?

  4. Victor

    I meant defragging not defraying. Spellcheck has a mind if it’s own.

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!