Resize a Virtual Box Linux Guest Drive
I have a Ubuntu VM that i use as a central Python Server to automate some of my network tasks, over time my scripts consumed all of the 10Gb of space i gave the box when i built it....So
Power down the VM, open settings, goto Storage and Remove attachement;

Open a command prompt as Administrator and run the following commands;
Convert the disk to VDI;
c:\Program Files\Oracle\VirtualBox>VBoxManage.exe clonehd "C:\Users\warrens\VirtualBox VMs\Ubuntu_17_1\22082018-Ubuntu-disk001.vmdk" "C:\Users\warrens\VirtualBox VMs\Ubuntu_17_1\cloned.vdi" --format vdi
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone medium created in format 'vdi'. UUID: 025559f7-2e84-4f39-a3f2-7fd9b0cefb88
Resize the VDI Disk;
c:\Program Files\Oracle\VirtualBox>VBoxManage.exe modifyhd "C:\Users\warrens\VirtualBox VMs\Ubuntu_17_1\cloned.vdi" --resize 40999
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Convert the disk back to VMDK;
c:\Program Files\Oracle\VirtualBox>VBoxManage.exe clonehd "C:\Users\warrens\VirtualBox VMs\Ubuntu_17_1\cloned.vdi" "C:\Users\warrens\VirtualBox VMs\Ubuntu_17_1\resized.vmdk" --format vmdk
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone medium created in format 'vmdk'. UUID: b62c5cd0-9dca-48bc-a473-2b369d0e2cc2
Now reattach the converted and resized VMDK to the VM
now spin up the VM, install gparted if its not already installed;
sudo apt-get install gparted
then expand the disk from gparted......Done!