Migrate a virtualbox VM to a larger virtual disk

Use the following command:

VBoxManage modifyhd /path/to/<disk>.vdi --resize <size in megabytes>

e.g.:

VBoxManage modifyhd /home/me/VMs/Win7x86.vdi --resize 32000

In case you have snapshots you have to merge them first. The disk will be resized but the Operating System won’t see it yet. You need to expand it within the Guest OS.

In Windows you can go to “Computer Management - Storage - Disk Management” and extend your disk. On Linux, you need to boot from a live distribution and extend it with a tool like gparted.

(Post moved from nxadm.wordpress.com.)