VMware Communities
P_2
Contributor
Contributor

Disk space on vm only for little time

Spoiler
I use some macOS VMs for simple operations and I set them with the minimum disk space (40 Gb): I use approximatively only half space.
I would upgrade them from Catalina to Big Sur, but it requires 25GB more only for the upgrade operations. So I would have to expand the disk space, but at the end of the upgrade the used space would be the same as today and i would have wasted 25GB per VM.
I belived I could reduce the disk dimention, but I was wrong.
Do someone have some tips not to waste space?
0 Kudos
3 Replies
gringley
Hot Shot
Hot Shot

This is what I ended up with for shrinking Catalinas back to minimum -

Shrink Catalina

  1. From inside the VM using a terminal session I issue the following command
    cat /dev/zero > wipefile; rm wipefile
  2. Shutdown the VM and exit VMware Fusion
  3. Execute the following command to defragment the disk (substitute VM name/Disk Name)
    /Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager -d macOS\ 10.15\ 64-bit.vmwarevm/Virtual\ Disk.vmdk
  4. Execute the following command to shrink the disk (substitute VM name/Disk Name)
    /Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager -k macOS\ 10.15\ 64-bit.vmwarevm/Virtual\ Disk.vmdk

I also find it is good to go into Apple ID and make sure all the Apps are unchecked (save maybe Keychain unless you need some of the other stuff) and reboot if you did uncheck Apps before shrinking.

wila
Immortal
Immortal

Hi,

I remember having seen the same.

One thing to try is to add an extra virtual disk and use that for the upgrade (not entirely sure what you would have to do to convince macOS to use the extra disk) and remove the disk afterwards.

Reclaiming the disk space can be done as well, but it will probably mean that you have to write out zero's and use the command line afterwards to reclaim the space.

See:
http://www.vi-toolkit.com/wiki/index.php/Shrink_guest_on_hosted_platform

for more tips on that.

edit: nevermind, use gringley's reply, his/her answer is the complete steps.
I had forgotten to hit "Post" on my reply before I walked away and just hit it to see that answer is betterer 😉
--
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
ColoradoMarmot
Champion
Champion

FWIW, I've found that creating a new VM, adding the old virtual disk, and using the migration wizard works as well.  Bit brute force, but hey, it's an option.

0 Kudos