I need to test out my Web designs in both Mac and Windows and so run Windows 7 and Windows 8 in virtual machines through VMWare Fusion. Great. Except it’s eating up my disk space. Is there some way to limit how big the virtual machines get?
VMWare Fusion and similar programs use interesting algorithms so that you can ask for a 20GB virtual hard drive for the guest operating system and yet it only takes up 5-10GB of space on your actual hard disk. There are various things happening behind the scenes, but basically it’s smart enough to not allocate actual physical disk space for the free space, even though VMWare Fusion reports to the guest OS itself that the space is all available. Most of the time that’s not a problem and it just performs its trick behind the scenes without you ever having to worry about it, actually using less disk space than you’d think.
Occasionally, though, things get upside-down and the virtual disk space image can end up being bigger than the disk you’re mapping, which is really weird. In other words, you might have set up Fusion to run Windows 7 on a 20GB virtual disk just to find out that the file allocated on the Mac side for the disk is more than 20GB in size, even quite a bit more.
It’s not too difficult to remedy this – and remember most of the space used is empty and unused – but you do need to shut down the guest operating system before you proceed, so as a first step launch VMWare Fusion and choose “Shut Down” from the Windows OS. Once it’s powered down you’ll still be running Fusion, you just won’t have a running Windows system.
I’ll go through the same steps, and as you can see here, my 25GB virtual hard disk for Windows 8 is eating up more than the requested size. That’s not good:
To fix the problem, go into Fusion and bring up the “Virtual Machine Library”.
It’ll show a list of virtual machines and when you pick one, you’ll see a bad along the bottom that indicates how the disk space associated with that particular machine is allocated:
You can see that the program calculates that there’s a huge 12.7GB of reclaimable (unused) disk space.
To do so (remembering that you have to shut down the guest OS first) click on “Clean Up Recommended” on the lower right.
It brings up this control setting in the program:
If you’re guessing that you want to click on “Clean Up Virtual Machine” you’re exactly right.
Click on it and the program will start crunching away:
This process can take a few seconds or as long as a few minutes. Be patient.
Eventually it’s done and you’ll see a new virtual machine window with updating disk allocation information:
and sure enough, if you go out to the Mac OS X Finder, a “Get Info” reveals that indeed the virtual machine is considerably smaller than when we started:
Sweet. So that’s a 25GB virtual machine that’s only taking up 13.15GB of space on my Mac system. Sparse disk allocation for the win!