VMware Communities
blake1024
Contributor
Contributor

How do I shrink the disk size on the host?

Product:  Workstation Pro 16.1

Host:  64-bit Linux Desktop

Guest:  64-bit Linux Desktop

Disk file:  .vmdk not pre-allocated

I would like to shrink the size of the .vmdk file on the host.  Guest says I am using 18GB.  Host file is 40GB.  How can I shrink the host file?

I read the docs.  They say to run the program "vmware-toolbox".  I don't have that program.  I do have "vmware-toolbox-cmd" but that isn't any help.

Sure appreciate any help.

Thanks!

Blake McBride

 

 

0 Kudos
2 Replies
wila
Immortal
Immortal

Hi Blake,

Read my article here please:
https://www.vi-toolkit.com/wiki/index.php?title=Shrink_guest_on_hosted_platform

For a Linux guest it basically boils down to using either vmware-toolbox-cmd if it is supported or using the vmware-vdiskmanager command. Note that shrinking is per partition and that you really should wipe out the disk with zero's in order to mark part of the disk as empty.

Also note that you cannot shrink an encrypted disk, because the zero data is random data in that case.

Let me know if you still have questions after that and I will assist further.

--
Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos
blake1024
Contributor
Contributor

Thanks!  What I found that worked perfectly for me is as follows:

Perform a defrag from within the host via:  e4defrag /

Set all free disk space to zero with:  

    dd if=/dev/zero of=wipefile bs=1024x1024
    sync
    rm wipefile

Compact the disk from the VMWare control app:

       Edit VM settings / Hard Disk / Compact Disk

0 Kudos