无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
查看: 4533|回复: 2
打印 上一主题 下一主题

让 virtualbox支持从硬盘、U盘启动

  [复制链接]
跳转到指定楼层
1#
发表于 2011-1-14 10:33:38 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
#进入命令行

  1. cmd
  2. cd C:\Program Files\Oracle\xVM VirtualBox
复制代码

#获取磁盘信息(这个最关键)

  1. wmic /output:d:\diskdrive.html diskdrive list /format:htable
复制代码

#打开d:\diskdrive.html ,查看DeviceID栏,获取到你的U盘DeviceID,如\\.\PHYSICALDRIVE1
#获取磁盘分区信息(确认是哪个U盘)

  1. VBoxManage internalcommands listpartitions -rawdisk \\.\PHYSICALDRIVE1
复制代码

下面是我的U盘信息,8G的,显示7655MB
Number Type   StartCHS       EndCHS      Size (MiB) Start (Sect)
1       0x0b 0   /0 /45 975 /254/63          7655           44

#为U盘创建启动文件

  1. VBoxManage internalcommands createrawvmdk -filename d:\UsbDisk.vmdk -rawdisk \\.\PHYSICALDRIVE1
复制代码

#打开virtualbox-->设置-->硬盘-->添加连接(Ins)会找到刚才新建的UsbDisk.vmdk(如果没有自动找到,手工添加就可以了)
#常规-->高级-->Boot Order-->硬盘,启动你的虚拟机,成功了!

C:\>wmic /output:d:\diskdrive.html diskdrive list /format:htable

C:\>cd /d C:\Program Files\Oracle\VirtualBox

C:\Program Files\Oracle\VirtualBox>VBoxManage internalcommands listpartitions -r
awdisk \\.\PHYSICALDRIVE4
Number  Type   StartCHS       EndCHS      Size (MiB)  Start (Sect)
1       0x07  0   /1  /1   1023/255/63           127           63

C:\Program Files\Oracle\VirtualBox>VBoxManage internalcommands createrawvmdk -fi
lename F:\VirtualBox\UsbDisk.vmdk -rawdisk \\.\PHYSICALDRIVE4
RAW host disk access VMDK file F:\VirtualBox\UsbDisk.vmdk created successfully.

C:\Program Files\Oracle\VirtualBox>


UsbDisk.vmdk内容为:


  1. # Disk DescriptorFile
  2. version=1
  3. CID=132a8a4e
  4. parentCID=ffffffff
  5. createType="fullDevice"

  6. # Extent description
  7. RW 262112 FLAT "\\.\PHYSICALDRIVE4" 0

  8. # The disk Data Base
  9. #DDB

  10. ddb.virtualHWVersion = "4"
  11. ddb.adapterType="ide"
  12. ddb.geometry.cylinders="260"
  13. ddb.geometry.heads="16"
  14. ddb.geometry.sectors="63"
  15. ddb.uuid.image="34464f18-9539-4a4a-96a9-11e5fd8afe61"
  16. ddb.uuid.parent="00000000-0000-0000-0000-000000000000"
  17. ddb.uuid.modification="00000000-0000-0000-0000-000000000000"
  18. ddb.uuid.parentmodification="00000000-0000-0000-0000-000000000000"
复制代码
3#
发表于 2011-2-18 19:01:30 | 只看该作者
我用的是linux版的vb……网上现存方法到最后一步都出错……
回复

使用道具 举报

2#
 楼主| 发表于 2011-1-14 10:35:10 | 只看该作者
对比下与另外一个硬盘的虚拟磁盘文件内容


  1. # Disk DescriptorFile
  2. version=1
  3. CID=91994269
  4. parentCID=ffffffff
  5. createType="fullDevice"

  6. # Extent description
  7. RW 1953525168 FLAT "\\.\PHYSICALDRIVE1" 0

  8. # The disk Data Base
  9. #DDB

  10. ddb.virtualHWVersion = "4"
  11. ddb.adapterType="ide"
  12. ddb.geometry.cylinders="16383"
  13. ddb.geometry.heads="16"
  14. ddb.geometry.sectors="63"
  15. ddb.uuid.image="1613c249-3d72-4d22-9599-60ce130f744b"
  16. ddb.uuid.parent="00000000-0000-0000-0000-000000000000"
  17. ddb.uuid.modification="00000000-0000-0000-0000-000000000000"
  18. ddb.uuid.parentmodification="00000000-0000-0000-0000-000000000000"
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2025-12-10 23:58

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表