1. 查看当前Windows物理硬盘信息,在Windows cmd中运行:wmic diskdrive list brief
C:\WINDOWS\system32>wmic diskdrive list brief
Caption DeviceID Model Partitions Size
LITEON CV8-8E256 \\.\PHYSICALDRIVE0 LITEON CV8-8E256 6 256052966400
2. 把Virtual Box的安装路径添加到PATH环境变量里面,为了能够使用VBoxManage创建物理硬盘映射出来的虚拟硬盘;
3. 查看指定物理硬盘分区信息:
C:\WINDOWS\system32>VBoxManage internalcommands listpartitions -rawdisk \\.\PhysicalDrive0
Number Type StartCHS EndCHS Size (MiB) Start (Sect)
1 0x00 0 /0 /0 0 /0 /0 100 2048
2 0x00 0 /0 /0 0 /0 /0 16 206848
3 0x00 0 /0 /0 0 /0 /0 81920 239616
4 0x00 0 /0 /0 0 /0 /0 150180 168011776
5 0x00 0 /0 /0 0 /0 /0 512 475580416
6 0x00 0 /0 /0 0 /0 /0 10445 476628992
7 0x00 0 /0 /0 0 /0 /0 1024 498020352
4. 创建物理硬盘映射出的虚拟硬盘: VBoxManage internalcommands createrawvmdk -filename "</path/to/your/virtual/disk/file>" -rawdisk "<DeviceID>"
1. VBoxManage internalcommands createrawvmdk -filename "test.vmdk" -rawdisk "\\.\PhysicalDrive0"