Resize a VM hard-drive (virtualbox)

Is there a way to resize a VM hard drive? I am using virtualbox and I have a VM that has run out of space, looked into the settings but it seems I may have to create another partition. I thought there might be an easier way, anyone have an idea?

Thanks


Solution 1:

You can use the VBoxManage command.

You can see details here.

Example:

"c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd "C:\Users\busey\VirtualBox VMs\ubuntu10.10\ubuntu10.10.vdi" --resize 20480

After resizing hard disk , you will have to resize partition(s).

For ext3 partition you can follow these steps.

Solution 2:

This worked on a VHD with a bootable image of Win7:

  1. VirtualBox -> Virtual Media Manager -> Copy

  2. C:\Program Files\Oracle\VirtualBox>VBoxManage.exe modifyhd "c:\VirtualMachines\Windows 7 Large.vhd" --resize 2000000

  3. VirtualBox -> VM -> Settings -> release current VHD and mount new VHD

  4. Boot VM into Windows

  5. Use Computer Management -> Disk Manager -> right-click on partition -> Extend

Solution 3:

For a vdi this worked, the host being Windows 7.

c:\Program Files\Oracle\VirtualBox>VBoxManage.exe modifyhd "C:\Users\busey\VirtualBox VMs\ubuntu10.10\ubuntu10.10.vdi" --resize 20480

Solution 4:

CloneVDI can help do this. You can create a clone of an existing VDI and increase the disk size at the same time. Used this without any problems for a couple of years.