Shareable disks with VirtualBox

Sometimes one wants to have shareable disks, i.e. the disk can be attached to more than one virtual machine:

$ VBoxManage createhd --filename vm0/disk2.vdi --size 1024 --variant fixed

$ VBoxManage storageattach vm0 --storagectl "SATA Controller" \
                      --port 2 --device 0 --type hdd --medium vm0/disk2.vdi

$ VBoxManage modifyhd vm0/disk2.vdi --type shareable

$ VBoxManage storageattach vm1 --storagectl "SATA Controller" \
                      --port 2 --device 0 --type hdd --medium vm0/disk2.vdi
Note that we're first attaching the newly created disk to a VM before marking it sharable, because the modifyhd command does only work for registered disks. Otherwise modifyhd would bail with:
$ VBoxManage modifyhd vm0/disk2.vdi --type shareable
VBoxManage: error: Could not find an open hard disk with location '../vm0/disk2.vdi'
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), 
component VirtualBox, interface IVirtualBox, callee nsISupports
Context: "FindMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, 
pMedium.asOutParam())" at line 174 of file VBoxManageDisk.cpp