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.

This question already has an answer here:

I've installed Windows 7 in Oracle VirtualBox. I would like to increase the hard disk size of the virtual disk image so that I can install Adobe Illustrator (Ai).

Can I simply stretch the disk size of my disk image with some tool without having to reinstall windows from scratch?

Thanks.

share|improve this question

marked as duplicate by slhck May 27 '13 at 11:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
Did you start to type "increase virtual box ..." into the search box of your browser and then follow all the suggested search phrases? You're supposed to do some research yourself. What did you try? –  Jan Doggen May 27 '13 at 10:31

1 Answer 1

Yes you can. (But before you do, make sure to back up your data.)

The exact procedure depends on whether you chose to create a dynamic or fixed size disk when you created the virtual drive, on your host OS, and on your version of VirtualBox.

If you created a dynamical disk and you're running version 4.0 (or higher), you need to do the following:

  1. Resize the dynamical drive using the command line tool:

    $ VBoxManage modifyhd path/to/drive_file.vdi --resize NewSizeInMegaBytes
    

    (Ubuntu host) or

    C:\> "C:\Path to VirtualBox\VBoxManage.exe" modifyhd "C:\path\to\drive.vdi --resize NewSizeInMegaBytes
    

    (Windows host).

  2. Expand the partition on the larger disk, for exampel by booting your virtual machine from an Ubuntu LiveCD, and using gparted. To boot from a LiveCD, just set the virtual machine to use the ISO file as a CD drive, and boot from that drive.

If you created a fixed-size disk and/or you're running an older version of VirtualBox, you need to clone the drive first, before you can do the above:

  1. Create a new virtual drive, which is the size you want after the resize.
  2. Clone the old one to the new one, using a command like the following:

    $ VBoxManage clonehd path/to/old.vdi path/to/new.vdi --existing
    

    (Ubuntu host - the change for a Windows host is analogous to above).

  3. Replace the old drive with the new one in the settings for your virtual drive.

  4. Expand the partition on the new drive, as in step 2. above.

  5. Delete the old drive file and the backups when you know everything is working, to free up disk space.


Note: I haven't tested any of this myself - I'm just re-iterating what is already written in the guide I linked to, for completeness in case of link rot. The guide there is more complete, with thorough descriptions and screenshots for all the steps.

share|improve this answer

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