Update: There’s another method here that skips the use of clonezilla and does everything with gparted: Re-sizing a VirtualBox Virtual Disk Image File
VirtualBox doesn’t currently offer any tools for directly resizing a hard drive image (VDI). This method, using only free software tools, allows you to perform that task without any risk of losing the data you currently have on the image.
First, we’ll create a new, larger VDI, then we’ll use Clonezilla to clone our old one to the new one, then we’ll use Parted Magic to resize our partitions to fill our new, larger VDI, and finally will remove our old VDI from our machine image. This method assumes a linux client, but it should be equally applicable to a windows client (probably easier, given that there is no swap partition).
Download clonezilla live (stable release): http://clonezilla.org/downloads.php
Right click on the machine, settings
Storage, click on the SATA Controller, Add Hard Disk
Create new (larger) VDI disk image
You should now see two VDI images listed under SATA controller
Click on the CD drive, underneath the IDE controller
Under attributes, click the CD icon, choose a virtual CD/DVD disk file…
choose the clonezilla live iso image you downloaded
Click OK
Boot the machine
Start Clonezilla live
- English
- Select keymap from full list
- pc / qwerty / British / Standard / Standard
- Start Clonezilla
- device-device
- Expert
- local disk to local disk clone
- sda as source
- sdb as target
- check the -r and -q1 options. -q1 is required because the faster methods fail in virtualbox for some reason. Slower, but works. ![]()
- Use partition table from source disk
- Enter to continue
- yes, we’re sure we want to continue
- yes, again, we’re sure
- yes, clone the bootloader
- yes, we’re sure!
- once it completes, 0 to power off
- Enter
Download Parted Magic: http://partedmagic.com/doku.php?id=start
Go into settings of the machine again. Change the sata ports around so that the new drive is on SATA Port 0 and the old one on SATA Port 1. We can remove the old one once we’re sure the new one works.
Click on the CD drive, underneath the IDE controller
Under attributes, click the CD icon, choose a virtual CD/DVD disk file…
choose the pmagic iso image
OK
Start the machine
- Boot with default settings
- Button bottom left -> System Tools -> Parition editor
- Resize the extended partion to take up all remaining space (right click -> resize/move)
- Then do the Resize/move on /dev/sda5 (swap). Change the free space following to 0 (this moves it to the end). Click OK on the warning dialogue.
- Resize the extended partition down to maximise the free space preceding it. OK on the warning message.
- Resize /dev/sda1 to use up all the free space.
- Click the Apply button.
- Click Apply to continue.
- Click close when it’s done.
- Bottom left button -> logout -> shut down
Settings of the machine again
Remove the iso image from the CD drive, then click OK.
Start the machine. If it boots OK (did for me), we can shut it down and remove and delete the old VDI hard disk image.





