Replace "vboxmanage modifyhd" with "vboxmanage clonehd"
- Create a new virtual disk VDI (With the size you want to expand). Example: Old.vdi had 50gb. New.vdi create it with 100GB
VBoxManage createhd --filename /path/New.vdi --size 100000
- Clone it with the following command:
vboxmanage clonehd /path/Old.vdi /path/New.vdi --existing
Note: Both VDI should not be on the same path
- Run New.vdi and go to Windows Computer Management and Extend the disk space (assign the empty space). If you do not want to do it manually, you can use any free partitioning application, such as AOMEI Partition Assistant Standard, GParted and many others.