I have found the answer on another post but will post it with numbered steps to close out my request for help with this. In VirtualBox 7.0 the partition I am trying to increase is called: /dev/mapper/vgubuntu-root
In the other post it was called something similar, but different. So, although the answer is out there, I hope I am providing a more updated version.
RESIZE .VDI VM HARDDISKS
- Make sure VM is Powered OFF
- Go to 'Tools' within the VM Control Panel, select VM and increase slider to desired storage Gb
- Select VM and go to Settings (can also right click on the VM to access Settings)
- Go to Storage and click the CD (Empty)
- On the right side of the screen, click the CD icon, select 'Choose a disk file...' and locate your Ubuntu_22.04.iso file
If you don't have an Ubuntu 22.04 ISO, download it here: https://ubuntu.com/download/desktop
- Make sure the Controller:IDE (the one with the Ubuntu.iso) is above Controller:SATA (this boots the .iso instead of the .vdi)
- Boot VM with Ubuntu 22.04.iso, and select 'Try Ubuntu'
- Open Terminal, type: gparted
- Increase dev/mapper/vgubuntu-root to max (the Gb you set in Step #3)
- Power OFF VM
- Reboot without .iso (normal reboot)
- Open Terminal, type: sudo lvresize -L xx.xxG /dev/mapper/vgubuntu-root
NOTE: xx.xx are placeholders for numbers
- If states: Insufficient free space: xxxx extents needed, but only xxx available, lower number in xx.xxG - Start with number lower than the increased Gb number (for example, if you increased the Gb to 50gb, start with 40.00gb in the command)
- Next, type: sudo resize2fs /dev/mapper/vgubuntu-root 100000000
- Prompt will indicate that number is too large and will give you the max number. If it doesn't add a zero or two.
- Re-paste command with new max. number: sudo resize2fs /dev/mapper/vgubuntu-root 15073280 (<-- in my case increasing my .vdi to 60gb it was this number)
- Verify dev/mapper/vgubuntu-root has been increased. In terminal, type: df -h
- View results: dev/mapper/vgubuntu-root -- 57G (size) -- 14G (used) -- 41G (available) ...
You can start if [df -h] in terminal before Step #11 to verify the .vdi size before increasing it.
Done.