Today I had the necessity to enlarge the storage capacity of a VirtualBox machine running Windows XP on my laptop. Luckily, VirtualBox 4.0 and higher come with a command line tool which made this task easy. The tool is
VBoxManage and I used the following command:
$ VBoxManage modifyhd /path/to/your/vdi/disk.vdi --resize 30000
Executing this command enlarged the capacity of my virtual disk up to 30 GB. However, the command does not affect the capacity of the partitions in the disk. For this second task I used GParted, a free partition editor. I simply downloaded the ISO image, which I used to boot my virtual machine and then to changed the size of the partition in the virtual disk. That’s all!
For a more detailed description please read this post.