I have a VirtualBox guest OS drive formatted as HFS+ which is 20GB. I resized it's hard disk virtual media vdi file to 40GB and now want to reduce it to 32GB.
The extra 20GB I added to the vdi with the Virtual Media Manager has never been used by the guest OS and is not visible to it.
I've tried using:
VBoxManage modifymedium disk myhd.vdi --compact
...which completes successfully but does not shrink the vdi and...
VBoxManage modifyhd myhd.vdi --resize 32768
which produces the error...
0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage.exe: error: Failed to resize medium
VBoxManage.exe: error: Shrinking is not yet supported for medium 'C:\Users\me\VirtualBox VMs\Snow Leopard\Snow Leopard.vdi'
VBoxManage.exe: error: Details: code VBOX_E_NOT_SUPPORTED (0x80bb0009), component MediumWrap, interface IMedium
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleModifyMedium(struct HandlerArg *)" at line 768 of file VBoxManageDisk.cpp
Is there any way to shrink a VirtualBox vdi with a (OSX) HFS+ guest or migrate the guest hard disk to a new 20GB or 32GB vdi?