Author Topic: Resize a VBox vdi/vhd  (Read 12686 times)

Offline rick0612

  • Sr. Member
  • ****
  • Posts: 258
  • The only dumb question is the one not asked.
Resize a VBox vdi/vhd
« on: December 08, 2011, 12:32:15 PM »
This procedure is for Windows but Linux commands are the same except for paths.

Quote from Virtualbox manual:
"This currently works only for expanding the capacity of VDI and VHD formats, and only for the dynamically allocated variants. For example, if you originally created a 10G disk which is now full, you can use the --resize 15360 command to add 5 GByte more space to the virtual disk without having to create a new image and copy all data from within a virtual machine."

!!!Remember to back up the data in your vdi before doing this!!!!!

To resize a *.vdi file in Virtualbox 4.x, run this command in Windows cmd.exe:

VBoxManage modifyhd /path/to/YOUR_HARD_DISK.vdi --resize SIZE_IN_MB


   example: VBoxManage modifyhd "C:/Users/Rick/VirtualBox VMs/LXDE/LXDE.vdi" --resize 20000
   Note the quotes due to spaces in path name.

You may need the full path for VBoxManage.
   e.g. "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"
   
Change path to whatever your file name is.

In this example the resize size is 20GB. (I resized a 10GB LXDE.vdi)

The process takes just a couple of seconds.

Once the resize is complete, you need to resize and/or move the partitions in the vdi. I found that Parted Magic worked great. Just download it then make the .iso the boot drive for your vm.

Hope this helps
« Last Edit: December 08, 2011, 02:47:31 PM by rick0612 »
Packaging rig: Averatec 2573 /12.1" screen /2.0GHZ /3GB RAM /120GB SSD /Minime 2012.12

Daily rig: Alienware X51 /23" monitor /Windows 7 host /KDE VBox client

Offline rubentje1991

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2110
  • Rubenus Parvus MCMXCI
Re: Resize a VBox vdi/vhd
« Reply #1 on: December 08, 2011, 02:24:42 PM »
Thanks for all info....
=> can be useful somewhere in the future (and could already have been useful in the past)