Search notes:

VBoxManage modifymedium

VBoxManage modifymedium  [disk|dvd|floppy] <uuid|filename> [options]

Options

--type normal|writethrough|immutable|shareable| readonly|multiattach
--autoreset on|off
--property <name=[value >]
--compact
--resize <megabytes>|--resizebyte <bytes>
--move <path>
--setlocation <path>
--description <description string>

Tryging to enlarge a harddisk

The following command is supposed to enlarge the size of a harddisk to 64 MB. Unfurtunately, this command didn't enlarge anything although it did not throw an error message.
VBoxManage modifymedium "$home/VirtualBox VMS/$vmName/hard-disk.vdi" --resize 64000

Misc

As of VirtualBox 6.1, shrinking of harddisks is not yet supported.

See also

VBoxManage modifyhd and VBoxManage modifyvdi are internally mapped to VBoxManage modifymedium.
VBoxManage

Index