Extend an existing virtual disk
NOTE: Before proceeding with the steps below, back up your existing virtual disk by making a copy of it.
To extend an existing virtual disk and increase the disk space available on your virtual machine, follow the steps below:
-
Use the VBoxManage tool on the host system (bundled with VirtualBox) to resize the current disk. Replace the DISK placeholder with the full path to your virtual disk.
Resize the cloned disk to your desired size (here, 36 GB or 36864 MB). Note that approximately 2 GB of the disk will be utilized by Linux system volumes like /dev and /run/shm.
$ VBoxManage modifyhd DISK --resize 36864
-
In the VirtualBox user interface, select the virtual machine and then use the “Settings -> Storage” menu and verify the disk size has been updated
-
Boot the virtual machine. Your virtual disk should have been resized. Check this by running the command below at the console and verifying the size of the /dev/sda1 partition:
$ df -h