Page 2 of 2

Re: [Solved] Is there a way to resize the VDI?

Posted: 23. Aug 2010, 21:44
by tp4mybunghole
The best solution that I have found for this issue can be found at the following link, http://www.attackr.com/resize-an-existi ... ge-easily/

Re: [Solved] Is there a way to resize the VDI?

Posted: 1. Aug 2011, 15:05
by sembrador
Hi,

The easy way to resize a vdi file is using VBoxManage.exe, open a terminal (linux) or command prompt (windows), navigate to the folder where the .vdi you want to resize is located,- this should be under ~/VirtualBox VMs or ~/.VirtualBox/HardDisks (linux) or \VirtualBox VMs or \.VirtualBox (windows), and run the following command to resize the .VDI:

VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB

Where YOUR_HARD_DISK.vdi is the VirtualBox hard disk you want to resize and SIZE_IN_MB is the new virtual hard disk size, in megabytes. For example, the following command will resize the VirtualBox hard disk called "vol0.vdi" to 62000 megabytes:

VBoxManage modifyhd vol0.vdi --resize 62000

The process takes just a few seconds and you should now have a resized VirtualBox hard disk.
Finally you have to use gparted to allocated the new hard disk space size of your vdi file.

Re: [Solved] Is there a way to resize the VDI?

Posted: 3. Aug 2011, 12:24
by falcotec
Hi,
what happens to the vdi when using the "vboxmanage modify xxx.vdi -resize 30000" command?
I tried it and it worked.
I started the VM with boot from CD-image of gparted 0907 and it found the hard drive as /dev/sda.
BUT:
The maximum size of the dev/sda (virtual hdd) is still the old value of 20 GB.
Now to you: what to do?
The VM is a Windows 2003 Small Business Server.
The host is Windows 7 Pro 64 Bit SP1.
The VirtualBox version is 4.1.0!

Re: [Solved] Is there a way to resize the VDI?

Posted: 3. Aug 2011, 15:06
by mpack
Resizing the drive does not change the size of partitions already on the drive. You need to download and use the gparted live CD ISO to adjust the partition size(s).

Note that you can't resize the drive this way if you use snapshots, which is another possible reason for seeing no effect after using "VBoxManage modifyhd --resize".

Re: [Solved] Is there a way to resize the VDI?

Posted: 4. Aug 2011, 14:55
by falcotec
Hi mpack,
I did that, this is why I wrote that I started the VM with ISO of gparted 0.9.0.7 (version) an still the gparted did not see 30 but only the actual 20 GB.
OK, there is something with snapshots, I will play around and tell here if I'm successful after merging or so.
The size is different, the Oracle Virtual Box Manager (UI) dies show the size of 30 G which was the size in the command of resize.
So lets play around with snapshots.

Re: [Solved] Is there a way to resize the VDI?

Posted: 4. Aug 2011, 19:32
by mpack
Ah, ok I missed the mention of gparted when skimming before. It's the snapshots thing then.

Re: [Solved] Is there a way to resize the VDI?

Posted: 20. Aug 2011, 10:16
by falcotec
It really was the "snapshot thing", removed/merged all of them, resized, "gparted" again and it worked great.
Thanks (again).