For my Crystal development contracting, I utilize Oracle's VirtualBox. It's a great free tool you can check out here. One of the issues I'd encountered was that, like most people, when I configure a VM I'll usually pick the smallest HD size I think I can get away with, somewhere like 40gb or so. However, that goes away quickly once Windows, MSSQL, Crystal, and the application I develop for are all installed, not including the size of customers' data that I restore for testing.
Today, I had a customer deliver a 33gb database for development. Not huge, by most standards, but very large for this application. I was out of space. Creating a secondary drive wasn't an option, as it needs to be restored to SQL. So, I shut the VM down and got into the settings console.
There was no option to change disc size. Crap. What now? New VM? I'm a fixed-bid contractor, so every extra hour I have to waste on this is money out of my pocket. So, using some Google-fu, I found a few people discussing using the VBoxManage command.
Problem for me was that my VM's are stored on a massive drive, not the OS drive where VirtualBox is installed. So, with some modification, here are the steps and commands I used:
- Close your VM.
- Open a command prompt, and cd into the directory where VirtualBox is installed (usually C:\Program Files\Oracle\VirtualBox)
cd C:\"Program Files"\Oracle\VirtualBox
- run the modify hd function with the new size (this needs to be in MB). You must specify the location of the .vdi file you wish to increase. I choose 70GB (70 * 1024mb = 71600MB)
VBoxManage.exe modifyhd G:\VirtualBox\VMName\VDIName.vdi --resize 71600
- VirtualBox will start the process of resizing your hard drive and you will see the a percentage progress bar telling you how far along the process is.
- Now start up your Virtual Windows Machine. Right Click on "Computer" and choose "Manage"
- Click on the "Disk Management" option on the left panel under Storage. You will notice some "unallocated" black space next to your C:\ drive if everything was done correctly.
- Right Click on the C drive and choose "Extend Volume" Follow the Windows wizard and you will have successfully increased the size of your VirtualBox disk.
Mad props to this guy for getting me about 80% of the way.