- Run virtualbox with admin privilege.
- First we need to find the partition number. For that we need to run the following command.
"c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" internal commands listpartitions -rawdisk "\\.\PhysicalDrive0"
- This will show the list of partitions (We need to run command prompt as administrator also for this to work). For my case
Number Type StartCHS EndCHS Size (MiB) Start (Sect) 1 0x07 0 /32 /33 44 /190/18 350 2048 2 0x07 44 /190/19 1023/254/63 204450 718848 3 0x07 1023/254/63 1023/254/63 66560 419432448 4 0x07 1023/254/63 1023/254/63 205578 555747328
- Now we need to create a .vmdk file that will point to the partition we need. I am going to
attach mine with partition 4.
"c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" internal commands createrawvmdk -filename "E:\VirtualboxVDIs\rawedrive.vmdk" -rawdisk "\\.\PhysicalDrive0" partitions 4 RAW host disk access VMDK file E:\VirtualboxVDIs\rawedrive.vmdk created successfully.
- Bingo :). Now we need to attach the .vmdk file to a guest OS. Need to run VirtualBox Manager with admin privilege also.
- Select the guest OS from virtualbox manager and goto its settings
- Select storage tab and add the vmdk file to the SATA controller.
- Now startup your guest OS and you will find your hard drive their
One problem with this is that you cannot mount the hard drive in both guest and host at the same time. If your host is windows just remove the drive letter associated with the partition from device manager to unmount it.
Details can be found in this link
No comments:
Post a Comment