Resizing A Fixed Size Virtual Machine Using Virtualbox On Windows

Resizing a Fixed Size Virtual Machine Using Virtualbox on Windows

Although it could be a hindsight or a mistake, you could have a Virtual machine that is almost out of disk space and you feel your only option is to resize it. If this is the case, this lesson will explain how you can do that.

The first step is to clone the fixed disk sized Virtual machine. The code is shown below.
In order to do this, you will need to open up the Command Prompt with administrative priviliges. For example, you may find it at All Programs >Accessories >Command Prompt. Just right click to open as an administrator.

Once you have opened it, you will need to navigate to the folder where the VBoxmanage.exe file is located. In this case, it isn located at 'C:\Program Files\Oracle\VirtualBox'.

 cd C:\Program Files\Oracle\VirtualBox 

The next step is to use the clonehd command to clone a VDI file. The example is shown below and it uses 2 parameters at the end to state the VDI file type and to make it a standard VDI. A standard VDI is dynamic and resizable, unlike the original.

 VBoxManage.exe clonehd "C:\Users\ted\VirtualBox VMs\Ubuntu 14_04 64-bit Clone\Ubuntu 14_04 64-bit Clone-disk1.vdi" "C:\Users\ted\VirtualBox VMs\Ubuntu 14_04 64-bit Clone\Ubuntu 14_04 64-bit Clone-disk2.vdi" --format VDI --variant Standard 

Resizing the Disk Space

The command below can be used to resize the new clone into your desired size. In this case, it was made to be about 10 GB.

 VBoxManage modifyhd "C:\Users\ted\VirtualBox VMs\Ubuntu 14_04 64-bit Clone\Ubuntu 14_04 64-bit Clone-disk2.vdi" --resize 10000 

For more instructions, you can see a previous article about resizing dynamic disks used with Virtualbox.