I am running Ubuntu 24.04 on a Virtual Machine via Virtualbox. If you see the first screenshot I have increased the size of the VM BUT does not recognise the extra space. The second screenshot shows GParted. The partition seems to include the extra space.
The GParted in your screenshot appears to be running from the system stored on the disk. This is not safe for modifying the partitions.
If you boot the VM into the Ubuntu live CD environment, and run GParted in the live CD environment (and making sure none of the virtual hard disk’s partitions are mounted, i.e. no key icon in GParted), does GParted then give you the option to expand your virtual hard disk’s partition table to fill the entire virtual disk’s capacity?
Do I need to run GParted on the host system? When I try to resize it states that the partition IS mounted. Is there a way to unmount it? How to I run Ubuntu in Live CD environment?
Looking at your screenshot of VirtualBox, your VM shows an Optical Drive under “Storage”. Click where it says “[Optical Drive] Empty” and choose the Ubuntu ISO that you used to install Ubuntu in the VM.
You may need to go into VM settings and move “Optical” above “Hard Disk” in the boot order. (Note that having “Optical” above “Hard Disk” in the boot order does not have any effect when there are no disks in any of the VM’s optical drives, so it’s safe to leave this change in place. I always ran all of my VMs like that when I was using VirtualBox.)
Next, boot the VM, and it should boot from the ISO instead of the VM’s disk. It should offer you options including to “Try or install Ubuntu” (selected by default): pick that one. Then you should get options to “Try Ubuntu” or “Install Ubuntu”: select “Try Ubuntu” and it should take you to the Ubuntu live CD environment.
It shouldn’t, since you’re not going to specifically request that. Regardless, it would still be wise to shut down your VM and back it up (or snapshot it) before proceeding.
How did you try to change the boot order settings? The image you posted shows Hard Disk highlighted so you would need to click the down arrow to the right to move Hard Disk down or highlight Optical and click the up arrow.