How To Resize a Virtual Machine’s Disk in VirtualBox

If you need to resize a Virtual Machine’s Disk in VirtualBox, you can do it with one command line.

In this example I will go to resize a 20GB virtual disk to a 40GB virtual disk.

First, you have to stop the virtual machine (not suspend).

Resize a Virtual Machine Disk in VirtualBox-01

Then you have to access to the folder where VirtualBox is installed. In my server is

$ c:\Program Files\Oracle\VirtualBox

Then you have to execute the “VBloxManage” command, with the next parameters:

  • modifyhd” and the VDI file path.
  • — resize” and the new size, in MB (1GB = 1024MB).
 c:\Program Files\Oracle\VirtualBox> VBoxManage.exe modifyhd "C:\Users\Administrad
 or\VirtualBox VMs\Debian_Linux_Desarrollo\Debian_Linux_Desarrollo.vdi" --resize

Resize a Virtual Machine Disk in VirtualBox-02

Once the command has finished, you can start the virtual machine with the new hard drive size.

Resize a Virtual Machine Disk in VirtualBox-03

Now you have to resize the partition size in the VM. You can see how to make it in the post “Increase an ext4 partition with Gparted“.


Leave a Reply

Your email address will not be published. Required fields are marked *