Increase size of VirtualBox image (current state)

I had a Vista image that I foolishly set to 10GB. That was OK until I added the Java Runtime Engine, Eclipse, PyDev, Python, SOFA Statistics, another user for testing purposes (with non-English characters in their user name and home directory) etc. And once I ran the space-greedy system updates, I was out of disk space. A working solution was found in these two posts: Increase/Expand the Size of Windows 7 vdi file on VirtualBox Mac, and Cloning a VM with multiple snapshots?. If you want to copy the whole thing up to a particular snapshot (NB the result with be collapsed into one single VDI, unlike the original), get the hexUUID of the snapshot.

Step 1 – make a new and larger VDI. I did so by making a new virtual machine (testVista) with a new virtual disk image (testVista.vdi). An alternative approach would have been to make the vdi on its own but I couldn’t find a menu item to allow that. It was no great burden doing it as part of making a new virtual machine though.

Step 2 – clone the current state version of the old (and small) vdi. You need to find the hexUUID value of the snapshot you want. See Cloning a VM with multiple snapshots? for details. It gives guidance on how to tell which uuid you need.

The command that worked for me was (the path depends on where you are running the command from and your setup of course):

VBoxManage clonehd 0db42252-9240-4a0a-9393-a7d79778364d "../testVista/testVista.vdi" --existing

Note – testVista was the new VDI I was trying to clone into. It should take a few minutes to run.

Step 3 – disconnect to the old vdi and connect your machine to the larger vdi.

Step 4 – Boot into your system and resize the partition as per Increase/Expand the Size of Windows 7 vdi file on VirtualBox Mac On XP I needed EaseUS Partition. For a Ubuntu guest I downloaded the Gparted iso, added that to storage as a live CD, and booted in. Resized everything and exited. Then unlinked from GParted iso.

Step 5 – Success!

[Update – needed to do this again on another vdi – thus the clarified instructions here]