Virtual Box Bootcamp Windows 8.1

So after a bit of trial and error with some help from some forums.. I was able to get my windows 8.1 bootcamp installed system load up in my virtual box. This makes it possible to test items quickly without having to boot over completely.. but leaves a nice option to dual boot if you need to get more performance out of your system and 8.1.

My steps were pretty straightfoward and were based somewhat off of the Windows 7 tutorial found here:
http://luckyviplav.blogspot.com/2011/06/windows-7-on-mac-os-x-through-virtual.html

I got it working like so:

#1. I showed this in my list of drives
$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.3 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_CoreStorage 438.3 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
4: Microsoft Basic Data BOOTCAMP 61.1 GB disk0s4

#2. I made sure the bootcamp drive was unmounted.. I just used 'Disk Utility' for that.

#3. Make sure permissions are open for the EFI and Bootcamp drives
sudo chmod 777 /dev/disk0s1
sudo chmod 777 /dev/disk0s4

#4. Create vmdk in directory where you want to access it
sudo VBoxManage internalcommands createrawvmdk -rawdisk /dev/disk0 -filename win8raw.vmdk -partitions 1,4

#5. Create a new windows 8.1 entry in virtual box and point to the newly created vmdk as the existing hard drive to use and start it up.

The windows 7 howto shows a bit more how to get the bootcamp drive to never be mounted when the system starts up.. now whether that is desired or not is purely up to the user.. I find it useful to leave it mounted and run an applescript to start up my windows 8.1 machine in virtual box.. my applescript looks like this:

///////////////
--Make the BOOTCAMP Partition writeable

do shell script "sudo chmod 777 /dev/disk0s1" with administrator privileges
do shell script "sudo chmod 777 /dev/disk0s4" with administrator privileges

tell application "Finder"

if exists "BOOTCAMP" then

--Eject BOOTCAMP Volume if Mounted

do shell script "umount -f /Volumes/Bootcamp" with administrator privileges

end if

end tell

--Launch Virtual Machine

do shell script "vboxmanage startvm 'Windows 8.1'"
////////////////

Ensure the command to start the vm matches the name you gave the vm when you set it up in the virtual box wizzard.