Resize An Existing .vdi Virtualbox Image – EASILY!
Resize An Existing .vdi Virtualbox Image – EASILY!
Start off by creating a fresh new drive of the size you’re after using the VirtualBox user interface. Then, locate both the your old, smaller HD and the new, larger one and run the following command:
VBoxManage clonehd --existing oldhd.vdi newhd.vdi
After some progress indicators ahve come and gone your HD should have been cloned to the larger one. You now need to use some software to expand your drive partition into the new space. Vista and W7 have this feature built in to Disk Management, or you could use something like GParted. I have never had luck with the integrated windows disk management tools, so I opted to use a free product called EASEUS PARTITION MASTER – home edition:
This tool was easy to install directly into the new vdi image. Walked through the wizard after clicking on “Resize” – it rebooted itself and resized the partition without a fuss.
The command line entries for running the VirtualBox commands:
gmilby@gmilby-ubuntu64:~/.VirtualBox/HardDisks$ ls
XP_10GIG.vdi xp.vdi
gmilby@gmilby-ubuntu64:~/.VirtualBox/HardDisks$ ls -l
total 6042484
-rw——- 1 gmilby gmilby 61952 2009-11-20 08:15 XP_10GIG.vdi
-rw——- 1 gmilby gmilby 6181380608 2009-11-20 07:56 xp.vdi
gmilby@gmilby-ubuntu64:~/.VirtualBox/HardDisks$ VBoxManage clonehd –existing xp.vdi XP_10GIG.vdi
VirtualBox Command Line Management Interface Version 3.0.12
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%
Clone hard disk created in format ‘VDI’. UUID: 1366bb7f-e827-41de-90ce-763e82309f26
gmilby@gmilby-ubuntu64:~/.VirtualBox/HardDisks$
Resized .vdi image:

If you liked this post, please follow me on Twitter



November 22nd, 2009 at 4:05 pm
Virtualbox is like having an install of windows inside my linux box! http://www.attackr.com/resize-an-existing-vdi-virtualbox-image-easily/
January 17th, 2010 at 7:21 pm
[...] it’s time to resize and play with gparted. A more thorough guide is [...]
February 16th, 2010 at 3:33 am
Worked like a charm!!
Replace the old.vdi image with
VBoxManage storageattach machineB –storagectl “IDE Controller” –port 0 –device 0 –type hdd –medium /path/to/XP_10GIG.vdi
June 10th, 2010 at 10:19 am
So I successfully cloned to a larger .vdi but my in XP my system partition is still the same size, with the extra GBs as unpartitioned space. How do I resize the system (C:) partition?
June 25th, 2010 at 5:22 pm
Perfect! Thanks a lot!
One note when cloning on a Win7 machine the full path to the vdi disks is required i.e.
vboxmanage clonehd –existing e:vboxhdorig.vdi e:vbhoxhd
ew.vdi
June 29th, 2010 at 5:16 am
@Stephen:
The steps are:
1. Go into VirtualBox and create your larger hd.
2. Clone the data on your new hd using:
VBoxManage clonehd –existing oldhd.vdi newhd.vdi
3. Launch VirtualBox and boot into Windows.
4. Go to http://www.partition-tool.com/download.htm and download and download the (free) Home Edition of EASEUS ALL-IN-ONE Partition Manager Software.
5. Run EASEUS product, click on your partition, and choose the option to resize your partition and then choose the Apply button in the bottom left of the window. It will resize the partition in about 10 seconds or so.
6. Done!
August 9th, 2010 at 10:19 am
I would add to John W.’s comment that for Windows Vista and Windows 7 virtual machines, you can skip the EASUS Partition Manager installation and use Windows’ Disk Management Utility to resize your main partition with the unallocated space (Start > Run > diskmgmt.msc).
August 23rd, 2010 at 7:03 pm
This one worked better for me…I’m running Ubuntu Lucid 10.04 64Bit and my Vbox machine was windows 7
http://www.attackr.com/resize-an-existing-vdi-virtualbox-image-easily/