**Last edited 03 Jul 13
So, I recently found out what happens when a virtual machine runs out of space. Just resize the hard drive, right? Intuitively, one might think there’d be a button for that… There isn’t.
A little background: I’m on OS X 10.7.5 and VirtualBox 4.2.12
** Disclaimer: ** This could potentially destroy all data on your virtual machine. Back up all your data, and proceed at your own risk.
Shut down the virtual machine you’re trying to resize.
Open an OS X terminal window and navigate to the directory where your virtual machine is. Mine is in “VirtualBox VMs/Ubuntu”.
Clone the virtual hard drive, so you’ll have a backup:
VBoxManage clonehd Your_virtual_machine.vdi clone.vdi
If your vm is in .vmdk format, you need to convert to .vdi:
VBoxManage clonehd Your_virtual_machine.vmdk clone.vdi -format VDI
You should see a progress bar. This will take at least a few minutes.
Resize the hard drive:
VBoxManage modifyhd clone.vdi --resize 20000
(Where the number is the new size in mb.)
Virtualization is an amazing thing. The ability to create customized, clonable, disposable virtual computing environments is endlessly useful. If that interests you, stay tuned for my upcoming post about Vagrant.