How to Shrink a VMware Virtual Machine and Free Up Disk Space

By default, VMware creates “growable” disks that grow larger in size as you add data. Unfortunately, they don’t automatically shrink when you remove data. You’ll need to clean up or compact your disks to actually free up space on your hard drive.

The process is a little different on different versions of VMware. We’ll cover the process for VMware Player, VMware Fusion, and VMware Workstation here.

Before you begin, you may want to free up additional space inside the virtual machine. Empty your recycle bin, uninstall programs you don’t use, and delete other unnecessary files to free up space.

First, Ensure You’re Using a Preallocated Disk

This process only works with growable, or “sparse”, disks. Preallocated disks are always their maximum size. If you have a preallocated disk you want to compact, you’ll need to convert it to a growable disk before continuing.

Your virtual machine probably has a growable disk, though. VMware Player can only create growable disks, VMware Fusion always uses growable disks unless you allocate the disk space in a virtual machine’s settings after creating it, and VMware Workstation creates growable disks unless you go into the custom settings and check “Allocate all disk space now” while creating a new virtual machine.

On VMware Workstation or VMware Player, right-click a virtual machine and select “Settings”. Check whether it says “Preallocated” next to the disk’s size in the Summary view or not.

On VMware Fusion, select a virtual machine and click Virtual Machine > Settings > Hard Disk > Advanced options. Check whether the “Pre-allocate disk space” option under Advanced options is checked or not.

VMware Player

VMware Played doesn’t have the convenient “Clean Up Disk” button you’ll see in paid VMware products, but you can still do this with a few options in its interface.

In VMware Player, first power off your virtual machine. You can’t compact its disk if it’s powered on or suspended.

With the virtual machine powered off, select it and click “Edit virtual machine settings”, or right-click it and select “Settings”.

Click the “Hard Disk” option in the device list on the Hardware tab.

First, click the “Defragment” button under Disk utilities to defragment the virtual machine’s disk.

When VMware finishes the defragmentation process, click the “Compact” button under Disk utilities. VMware will compact the underlying virtual hard disk (.vmdk) files to free up space.

VMware Player does not support snapshots, so you won’t have any snapshots taking up additional space on your computer.

VMware Fusion

In VMware Fusion, first power down a virtual machine. You can’t do this while a virtual machine is powered on or suspended.

In the main VMware Fusion window, select a virtual machine and click the “Refresh Disk Space” icon to the right of its disk usage, at the bottom right corner of the window. You won’t see up-to-date disk usage information for the virtual machine until you do this.

The yellow “Reclaimable” data is how much space you can free up by cleaning up your virtual machine. If your virtual machine has free space you can reclaim, you’ll see a “Clean Up Recommended” message appear at the bottom of the window. Click it to continue.

Click the “Clean Up Virtual Machine” button in the window that appears. VMware will automatically clean up your virtual machine and you’ll free up however much space appears as “Reclaimable” here.

VMware Fusion also allows you to create snapshots, which capture a virtual machine’s state at a point in time. If these are using a lot of space according to the disk usage information here, you can delete snapshots to free up space if you no longer need them.

To view snapshots, select a virtual machine in the main Virtual Machine Library window and click the “Snapshots” button on the toolbar. Select a snapshot and click “Delete” to delete it.

You won’t be able to restore your virtual machine to that point in time after deleting the snapshot, of course.

VMware Workstation

In VMware Workstation, first power off the virtual machine you want to compact. You can’t complete this process if it’s powered on or suspended.

Select the virtual machine you want to compact in the main window and click VM > Manage > Clean Up Disks.

The tool will analyze the selected virtual machine’s disk and show you how much space you can reclaim. To reclaim the space, click “Clean up now”.

If no space can be freed, you’ll see a “Cleanup is not necessary” message here instead.

VMware Workstation also allows you to create snapshots, which contain a complete “snapshot” of a virtual machine’s state at the point in time you created them. These can take a lot of space if the virtual machine has changed significantly since then. You can free up additional space by deleting snapshots you no longer need.

To view the snapshots for a virtual machine, select the virtual machine in VMware Workstation and click VM > Snapshot > Snapshot Manager.

To delete a snapshot you no longer need, right-click it in the Snapshot Manager window and select “Delete”. It will be removed from your computer.

You won’t be able to restore your virtual machine to that previous point in time after deleting the snapshot, of course.

Chris Hoffman is a technology writer and all-around computer geek. He's as at home using the Linux terminal as he is digging into the Windows registry. Connect with him on Google+.