How To Shrink VMware Virtual Disk Files and disable shrinking

Sometimes you just want to disable shrinking of VMdk for certain VMs. How do you do that?

Before you get started you should know that, if this is done repeatedly, the virtual disk can become unavailable, effectively causing a denial of service. so In most datacenter environments, disk shrinking – no. So you canĀ disable this feature. Especially if some people (even with no administrative privileges) can do that, so you better make sure…. šŸ˜Ž

Normal users and processesā€”that is users and processes without root or administrator privilegesā€”within virtual machines have the capability to invoke this procedure.

What does Shrinking?

Shrinking a virtual disk reclaims unused space in the virtual disk. It means that, if there is empty space in the disk, this process reduces the amount of space the virtual disk occupies on the host drive.

Before you edit the .vmx file:
01. Always power off the virtual machine.
02. Make sure you are logged on as a user with the correct permission level to edit the file.
03. Make a backup copy of the .vmx file. If your edits break the virtual machine, you can just roll back to the original version of the file.

To disable disk shrink for aĀ virtual machine:

01. Power off theĀ virtual machine and remove the virtual machine from the inventory.
02. Edit theĀ virtual machine’s .vmx fileĀ and add the following lines: = “TRUE” = “TRUE”

03. Power on the virtual machine and re-add the virtual machine to the inventory.

Source: VMware KB Article: 1010941

Rate this post


  1. says

    Hi Vladan,

    Thanks for this useful, easy to follow article.

    Do you think reducing the size that a VM occupies on the phsyical disk will also assist in any VMDK level fragmentation on the disk?



Leave a Reply

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