免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2769 | 回复: 0
打印 上一主题 下一主题

Oracle VirtualBox 热添加硬盘 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-06-11 12:10 |只看该作者 |倒序浏览
目前测试版本4.1.16,只支持SATA
Thefollowing items were fixed / added since the VirtualBox 4.1 Beta 2:

  • GUI: reworked media type     change dialog

  • GUI: when cloning or     importing a VM, let the user decide if he wants to change the MAC     addresses of the network adapters
  • GUI: allow to change generic     networking properties during runtime
  • GUI: allow to     configure the port count of SATA controllers (required for SATA     hotplugging)

  • Cloning: allow linked cloning     (see VBoxManage clonevm, GUI support will follow)

  • Cloning: rename the disks in     the clone

  • PCI     passthrough: allow to start the VM if the ICH9 chipset is enabled and the     extension pack is notavailable (Beta     2 regression)

  • VBoxManage: more convenient     configuration of storage controller attachments by automatically     determining the port or device parameter when a storage controller has     only one port or device per port

  • VBoxManage guestcontrol fixes

  • Storage: fixed     access to CD/DVD images beyond 4GB when using the SATA controller     (bug #8592)

  • Networking: fixed the problem     with segmentation offloading when several VMs are transmitting in parallel

  • WDDM fixes

  • Mac OS X hosts: fix for     non-VT-x mode on Lion

  • Solaris hosts: fixed for     recent S11 versions



1.先配置虚拟机的SATA控制器,其中端口数是你要配置的硬盘的数量,比如你以后要配置10块盘,这里就配置成10,(就相当于服务器的硬盘插槽数量,不是当前的硬盘数量)

2.开启虚拟机,点击启动


2.1 查看虚拟机硬盘 fdisk -l


有一块硬盘/dev/sda

3.创建虚拟硬盘
3.1 进去命令行模式cmd
3.2 vboxmanage createhd --filenameD:\VirtualMachine2012.02.17\vb_oel62\oel62_0.vdi --size 300 --format vdi

记下这个UUID:2b4bad91-d223-4d78-8b0b-76d1bd4600bc
4.把新建虚拟硬盘添加到虚拟机
4.1 先查看当前的虚拟机
Vboxmanage list vms

4.2 查看虚拟硬盘
Vboxmanage list hdds
4.3 查看虚拟机的配置信息,查找SATA控制器的名称
Vboxmanage showvminfo"oel62"    ##引号中为前面查到的虚拟机名
其中SATA控制器名称为"SATA 控制器" ,这个名称可以在之前的配置控制时修改名称

4.4 把新的虚拟硬盘添加到虚拟机
Vboxmanage storageattach "oel62" --storagectl "SATA 控制器" --port 1 --device 0 --typehdd --medium 2b4bad91-d223-4d78-8b0b-76d1bd4600bc
添加成功,不成功会报错

4.5 查看虚拟机的硬盘


4.6 在虚拟机系统中查看硬盘fdisk -l
其中/dev/sdb就是新添加的硬盘,热添加成功
如果在这里还看不到新的硬盘,可以用如下命令让系统重新扫面新的硬盘
# echo "- - -" >/sys/class/scsi_host/host#/scan (其中host#,#号是一个数字,在用命令添加的时候的port号相对应,port号是几这个#号就是几)
这样就会扫描到新添加的硬盘

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

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP