Creating a shared disk for Oracle VirtualBox


Have 2 working VMs (e.g. culbor1 and culbor2)

We are using the VBoxManage-command to create and attach the shared hard disk.
First we need a place to save the new disk:

mkdir -p /u01/VirtualBox/shared_disks
cd /u01/VirtualBox/shared_disks

Create the hard disk:

VBoxManage createhd --filename shared_disk.vdi --size 5120 --format VDI --variant fixed

Modify the hard disk to be shareable:

VBoxManage modifyhd shared_disk.vdi --type shareable

Attach the new disk to the VMs:

VBoxManage storageattach culbor1 --storagectl "SATA" --port 1 --device 0 --type hdd --medium shared_disk.vdi --mtype shareable
VBoxManage storageattach culbor2 --storagectl "SATA" --port 1 --device 0 --type hdd --medium shared_disk.vdi --mtype shareable

This is assuming that you only have one hdd other than the shared disk attached to the VM. If you are using more then one hdd, change parameters accordingly.