Stuck with a huge VMDK of your old Win7 choking up your precious MacBook SSD diskspace?
Frustrated from not finding any simple how-to-shrink-vmdk-and-reclaim-hidden-space guide?
Read ahead, then.
I recently moved from PC/Win7 to MacBook/OSX 10.8.2.
I used Fusion Workstation on the PC to export to VMDK.
It came out HUGE - The actual size of the physical disk (160GB), even though it was just 20% used.
Since the MacBook has a 256GB SSD, it was crucial for me to reduce the VMDK significantly.
After searching for days and finding mostly irrelevant stuff about VMDKMounter and playing tricks with vmware-vdiskmanager, I was finally successful in reducing the VMDK to 38GB.
What you need:
- Your Win7 VM running on your Mac Fusion (I use 5.0.2).
- Admin priviledges on both Host and Guest (Mac and Win)
- Internet connection
What you do:
- First thing, you need to free up as much space as you can on the Win7 VM and shrink its disk partition to the size you want.
- In Win7 VM, go to Control Panel->System->Admin Tools->"Create and Format Partitions"
- Right-click (or Ctrl+Click with a Mac mouse) on your main partition, select Shrink
- After analyzing, it'll let you know how much it can shrink. Probably not enough, due to some "unmovable file"
- Back in Control Panel->System->Admin->View Event log, open the Windows Logs->Application (on the left-side-bar), then "Filter current log" (right-side-bar), then put "259" where it says "All Event IDs"
- Sort the list by time, and open the latest one. It will tell you which file is blocking the Shrink
- Google it and take care of it (every such unmovable file can be deleted or moved)
- Go back to Step 2., until you are satisfied with the shrinkage.
- Google up tips on how to free more space and do it, e.g. turn off Page file, System restore points, Windows Search, empty recycle bin, disk cleanup, etc.
- When done, use the "Migrate Your PC" feature in the Mac's VM Fusion to get a new image of your PC that's slim
- If you don't have enough disk space on the Mac, skip to section 3.
- In Mac VM Fusion, open menu File->Migrate your PC
- Follow the instructions - they are very simple
- When you finish, you'll have a new VM called "Windows 7 x64" (or x32)
- Pause your current running-from-the-external-drive Win7 VM, and Run your slim new Win7 VM.
- Re-activate the "Shared Folder" on the slim new VM (it will shout some "can't find shared drive" messages on you until you do)
- Check out that everything is proper and good.
- Kill the Paused fat Win7 VM, and delete it from the external drive (or keep it for a while as backup).
- If you turned off features you need (like Windows search, restore points, etc.) - You can re-activate them now.
- Done.
- What if my Mac disk is choked up with not enough space to play with?
- Get an external USB drive (preferable with USB3 or Thunderbolt - this is going to be a slow process)
- Turn off your Win7 VM
- Go to Terminal
- Locate your Win7 VMDK (probably /Users/[username]/Virtual Machines/[WIN7HOSTNAME].vmdk
- Do alias vmware-vdiskmanager='/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager' (if you haven't yet)
- Copy your vmdk into the external drive as follows:
- If the drive has a FAT32 file system (files can't be larger than 2GB)
- mkdir /Volumes/[external drive name]/VMDKStore
- vmware-vdiskmanager -r [the win7 vmdk pathname] -t 1 /Volumes/[external drive name]/VMDKStore/aCopyOfMyVMDK.vmdk
- If the drive supports large files
- mkdir /Volumes/[external drive name]/VMDKStore
- vmware-vdiskmanager -r [the win7 vmdk pathname] -t 0 /Volumes/[external drive name]/VMDKStore/aCopyOfMyVMDK.vmdk
- If the drive has a FAT32 file system (files can't be larger than 2GB)
- Wait a long time for the copy to be over
- Check that your copy works just as good as the original - because you are going to delete the original:
- Go to Fusion on the Mac
- Go to Settings of your currently-shut-down Win7 VM
- Go to the hard disk, open the Advanced section and Remove it KEEPING THE FILE
- Go back to Settings and click the "Add Device" button
- Add an Existing Hard Disk, selecting the vmdk on the external drive, and make sure to select the SHARE THIS DRIVE radio button
- Start the VM, check that everything is ok (it will run slower than the local SSD drive)
- When you are satisfied, you can go and Delete the VMDK from your Mac local drive
- Now you can just go to Step 2 above and Migrate your PC
Hope this got you running.
Cheers.