How to resize a VirtualBox .vmdk file on MacOS

I got issue hard drive full size when setup development env on VirtualBox. In this case, solution is extend VirtualBox disk image (.vmdk, .vdi). Follow baby step below will help resolve this issue.

https://www.virtualbox.org

Step 1 — Clone the .vmdk image to .vdi
In VirtualBox own directory

$ vboxmanage clonehd “centosdisk.vmdk” “clonecentosdisk.vdi” —-format vdi

Step 2 — Resize the new .vdi image (12288MB =12GB)

Resize from 8GB to 12GB

$ vboxmanage modifyhd “clonecentosdisk.vdi” --resize 12288

Step 3 — Switch back to image .vmdk

This step is optional, you can use .vdi, just update setting storage.

$ vboxmanage clonehd “clonecentosdisk.vdi” “resizedcentosdisk.vmdk” --format vmdk

Hope that helpful. Happy coding!