Increasing the size of a Virtual Disk in Oracle VM VirtualBox

Right, so using Oracle VM Virtual Box, you have a virtual disk that is fast running out of space and it needs to be expanded.

Unfortunately, within the VirtualBox GUI, there is no option to allocate more storage space to the virtual drive. So, how can more space be allocated to it?

Easy!

Open a command prompt and navigate to your Oracle Virtual Box installation location. Mine is at:

Within the installation folder there is a cool tool called VBoxManage.exe that offers a command line interface or CLI to manage Virtual Box. More info here: VBoxManage Documentation

If the virtual machine is still running, shut it down before carrying out the next step or else the command will fail as the virtual disk will be in use and no modifications can be made to it.

Anyway, to expand the virtual disk, use the following command:

For example, my test virtual hard disk is located on another partition so to increase its capacity from 8GB to 10GB I issued the following command:

As there are spaces within the file path, I encapsulated them in quotes.

Pretty neat and simple:

Screenshot of result

Now I have a 10GB virtual hard disk. You might need to close and open VirtualBox for it to pick up the increased storage space and if using Windows, run Disk Manager and allocate the additional storage.