Debian, VirtualBox

How to resize a virtualbox VDI disk

Backup VDI file

cp "/home/john/VirtualBox VMs/Kali-Linux-2016.2/Kali-Linux-2016.2.vdi" "/home/john/VirtualBox VMs/Kali-Linux-2016.2/Kali-Linux-2016.2.vdi.bak"

Resize the VDI file

VBoxManage modifyhd  --resize


VBoxManage modifyhd "/home/john/VirtualBox VMs/Kali-Linux-2016.2/Kali-Linux-2016.2.vdi" --resize 51200

Resize the System Partition
* Download GParted

* Create a new virtual machine, call it “GParted” with type: “Linux” and Version “Linux 2.6 / 3.x / 4.x (64-bit)”.

* Add 2048MB Ram.

* Choose “Do not add a virtual hard disk”, ignore the warning.

* Pick your “GParted” vm, open “Settings”. Choose “Storage” and add a new CD/DVD device. Browse to the location of your GParted ISO file and select it.

* Add the disk that you wish to resize under “Controller: SATA Controller”.

* Boot GParted Virtual Machine.

* Choose Gparted Live CD default settings.

* Resize your partition.

* Press “Apply”.

* Shut down GParted Live CD Virtual Machine.

* Boot your original Virtual Machine.