First resizing does not work if the guest has snapshots (prior to version 4.3.*) nor will it work on Fixed drives.
Secondly when doing anything that could prove as destructive as this should you make a mistake, backup the *.vdi file before you start.
Increasing the drive does not increase the primary partition so this is a two step process.
Step 1: Increase the size of the drive.
Note: if the path has spaces in it you will need to wrap the path in quotes.
- Use the following command to increase the size of the drive:
- Code: Select all Expand viewCollapse view
VBoxManage modifyhd <absolute path to file> --resize <size in MB>- Code: Select all Expand viewCollapse view
VBoxManage modifyhd <absolute path including the name and extension> --resize 20480
Example: I have a 10GB drive that I want to be 20GB the command would be.
Step 2: Extend the primary partition to include the new drive space.
- Download the Gparted live cd or what ever partition manager program you wish and mount it to the guests virtual CD and boot the guest.
From here you can expand the primary partition to use the new space.
You can download the Gparted Live CD from HERE.
Note 1: The only step that VirtualBox is concerned with is step 1. After that you need to seek additional information on the partition manager you wish to use from the vendor of the partition manager.
Note 2: You can not shrink a guest drive with VirtualBox due to the inherent danger of loosing data or making the guest non-bootable.
Note 3: In 4.3.0 the devs fixed a bug which had previously made it impossible to resize a snapshot. Since then it is possible, but not recommended for non-experts.
