Resize Virtual Box Disk Image

The problem is I'm running out of space on root /. How to fix this?

1. Increase the size of the Virtual Disk Image (VDI)

VBoxManage modifyhd "Ubuntu 12.04.vdi.vdi" --resizebyte 10704973312

2. Use gparted (in the virtual machine) to move the swap to the end of the disk

3. Growing the root partition

Growing root partition is not simple as the root partition is mounted when you are in the OS. Therefore, we need to grow it from other OS. One way of doing it is to use Ubuntu live CD. To do that,

mount an iso of Ubuntu to the VM and boot from CD and choose to try Ubuntu. Now you can grow the root partition.

Phewww.. I heard that I won't be in this mess if I used LVM. However, Dear warned that LVM can make data recovering more complicate.

ref: