21.12.09 - Expanding VirtualBox dynamic hard disks

How to expand *.vdi dinamic disks

Although we can not expand a virtual dinamic hard drive (*.vdi) directly we can finally expand it through a cloning trick. The steps are:

Create a new virtual hard disk (new device)

First create a new hard disk with the desired storage size (it will be the new hard disk).
VBoxManage createhd –filename my_filename.vdi --size 50000 --remember

Clone the old drive into the new one

In order to have the same data (for example: OS) in the new hard drive we have to clone the previous and size limited one.
VBoxManage clonehd old.vdi new.vdi --existing

Configure the new one as the system default

First remove the last one and then select the new created one as the default.
VBoxManage modifyvm MyVMName --hda none
VBoxManage modifyvm MyVMName --hda new.vdi
Once you have done it, you will need to expand the disc. The details for do this are out of the scope of this article, probably a good way to do it is using a free program like Gparted.
Via: Alittletothewright
More news about:  tools
Tags:  vdi,  expand,  virtual box

Comments

  • Gravatar
    04.03.10 - 01:15  antoine

    How I clone the old drive to the new one?

  • 07.03.10 - 04:26  kiwwito
    Is explained above...
    $ VBoxManage clonehd old.vdi new.vdi --existing
  • Gravatar
    05.04.10 - 08:01  Mark Fu

    $VBoxManage createhd –filename my_filename.vdi --size 50000 --remember I don't understand why add "--remember".

  • 06.04.10 - 05:44  kiwwito
    The '--remember' flag will automatically register the VDI with VirtualBox, so that we can use it later.
  • Gravatar
    22.07.10 - 02:29  Veeredo

    Thanks a lot.. This little trick saved my time. This also taught me about vboxmanage. Truly Appreciate your help.

  • Gravatar
    03.08.10 - 01:28  mbt shoes

    I am the first time on this site and am really enthusiastic about and so many good articles. I think it's just very good.

  • 12.08.10 - 04:35  kiwwito
    Thanks! You're welcome!
  • Gravatar
    03.08.10 - 06:29  registry cleaner

    Great information you write it very clean. I am very lucky to get this tips from you.

Comment