When I first installed VirtualBox on Macbook Pro it was with the intention of running a single piece of Windows only software – SportTracks by Zonefive Software, the definitive athletes training log. I have to confess that I’ve struggled in this task and after failing off and on for the last couple of years I finally got it sorted this weekend but only after I fathomed out how to expand the size of the VirtualBox virtual hard drive.
This post won’t explain how to set up and install VirtualBox, I’m assuming that’s done and you have Windows installed as well. I’m using Windows XP.
During the installation of VirtualBox I think it defaults to a virtual harddisk size of 10Mb which seemed plenty for one piece of software but as the years went by the storage was consumed and this weekend I found I could no longer download anything as C:/ was full.
Then I discovered the confusion of expanding the VirtualBox drive. Following some experimentation I found it to be quite simple so I thought I’d jot down my notes to aid complete beginners.
Resizing the VirtualBox Hard Disk using Mac Terminal
Step 1 Open Terminal
This bit stumped me. There are loads of tutorials explaining how to expand a VirtualBox hard drive but they talk about the VBManage Tool which I couldn’t find and show illustrations of code that I didn’t know where to write.
The trick is to stick it all in the Mac Terminal (I think of it as the DOS prompt for old PC users).
To open Terminal navigate to Applications / Utilities and then double click the Terminal.
Mine opens into my user folder which proved to be fine and dandy and required no changing of directories which might have stumped me.
Step 2 Find the Path to Your Virtual Box Hard Drive
This just means opening up VirtualBox, navigating to Settings / Storage then selecting the vdi harddrive and then hovering over its location to reveal all. You can right click and then copy this for ease.
Step 3 Clone your Virtual Hard Drive for Backup
This is a precautionary measure and requires you to enter the following instruction into the Terminal window.
The bit before the $ sign is populated automatically when I open Terminal and I presume yours will open in a similar directory but be specific to your set up. Just type the following (items in bold are to type, items in bracketed italics are instructions):
VBoxManage clonehd (then you need to enter the path to your VirtualBox drive, right click and paste if you’ve already copied it)
/Users/warriorwoman/Library/VirtualBox/HardDisks/WinXP.vdi (then a space and then renter the path to your hard drive but change the name to your cloned version) /Users/warriorwoman/Library/VirtualBox/HardDisks/WinXPcloned.vdi
Should look like this, then hit enter:
Type the following:
VBoxManage modifyhd (then again paste or tpye out the location to your original VirtualBox drive) /Users/warriorwoman/Library/VirtualBox/HardDisks/WinXP.vdi (then type two – - and the size of your desired disk) –40960 (will give me a 40MB drive)
Should look like this, then hit enter:
When you open VirtualBox you should see the expanded disk size. As I’ve already done mine the first screen shot shows my virtual size to be 40Mb. Unfortunately the guest operating system still needs to be updated.
Open Windows and navigate to the Disk Management tool:
Start > My Computer > Admin Tools > Computer Management and then the disk management option.
You should now see your existing 10Mb partition and a new 30Mb Unallocated Partition. What you want to do is right click the existing partition and select the Expand option.
Now before you panic, that didn’t exist for me and I don’t think it works in WinXP but should be ok if you are using a later version of Windows such as Vista. For the WinXP users we have one final hurdle and need to download another disk management tool.
I used Mini Tool Partition Wizard which was free a doddle to use. Load it up, click on C: then right click to select extend. It will ask you if you wish to use the Unallocated area to extend into and then ask you how much. I selected 100% and then applied. The software needed to restart the machine to work but actioned the change during Boot.
No problems – job done.
Thanks to Gubatron who got me most of the way with this task.