How to increase the size of a virtual disk in Virtualbox

Miscalculation in storage needs it’s common.

In Virtualbox you can fix this quick and easy with a command-line tool VBoxManage.

For example if you like to grow the disk to 40GB you just have to run the following command:

VBoxManage modifyhd mylinuxdisk.vdi --resize 40000

Of course you have to expand the hard drive inside the Guest OS. So if you have a virtualized Linux you can accomplish that from Gparted and if you have a Windows OS from the Computer Management