How to extend filesystem partition on Ubuntu VM?

From Ubuntu (in VM) Install gparted by executing sudo apt-get install gparted in Terminal.

Open gparted either from terminal or from dash. Then extend you disk, maybe you may have to move your extended partition at the end of disk.


You do not need a live CD for this to work. I'm basically summarizing the other answers given here:

  1. From Ubuntu (in VM) install gparted by executing sudo apt-get install gparted in terminal
  2. Open sudo gparted from terminal
  3. Rightclick on the swap partition, click "swapoff"
  4. Delete swap partition
  5. Extend your data partition, but leave enough space to create a new swap partition
  6. Recreate swap partition with about the same size as before, select linux-swap as file system
  7. Click that green tick in gparted to apply all operations. Then select "swapon" to enable swap again

  1. Download gparted LIVECD iso from here
  2. From your VM Choose the iso file and boot as live CD

    • Add the iso into your cd-rom drive from the GuestVM settings

    or

    • Set to boot from the CDROM in BIOS (F2 when you start your VM)
  3. Once tha gparted Live Cd runs you can use gparted now
  4. Choose the partition to resize and choose the new size and then apply
  5. When end reboot and be sure to remove the iso file attached to the VM CD ROM, and boot to your Ubuntu.

enter image description here