[GRUB shell]
Using a Physical Hard Drive (raw-disk) with VirtualBox
Using a Physical Hard Drive (raw-disk) with VirtualBox
To directly mount or boot a physical drive on a virtual machine (VM) run the following commands:
sudo fdisk -l
You'll see a listing of disks and partitions. Make note of the desired drive in the format of dev/sda, dev/sda1, etc.
VBoxManage internalcommands createrawvmdk -filename "</path/to/file>.vmdk" -rawdisk /dev/sda
This VMDK will be a very small file that simply points to the physical drive.It's even possible to mount whole disks like /dev/sda or just only single partitions like /dev/sda1.
insmod chain
set root=(hd0,gpt2)
chainloader /efi/Microsoft/Boot/bootmgfw.efi
boot