Virtualbox Resize Disk VMDK to VDI

I have a virtual machine Windows XP guest with a VMDK drive. One day it said the C drive was full. In Virtualbox resize disk VMDK to VDI.

As seen here.

Virtualbox Resize Disk and convert VMDK to VDI

Backup your data from the 2nd partition

It is possible that you have an extended partition on your VM. You need to back up this data first.

Run the VM as normal. Go to that partition and backup that data.

Turn off the VM and then run these:

VBoxManage clonehd "source.vmdk" "cloned.vdi" --format vdi

Resize to 50GB

VBoxManage modifyhd "cloned.vdi" --resize 51200

Now download gparted from here.

Modify the settings of the VM. Go to the VM settings then Storage.

Under Controller: IDE

Right click on the “source.vmdk” file and and select “Remove attachment”.

Right click on the “Controller: IDE” and select “Add hard disk”. Locate the “cloned.vdi”.

In attributes set the hard disk to “IDE Primary Master”.


Add the gparted iso as an Optical Drive. Select the “IDE Primary Slave” and check the “Live CD”.


Start the VM and hit F12 or the key to boot devices


Select the CD ROM.

Now the gparted menu will come up.


  • Don’t touch the keymap
  • Which language do you prefer? (leave the default): hit enter
  • Which mode do you prefer? (default 0): hit enter

As seen here. It says to remove the extended partition /dev/sda2.

I read here. To get rid of the swap partition. Which prevents you from expanding the root partition.

This made sense since I had to backup the data from the extended partition and remove it.

After deleting the extended partition.

Right click on the current partition and “Resize”.


Move the arrow all the way to the right.




Apply the changes.



Restart the VM and it should have the disk resized.


When you restart the VM and go to settings you will see that the gparted iso has been ejected.


When you restart the VM. If it is a Windows guest it might ask you to check the consistency of the drive.


Here is proof that the Windows guest C drive was extended from 10GB to 50GB



Gparted doesn’t work

When I ran gparted the first time. It wouldn’t do anything. I hit enter on the 1st option and would go back to the same menu.

What I realized is that the gparted iso file was not complete. The file should be around 269MB. When I downloaded the file it said 10MB.

The VM doesn’t run

When I tried to run the VM to backup the data it would give the blue screen of death.

I previously tried to change the settings on the VM so it would look like this.

With the hard disk as a SATA controller. It just wouldn’t run.

I changed the settings back to what I had before. Having the hard disk as an IDE controller. Then it ran normally.

Related Post

Go to the Previous Directory in Vim I use Vim. Vim is the most productive text editor if you know some vim commands When I open a file and I am done with it. I often want to go...
Export Data From Firebird Database to CSV File Background Some software applications use a database called Firebird. This is an open source database. If the software application is compiled you ca...
Installing Ruby on Ubuntu Installing Ruby on Ubuntu As seen on RVM... Go to the terminal in Ubuntu. Add the public key from RVM $ gpg --keyserver hkp://keys.gnupg.n...
Installing Hipchat on Ubuntu Tested on: Ubuntu 12.04 LTS Thinkpad T400, 2GB RAM Intel Core 2 Duo CPU P8600, 32bit Sources: Official hipchat linux instructions Ask U...

Leave a Reply