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

Discussions related to using VirtualBox on Linux hosts.

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

Postby tp4mybunghole » 23. Aug 2010, 21:44

The best solution that I have found for this issue can be found at the following link, http://www.attackr.com/resize-an-existing-vdi-virtualbox-image-easily/
tp4mybunghole
 
Posts: 1
Joined: 23. Aug 2010, 21:41
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: W2008R2

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

Postby sembrador » 1. Aug 2011, 15:05

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.
sembrador
 
Posts: 1
Joined: 1. Aug 2011, 14:03
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Ubuntu

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

Postby falcotec » 3. Aug 2011, 12:24

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!
falcotec
 
Posts: 7
Joined: 5. Jul 2011, 15:54
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows XP SP3, Windows Small Business Server 2003

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

Postby mpack » 3. Aug 2011, 15:06

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".
mpack
Site Moderator
 
Posts: 29689
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

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

Postby falcotec » 4. Aug 2011, 14:55

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.
falcotec
 
Posts: 7
Joined: 5. Jul 2011, 15:54
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows XP SP3, Windows Small Business Server 2003

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

Postby mpack » 4. Aug 2011, 19:32

Ah, ok I missed the mention of gparted when skimming before. It's the snapshots thing then.
mpack
Site Moderator
 
Posts: 29689
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

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

Postby falcotec » 20. Aug 2011, 10:16

It really was the "snapshot thing", removed/merged all of them, resized, "gparted" again and it worked great.
Thanks (again).
falcotec
 
Posts: 7
Joined: 5. Jul 2011, 15:54
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows XP SP3, Windows Small Business Server 2003

Previous

Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: No registered users and 9 guests