Following this tutorial: https://www.serverwatch.com/server-tutorials/using-a-physical-hard-drive-with-a-virtualbox-vm.html
First, I formatted an external hard drive.
I want to mount the 2nd partition of the external hard drive into a VM.
- Create the VM in VirtualBox but don’t attach any hard drive yet.
- Open an Admin command prompt
- `cd C:\Program Files\Oracle\VirtualBox`
- `VBoxManage internalcommands listpartitions -rawdisk \\.\PhysicalDrive2` Where the number ‘2’ comes from the Disk Manager utility and identify the hard drive I want to mount. This command gives me the partition number I need to mount
- `VBoxManage internalcommands createrawvmdk -filename “D:\VMs\Xubuntu-physical-hard-drive\Xubuntu-physical-hard-drive.vmdk” -rawdisk \\.\PhysicalDrive2 -partitions 2`
- In VirtualBox, edit the VM and add an existing hard drive
Note: I also needed to check the option “Use I/O cache from host” when adding the hard drive to the VM