Shrinking macOS guest VM .PVM files?

xmd

Member
How do we shrink macOS guest VMs? I'm open to manual or automated solutions, running either in the guest VM or the host OS or both.

With (the competitor's product) I have scripts which go something like this:

In Guest VM:
* diskutil secureErase freespace 0 'Macintosh HD'

In Host OS:
* Defragment: /Applications/VMware Fusion.app/Contents/Library/vmware-vdiskmanager -d /path/to/disk
* Compact: /Applications/VMware Fusion.app/Contents/Library/vmware-vdiskmanager -k /path/to/disk

This is not perfect, but does a decent job of freeing up unused space.


Can we come up with a similar pathway for compacting PVM files in Parallels?
 
So far, the only way I've found to reliably shrink an macOS VM in Parallels is to use this method:

To shrink macOS VM in Parallels (as of version 18 in 2022) the only really effective way is to duplicate the hard drive and copy files over:
- From Parallels VM Config, for the VM you want to shrink, go to Configure>Hardware and add a disk with the "Expanding disk" option checked.
- This disk will only take about as much space as you are actually using.
- Boot into the VM system
- (optional) Rename the 2nd hard drive (so you don't mix them up, they may both be named "Macintosh HD"
- Download the free Carbon Copy Cloner v5 (or v6, depending on which OS version) and clone your boot HD to the new HD
- Shutdown the VM
- From Parallels VM Config, remove the old HD, sending it to the trash (but don't empty trash yet!!!)
- Boot the VM to confirm that it's working fine.
- On the host machine, empty the trash to delete the old HD file

This is adapted from here
 
Back
Top