I had a Windows7 guest machine running on Ubuntu 16.04, recently I’ve ran out space from my primary partition so I executed following command and Tried to extend partition size with Windows Disk Management area but it seems resize didn’t took a effect couldn’t find any unallocated amount with my primary partition.
Command to Resize .VDI
vboxmanage modifyhd "/home/kasun/VirtualBox VMs/windows/windows-disk1.vdi" --resize 200000
Then i look around and found that VirtualBox VMs with snapshots needs resizing snapshot disk (current snapshot) in order take actual effect of it. Alternatively you could clone current state of machine to a new vm then execute above command to resize cloned disk.
Then using gparted or Windows Disk Management (Windows Guest only) tool you could extend your partition size.