Running an OS from raw HDD in VBox

How to run another OS in Virtual Box directly from an HDD

Having attached the HDD you want to use, execute this command to list the available drives in your system:

wmic diskdrive list brief

You get output like this:

Caption                        DeviceID               Model
  Partitions  Size
PLEXTOR PX-128M7VC ATA Device  \\\\.\\PHYSICALDRIVE0  PLEXTOR PX-128M7VC ATA Device
  1           128034708480
ST500DM005 HD502HJ ATA Device  \\\\.\\PHYSICALDRIVE1  ST500DM005 HD502HJ ATA Device
  2           500105249280

Identify the disk needed and run

VBoxManage internalcommands createrawvmdk -filename c:\HD.vmdk -rawdisk \\.\PHYSICALDRIVE1

with the proper DeviceID.

Create a new VM (more conveniently in the GUI). Lets say your VM is named LinuxBox and it has a SATA disk controller named “SATA Controller”. Then run the command like this:

VBoxManage storageattach LinuxBox --storagectl "SATA Controller"
      --port 0 --device 0 --type hdd --medium c:\HD.vmdk

Or you can attach the drive in the GUI under Settings / Storage with the button to the right of the combo box with ports, selecting “Choose Virtual Hard Disk File…".

After that you should be able to run the system directly from that HDD.