After doubling virtual disk size in VirtualBox, fdisk -l still shows old disk size in guest CentOS

OK, turns out that modifyhd --resize does not work as expected if the VM to be resized uses snapshots. A user is supposed to know that in this case modifyhd --resize is to be run against the latest snapshot, not the original VDI file. Something that isn't mentioned in the docs and that doesn't strike me as being obvious either. Two days lost, sigh.


For those looking how to merge snapshots in VirtualBox to allow expanding virtual disk:

Select your snapshot (if you have multiple, start from the most recent snapshot at the bottom, NOT CURRENT STATE) and click Delete. This will MERGE the data into your CURRENT STATE and leave you with your current state with no snapshots (repeat until all snapshots are merged into Current State).

You would then see the unallocated space in the OS and be able to resize, and take a new snapshot afterwards to resume using snapshots.