Host OS: Mac OS X: Version:10.6.4
Guest OS: Windows 7 X64
Mac app: Virtualbox Mac
6 months ago, I Installed Windows 7 on my Mac using VirtualBox. I made a bad decision when creating the Windows virtual machine (VM). I chose to create VirtualBox VDI file of fixed-size storage of 20GB. It didn't take long before Windows started alerting me there is not enough space for update and paging. This afternoon, When there was only 20MB space left in Windows system, I finally decided to try to expand the disk size of Windows volume. Here is how I changed the Fixed-sized Windows 7 Virtualbox VDI from 20GB to a dynamically expanding VDI file. It it actually much easier than I thought.
Create a new dynamically expending Virtual Disk Image (VDI) using virtualBox Mac
- Open VirtualBox (VB), choose menu File–>Virtual Media Manager
- In "Create New Virtual Disk Wizard" choose "Dynamically expanding storage"
- Choose VDI file location and specify the maximum size for this VDI, If you specify 60GB as the maximum size, then maximum windows disk space will be 60GB. Here, I choose 60GB for the maximum storage size and 'Win7X64.vdi' as the file name.
Use clonehd to 'copy' old VDI to the new VDI file (in my case:Win7X64.vdi) you just created
We need to transfer the Windows system installed on the old VDI file to the new virtual disk image We just created. In order to do this, We need to use the VBoxManage clonehd command. Here is the usage of clonehd. Open Terminal, go the directory where your virtual machine files(old vid files and the new vdi file just created) are and type:
VBoxManage clonehd OldVidFile.vdi newDynamicallyExpandingVidFile.vdi --existing The clone process should begin and you should see output similar to this:
Attach the new dynamically expending VDI and extend the Windows volume
In VB–>Settings–>Storage, attach the new VDI and de-attach the old VDI. You may need to open the Virtual Media Manager. Boot into Windows 7 on the newly attached VDI. Go to Start–>Control Panel–>Administrative Tools–>Computer Management In Computer Management–>Disk Management, choose your system drive(Boot), right click on it and choose "Extend Volume" That's it, Now you should have your Windows virtual machine expanded.
Image Credit: Emmanuel Alanis