# make the sparsebundle
hdiutil create \
-size <size-in-megabytes>m \
-layout GPTSPUD \\
-type SPARSEBUNDLE \
-fs JHFS+ \
-volname "<volume-name>" \
-nospotlight \
"<path-to>/<disk-image>.sparsebundle"
# mount the disk image
hdiutil attach \
"<path-to-disk-image>.sparsebundle" \
-nomount
# noting the resulting device number
# create a pointer for VirtualBox to use
/Applications/VirtualBox.app/Contents/MacOS/VBoxManage \
internalcommands \
createrawvmdk \
-filename <path-to-disk-image>.vmdk \
-rawdisk \
/dev/disk<#>