Part of the instructions for setting up Virtual Box to boot from your Bootcamp drive on Mac OS X walk you through setting up a permanent approach to unmounting your Bootcamp drive. I didn’t follow those instructions, instead created a script that I can use to run manually to unmount and open the permissions when needed, i.e. when I want to boot from VirtualBox:
diskutil umount /Volumes/BOOTCAMP sudo chmod 777 /dev/disk0s4
The instructions on some sites also assume that your Bootcamp drive is partition disk0s3, but on my machine it’s disk0s4. If you run ‘diskutil list’ you can get a list of your partitions to work out which is your Bootcamp partition.