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

how to reclaim unused space from a win7 vmdk in mac osx

$
0
0

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:

  1. Your Win7 VM running on your Mac Fusion (I use 5.0.2).
  2. Admin priviledges on both Host and Guest (Mac and Win)
  3. Internet connection

 

What you do:

  1. 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.
    1. In Win7 VM, go to Control Panel->System->Admin Tools->"Create and Format Partitions"
    2. Right-click (or Ctrl+Click with a Mac mouse) on your main partition, select Shrink
    3. After analyzing, it'll let you know how much it can shrink.  Probably not enough, due to some "unmovable file"
    4. 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"
    5. Sort the list by time, and open the latest one.  It will tell you which file is blocking the Shrink
    6. Google it and take care of it (every such unmovable file can be deleted or moved)
    7. Go back to Step 2., until you are satisfied with the shrinkage.
    8. 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.
  2. 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
    1. If you don't have enough disk space on the Mac, skip to section 3.
    2. In Mac VM Fusion, open menu File->Migrate your PC
    3. Follow the instructions - they are very simple
    4. When you finish, you'll have a new VM called "Windows 7 x64" (or x32)
    5. Pause your current running-from-the-external-drive Win7 VM, and Run your slim new Win7 VM.
    6. 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)
    7. Check out that everything is proper and good.
    8. Kill the Paused fat Win7 VM, and delete it from the external drive (or keep it for a while as backup).
    9. If you turned off features you need (like Windows search, restore points, etc.) - You can re-activate them now.
    10. Done.
  3. What if my Mac disk is choked up with not enough space to play with?
    1. Get an external USB drive (preferable with USB3 or Thunderbolt - this is going to be a slow process)
    2. Turn off your Win7 VM
    3. Go to Terminal
    4. Locate your Win7 VMDK (probably /Users/[username]/Virtual Machines/[WIN7HOSTNAME].vmdk
    5. Do alias vmware-vdiskmanager='/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager' (if you haven't yet)
    6. Copy your vmdk into the external drive as follows:
      1. If the drive has a FAT32 file system (files can't be larger than 2GB)
        1. mkdir /Volumes/[external drive name]/VMDKStore
        2. vmware-vdiskmanager -r [the win7 vmdk pathname] -t 1 /Volumes/[external drive name]/VMDKStore/aCopyOfMyVMDK.vmdk
      2. If the drive supports large files
        1. mkdir /Volumes/[external drive name]/VMDKStore
        2. vmware-vdiskmanager -r [the win7 vmdk pathname] -t 0 /Volumes/[external drive name]/VMDKStore/aCopyOfMyVMDK.vmdk
    7. Wait a long time for the copy to be over
    8. Check that your copy works just as good as the original - because you are going to delete the original:
      1. Go to Fusion on the Mac
      2. Go to Settings of your currently-shut-down Win7 VM
      3. Go to the hard disk, open the Advanced section and Remove it KEEPING THE FILE
      4. Go back to Settings and click the "Add Device" button
      5. Add an Existing Hard Disk, selecting the vmdk on the external drive, and make sure to select the SHARE THIS DRIVE radio button
      6. Start the VM, check that everything is ok (it will run slower than the local SSD drive)
      7. When you are satisfied, you can go and Delete the VMDK from your Mac local drive
      8. Now you can just go to Step 2 above and Migrate your PC
Hope this got you running.
Cheers.

Viewing all articles
Browse latest Browse all 38932

Trending Articles



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