Thursday, 28 April 2011

Virtualbox : Increase size of Virtual Drive (.VDI file)

To resize an existing VDI image, we turn to command line tool VBoxManage once again.
Rather than resizing, we follow a 3 step process -

1) Use Virtualbox to create a new blank drive of the desired size.
2) Copy your existing drive onto the new drive. For me, the command looked like this -

C:\!RD\VirtualBox>"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" clonehd --
existing xppro.vdi newharddisk1.vdi
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: b5e98bc3-80c7-476f-976b-725348c5c
e84

C:\!RD\VirtualBox>

3) Rename the files so that VirtualBox mounts your new bigger drive.


Update : June 2011
Apparently you can now resize directly without creating a copy -
VBoxManage modifyhd YOUR_HARD_DISK.vdi –resize SIZE_IN_MB 


No comments: