How do I resize a partition running Ubuntu in a VM?

I'm rephrasing the question here because there are others that answer the question of how to resize an active partition, but perhaps this will help someone running a VM.

I set up a 20.04 VM under Fusion and started compiling something, which failed because it ran out of disk space.

So after resizing the virtual storage of the VM in Fusion, I restarted Ubuntu and went into Disks to expand the root volume into the new free space. But after I was prompted to authenticate for the resize, nothing happened. No error message, but no progress or change either.

So the question is how to resize the active partition in a VM.

enter image description here


I’m not familiar with Fusion but I’d expect it to be similar to Virtualbox where you would:

  1. Add a virtual CD-ROM drive to the machine.
  2. Download the GParted iso.
  3. Insert the GParted iso into the virtual CD-ROM.
  4. Boot the VM telling it to boot from the virtual CD-ROM rather than the hard drive.
  5. Use GParted to resize your partitions

As I said in my comment, you will need to do this inside of the hypervisor program on which the VM runs. Below, I have included instructions on how to do it in fusion (taken from the VMWare website):

  • Open Fusion.
  • Select the virtual machine in the Virtual Machine Library.
  • Go to Virtual Machine > Settings....
  • Click Hard Disk(s).
  • Use the slider to adjust the size of the virtual disk.
  • Click Apply.