Pass Raw Physical disks on a windows host to a linux virtualbox



With the VM shut down, and all managers and services like VBoxVmService stopped:

Optional when disk numbers have changed: Delete the existing TINY vmdk files with the same exact names you will be re creating from the file system and inside the .vbox file

Open power shell prompt as admin then run the following:

cd 'C:\Program Files\Oracle\VirtualBox\'
.\VBoxManage internalcommands createrawvmdk -filename "C:\0.vmdk" -rawdisk \\.\PhysicalDrive0
.\VBoxManage internalcommands createrawvmdk -filename "C:\1.vmdk" -rawdisk \\.\PhysicalDrive1
.\VBoxManage internalcommands createrawvmdk -filename "C:\2.vmdk" -rawdisk \\.\PhysicalDrive2
.\VBoxManage internalcommands createrawvmdk -filename "C:\3.vmdk" -rawdisk \\.\PhysicalDrive3
.\VBoxManage internalcommands createrawvmdk -filename "C:\4.vmdk" -rawdisk \\.\PhysicalDrive4
..... How ever many you have

Add the disks back in to the VM definition using the GUI.

Be sure you do not use any disks that windows might try to use.

Test the VM, boot, run, power off

restart the services like VBoxVmService


Thanks

No comments: