I use VMWare Fusion on my Mac to run a virtual Windows 7 machine, and the Microsoft IE compatibility Windows XP virtual machines.

In VMWare Tools on the Windows guest OSes, there’s a “Shrink” option that lets you reduce the size of the sparse disk image used by the guest OS, to save hard drive space on your host OX.

I’ve recently created another virtual machine, this time running Snow Leopard Server. I was wondering if I could shrink the spare disk image used by this machine too, but I can’t find a VMWare Tools app on the Mac guest OS, even though VMWare Tools have been installed (as VMWare’s Shared Folders feature is working).

Is there any way to shrink the sparse disk image used by Mac OS X guest OSes in VMWare Fusion?

link|improve this question

Unfortunately this no longer works in VMWare Fusion 4 as the vdiskmanager is no longer in this folder. Nobody seems to know where it now exists if at all. – Steve Apr 15 at 17:02
feedback

2 Answers

up vote 2 down vote accepted

Aha — indeed you can, as per this thread on the VMWare discussion boards about this issue, assuming:

  1. The file is a sparse disk image, and not pre-allocated.
  2. The VM does not have snapshots.

In short:

Erase free space on the guest OS’s disk from within the guest OS using Disk Utility, then shrink the guest OS’s disk from the host OS using vmware-vdiskmanager at the command line.

In long:

In the guest OS:

  1. Open Disk Utility.
  2. Select the guest OS’s partition.
  3. Go to the “Erase” tab.
  4. Click on the “Erase Free Space” button.
  5. Make sure “Zero Out Deleted Files” is selected, and erase the free space.
  6. Once it’s finished, close Disk Utility, and shut down the guest OS.

In the host OS:

  1. Open Terminal, and type /Library/Application Support/VMware Fusion/vmware-vdiskmanager -k, followed by a space, and then the path to your guest OS’s virtual disk file.
  2. Hit return.

The guest OS’s virtual disk file is found within its virtual machine file. E.g. if your virtual machine file is at /Users/you/VM, the path to its virtual disk is /Users/you/VM.vmwarevm/VM.vmdk.

For the record, this shrunk a Snow Leopard VM of mine from 15 GB to 6 GB.

link|improve this answer
feedback

To those whom find themselves concerned with such:

Indeed, it is worthy of notation, that in variants of VMware Fusion, succeeding 3.x, the locale of the aforementioned executable is as follows hereupon:

/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager

It is my hope that you have found this content to be assistive to your cause and stand in appreciation of it's publication.

Joe the Computer Scientist (sorry, I do not do, nor have I ever done plumbing!)

P.S. - If Wile E. Cayote had been a Unix Administrator and not spent his time chasing the Road Runner, perhaps he would have said, "Wile E. Cayote......super user...I rather like the way that rolls out!"

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.