Quantcast
Channel: VMware Communities : Discussion List - VMware Fusion® (for Mac)
Viewing all articles
Browse latest Browse all 12061

How to "clean up virtual machine" through scripting

$
0
0

Every time I shutdown my WinXP VM, I see that there are gigs of wasted space.  I usually need to click the refresh button in the VM Library view to see how much is wasted, then click Settings, then go to General and hit Clean Up Virtual Machine.

 

This is a very wasteful and inconvenient way of working with the VM.

 

My VM has a single snapshot that I am working from (was  created to capture the base OS install), and is using a single file for  its VMDK (no 2 gig file business).

 

So, I want to clean up the VM via a script, but can't seem to find a way.  Here are the things I tried and failed:

  1. Use "/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager -d  ~/Virtual\ Machines.localized/WinXPPro.vmwarevm/WinXPPro000001.vmdk". 
    • Doesn't reduce the "Reclaimable" space.
  2. So, Defragment doesn't really sound like it can reclaim wasted space, try the Shrink option: "/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager -k  ~/Virtual\ Machines.localized/WinXPPro.vmwarevm/WinXPPro.vmdk"
    • Got "This disk is part of a snapshot chain in '/Users/_username_/Virtual Machines.localized/WinXPPro.vmwarevm/WinXPPro.vmx'.
      The selected operation can only be executed on a disk with no snapshots.
      "

 

So, how does one go about reclaiming wasted space on a VM from the command line?  I would like to automate this process so that at every VM shutdown, wasted space is reclaimed.


Viewing all articles
Browse latest Browse all 12061

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>