Mount an SD Card in VirtualBox

Or any drive like USB pendrive, SSD or HDD on macOS / OS X host.

Type mount in terminal to find out the SD card device name.

Find out SD Card device name in terminal

Unmount the partition with Disk Utility.

Unmount Sd Card on Mac

Create a VirtualBox vmdk file that points to the SD card.
sudo VBoxManage internalcommands createrawvmdk -filename ./sd-card.vmdk -rawdisk /dev/disk2

Set permissions on vmdk file and on the device.
sudo chmod 777 ./sd-card.vmdk
sudo chmod 777 /dev/disk2

Unmount the partition with Disk Utility.

Add a SATA device in the virtual machine Storage configuration.

Add SATA device in VirtualBox

Start the Virtual Machine.

Actually I have installed Raspbian headless to an SD card this way.