VMware Workstation

 View Only

 How to shrink a growing VMDK in Workstation Pro 17 after deleting large files?

lovelycraftapk's profile image
lovelycraftapk posted Oct 05, 2026 01:34 PM

Hi everyone. I run a Windows 11 guest on VMware Workstation Pro 17, and the virtual disk file has grown to nearly 200 GB even though I recently deleted about 80 GB of data inside the guest. The disk is not preallocated. I tried the Compact option in the virtual machine settings, but the VMDK barely shrank. Is there a reliable workflow to reclaim that space, such as zeroing free space inside the guest first and then compacting? I am also wondering whether converting the disk from growable to preallocated and back would help. Any advice on the correct sequence of steps would be appreciated.

Technogeezer's profile image
External Moderator Technogeezer

Do you have any virtual machine snapshots active or auto protect enabled (which also use snapshots). Snapshots will keep the compact option from freeing up space if the files you deleted are contained in a snapshot.

Derek Logie's profile image
Derek Logie

This may seem a bit obvious, but have you tried the option   VM/Manage/Clean Up Disks ...

RaSystemlord's profile image
RaSystemlord

What Technogeezer answered is right, of course it is.

But in short and for further explanation: If you have any Snapshot, nothing is EVER deleted from disk, but it is just marked as deleted. If you think about, this must be true in order to go back to a Snapshot. 

So, you must delete Snapshots. If you have many, it will take forever if you do it one by one. So, delete them ALL at one go in order to save time.

kasper's profile image
kasper

Use Clonezilla.  Clone the existing vmdk to a new vmdk.   See if the size of the new vmdk matches the old making sure you have done a 'compact' on the old.

Einar104's profile image
Einar104

Inside your Virtual Machine open a Command Prompt > Run as administrator and enter this:

cd /d C:\Program Files\VMware\VMware Tools\
VMwareToolboxCmd.exe disk shrink C:\

Here a picture shrinking E:\

image

 

Dylan Fletcher's profile image
Dylan Fletcher

One important detail worth knowing: deleting files inside the guest doesn't actually free the blocks from the host's point of view. When Windows deletes a file it just marks the space as reusable, so the VMDK keeps its size. For a shrink to actually reclaim space, the freed blocks need to be zero-filled first. That's why sometimes the shrink command runs and barely changes anything.

In my experience the most reliable sequence on a Windows guest is: first make sure there are no snapshots (as Technogeezer said, snapshots freeze the base disk and nothing gets reclaimed), then inside the guest zero the free space. I use the Sysinternals SDelete tool with the -z flag for that. Only then run the shrink, either Einar's VMwareToolboxCmd command or VM > Manage > Clean Up Disks, which does the same thing. And back the VM up before you start. Shrink rewrites the disk file, so it's not something you want to do on your only copy.

Einar104's profile image
Einar104

With help from AI this response to your question was generated : 

The absolute most reliable way to fix this is to zero-fill the empty space so VMware knows it is genuinely vacant. The "Compact" button in the VM settings often fails because when you delete files inside Windows 11, the OS doesn't actually erase the underlying data blocks—it just marks them as available, so VMware still thinks the space is in use.
The command you are looking for is VMwareToolboxCmd.exe. It handles the entire process in one go: it wipes the deleted blocks with zeros and then triggers the host to shrink the file. However, how you run this depends on your virtual machine's hardware compatibility version. [1] 
Here is the complete workflow to reclaim your 80 GB:
Step 1: Check your Hardware Compatibility
In VMware Workstation, look at the Virtual Machine Details pane on the left or the summary tab for your Windows 11 VM before powering it on. Look for the line that says Hardware compatibility. [2] 
Step 2: Choose the method that matches your version
Method A: The Quick Command (For Hardware Compatibility 15.x or older)
If your VM happens to be running on an older hardware standard (like 15.x), you can run the shrink utility directly from inside the guest operating system.
1.    Boot up your Windows 11 VM.
2.    Open the Command Prompt (CMD) as an Administrator.
3.    Run the following commands:
cd /d "C:\Program Files\VMware\VMware Tools\"
VMwareToolboxCmd.exe disk shrink C:\
Note: Disregard any "Low Disk Space" warnings that pop up during this process. This is completely normal; the tool is intentionally filling the empty space with temporary zero-files before cleaning them up and truncating the disk.
Method B: The Modern Workflow (For Native Hardware Compatibility 17.x)
If you run the command from Method A on a native Workstation 17.x hardware layout, you will likely get an error stating: "Shrink disk is not supported for this virtual machine." VMware restricts in-guest shrinking on newer split-disk architectures. If that happens, use this sequence instead:
1.    Zero-fill the deleted space manually: Download Microsoft's official, free command-line utility from the Microsoft Learn SDelete Download Page. Copy the program inside your VM, open an Administrator Command Prompt in the folder where you extracted it, and run: [3, 4] 
sdelete64.exe -z c:
(The -z switch manually writes zeros over your 80 GB of deleted data so VMware can read it as truly empty).
2. Shut down the VM completely (do not just suspend it).
3. Compact from the host: Open VMware Workstation on your physical PC. Go to VM Settings > Hard Disk > Utilities > Compact. Now that the space is properly zeroed, the .vmdk file will shrink and hand back your 80 GB immediately. [1, 3, 5] 
Regarding your idea about converting the disk:
Do not waste time converting the disk to preallocated and back to growable. Doing this with a 200 GB file takes a massive amount of time and will not fix the underlying issue because the un-zeroed deleted blocks will just be copied right along with the rest of the data. Stick to the zero-fill and compact workflows above!

[1] https://techdirectarchive.com
[2] https://www.sysnettechsolutions.com
[3] https://learn.microsoft.com
[4] https://www.youtube.com
[5] https://www.hdd-tool.com