Strangely enough, this can’t be done via the gui, but requires some shell work. First get an idea which VM disks are around. In my case, the Windows 7 with 20GB was too less, so 30GB should be sufficient.
$ VBoxManage list hdds UUID: e68f5a84-4b45-44c8-b3a8-2116331b5feb Parent UUID: base Format: VMDK Location: /media/kaleidoscope/vms/my_win7/my_win7.vmdk State: locked write Type: normal Usage: my_win7 (UUID: 5ae10ca1-ae2a-4df9-bbdf-27a0c1fbd7b6)
Hmmm, they do not support resizing for vmdk files yet – fsck.
$ VBoxManage modifyhd /media/kaleidoscope/vms/my_win7/my_win7.vmdk --resize 30720 0%... Progress state: VBOX_E_NOT_SUPPORTED VBoxManage: error: Resize hard disk operation for this format is not implemented yet!
Well, then let’s go back to vdi, I’ll use that vm with virtualbox only, I guess.
$ VBoxManage clonehd /media/kaleidoscope/vms/my_win7/my_win7.vmdk /media/kaleidoscope/vms/my_win7/my_win7.vdi --format vdi 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Clone hard disk created in format 'vdi'. UUID: 409c1212-71f9-46bc-a1dd-5946ec7db962
Now the resize works.
$ VBoxManage modifyhd /media/kaleidoscope/vms/my_win7/my_win7.vdi --resize 30720 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Fire the options of your vm in virtualbox, and change the disk to the new one, then boot the Windows and resize the partition in system options.