Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
add comment

5 Answers

up vote 7 down vote accepted

You can use VBoxManage.

You can see details here.

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

For ext3 partition you can follow these steps.

share|improve this answer
3  
It would be nice to include the essential parts of the answer here, and provide the link only for future reference. –  slhck Jan 13 '12 at 20:47
    
Yes. I was hoping there was a way through the vbox gui but this does the trick. –  stefgosselin Jan 13 '12 at 21:37
    
Can you actually include the steps in this answer, instead of simply posting a couple of relevant links? The links may become broken at some time in the future, and then the essential information will be gone (if the steps aren't posted here as well.) –  Anderson Green Nov 15 '12 at 0:15
    
Do not open command line "as administrator" because you'll get Code CO_E_SERVER_EXEC_FAILURE (0x80080005) - Server execution failed (extended info not available). Run it as a normal user. –  Michał Powaga May 22 '13 at 21:46
add comment

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

share|improve this answer
    
What is the host OS in this example? Do these steps apply to any host operating system, or just one specific host operating system? –  Anderson Green Nov 15 '12 at 0:18
    
Host was Win7 64-bit. Haven't tried it on other hosts. –  Brian Low Nov 15 '12 at 4:59
    
Works also on Win8 64-bit with an image of Win8 64-bit –  Robar Aug 22 '13 at 14:36
add comment

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
share|improve this answer
add comment

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.

share|improve this answer
add comment

There is an article about this: http://coderjournal.com/2011/07/reducing-the-size-of-a-virtualbox-hard-drive/

Short but sufficient. In short:

  • delete temp files (obvious)
  • defragment (assuming your guest filesystem can be defragmented)
  • use VBoxManage, as other users suggest
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.