VMware Workstation

 View Only

 Help with Disk Cleanup not working

Einar104's profile image
Einar104 posted May 06, 2025 08:40 AM

Thank you for all replies!

The subject that I chose for this post was probably AMBIGUOUS!

Instead of: “Help with Disk Cleanup not working”

It should have been: "Help with Clean Up Disks… not working in VMware"

My VM consists of 5 virtual disks and with the Guest OS running I have:

1)

Run CHKDSK on all disk volumes with the following switches: /F /R

a.

After system restart, when running CHKDSK C: /F /R

Windows has made corrections to the file system.

No further action is required.

b.

And when running CHKDSK on all the other disk volumes

Windows has scanned the file system and found no problems.

No further action is required.

c.

And all ended with:  0 KB in bad sectors.

.

My Hard Disk 2 (NMVe) 2 TB has the Drive Letter E:\

2)

Run Disk Cleanup all disk volumes

a.

On all disk volumes, except C:\

You don't need to scan this drive.

b.

Disk Clean Up  for WinOS (C:)

Total amount of disk soace you gain 4.16 GB

c.

I have also in Virtual Machine Settings Defragmented and Compacted all virtual drives

.

None of these actions remedied my problem with

Clean Up Disks… stuck on - Reclaimable space: 554.4 GB

.

I have not pre-allocated space when setting up any of the virtual disk.

When specifying Disk Capacity, I have chosen: Split virtual disk into multiple files.

.

Regarding Select a Disk type - Virtual disk type:

NVMe is recommended

Why would SCSI be better?

.

Do you know of software that can repair corrupt VMDK file?

Original post:

My Host and Guest OS are both Windows 10 Pro.

 

Disk Cleanup was stuck on - Reclaimable space: 554.4 GB

Never getting - Cleanup is not necessary

 

At that point - Disk space used by the virtual machine: 1.7 TB

 

Does anyone know of software that can repair corrupt VMDK files?

I have only found software that can check for errors and recover data

from damaged VMDK files.

 

In lieu of such software if fixed my problem as follows.

 

After some research I found that the problem with Disk cleanup not working had to do with:

Hard Disk 2 (NMVe) 2 TB (in Virtual Machine Settings) - Current Size 1.2 TB, and

In Windows Properties (in the Guest OS) the Used space was only 636 GB.

 

I then Removed Hard Disk 2 (in Virtual Machine Settings), and

moved the associated VMDK files to a temporary folder.

 

After this Disk Cleanup yielded:

Disk space used by this virtual machine: 551,4 GB

- CLEANUP IS NOT NECESSARY

 

Then after adding a NEW virtual disk and another using an EXISTING virtual disk

- i.e. the VMDK files that I had moved to a temporary folder.

 

I booted the Guest OS, and after some Disk Management, I copied everything

from my old to my new disk volume. 

 

Finally after shutting down the Guest OS I removed the EXISTING virtual disk.

 

Now Disk Cleanup yielded:

  Disk space used by this virtual machine: 1.2 GB

- Reclaimable space 64 KB

 

NOT - Cleanup is not necessary

but OK!

 

Size in Virtual Machine Settings reduced from 1.7 TB to 1.2 TB i.e. by 0.5 TB

Size on disk reduced from 1,70 TB to 1.15 TB i.e. by 0.55 TB

 

RaSystemlord's profile image
RaSystemlord

Einar, I might not be familiar with all the Tools that you use, but those which I know, work like this:

1.
Windows Disk Cleanup

That's a Microsoft tool that, like any other msoft tool, does something and doesn't do something else. Also, there is no way, a tool knows everything that needs to be deleted on your computer. I would rather use something else after that tool, like:
- clean up Personal Temp and Windows Temp. They can grow huge, in size and number, with some applications.
- clean up Applications which you don't use, if anything is left. Check the disk for the space that those Applications still occupy from their folders
- I mean, "uninstall an Application" is just one program from a software vendor, which might be doing next to nothing ... it depends ...
- how do you know what the Application uninstall left behind ... you just need to know that
- clean up all your files that no uninstall or clean-up can possibly know about

Parallel to this - you had to delete ALL Snapshot files. If you think how a Snapshot works, NOTHING will ever get actually deleted from the disk, if there is a Snapshot. So, no space is EVER released from the VMware file itself. Release just happens in Windows, not in the VMware file, if there is a Snapshot.

After those, releasing the space allocation in VMware, happens with Compact. Do this:
- run defrag from VMware. In theory, it is not necessary to run this with SSD, but releasing the space might work better if you do... not sure though if this is needed, but it doesn't hurt to run this
- Compact the HDD/SSD virtual disk with VMware. This will ACTUALLY make the VMware file smaller and everything that was deleted will allow this file to become smaller with Compact

This is now assuming that you have NOT used pre-allocating the space when setting up the disk file ... then it shouldn't get smaller under any circumstance.

Maybe this explains your problem?

kasper's profile image
kasper

Make another backup of the data on the vmdk disk and the host drive the vmdk file resides on.

Check if you are using drive encryption on the host or the guest.

If so, decrypt.

Do a full format of the host drive and check the event logs for any anomolies.

Create a new vmdk file on the host drive.   I would suggest scsi, single file, persistent.

Restore the files to the vmdk.

Also, on both host and guest, run sfc /scannow.

Backup the host drive in question.

Morc001's profile image
Morc001

kasper's advise is very bad and will not help. RaSystemlord probably got it right, you must have snapshosts. If you don't know what snapshots are you don't need them. Right click the VM's tab in Workstation -> Snapshot -> Snapshot Manager. Select all snapshots (eg. Snapshot 1) one by one on the left of "You Are Here", then click Delete. It'll take a while because you have big snapshot(s): 

After all this is done and all snapshots are gone, you can shut down the VM, and compact the disk by editing the VM, selecting the VM disk and click Compact. The "Size on disk" is smaller due a filesystem feature called sparse file.

Morc001's profile image
Morc001

Don't message me directly, others can learn from your experience and the possible solution. So you say there are no snapshots and you never used them. Please send us a screenshot showing the directory listing of the VM folder, including the sizes of your files.

Regarding disk types: SCSI is better, because it's older, and more widely supported by older OSes. The emulated controller is determined by the disk type you select. NVMe is not supported by older OSes without drivers or at all.

James Lin's profile image
Broadcom Employee James Lin

Your post is a bit confusing to follow; it sounds like you did manage to reduce the size of your VM.  Are you still having a problem?  If so, please post screenshots and post the UI log (its location is shown in the Help > About dialog) after reproducing the problem.

If Clean Up Disks is not reclaiming unused space, then as others have suggested, I would try deleting all of your snapshots and running "%ProgramFiles%\VMware\VMware Tools\VMwareToolboxCmd.exe" disk shrink C:\