修改VirtualBox虚拟硬盘的大小类型

virtualbox自带的命令工具是可以完成修改虚拟硬盘的大小、类型等需求的。

man 用法:

Oracle VM VirtualBox Command Line Management Interface Version 4.3.6
(C) 2005-2013 Oracle Corporation
All rights reserved.

Usage:

VBoxManage modifyhd
[–type normal|writethrough|immutable|shareable|
readonly|multiattach]
[–autoreset on|off]
[–property ]
[–compact]
[–resize |–resizebyte ]

pengdeMacBook-Air:windows pengchen$ cd VirtualBox\ VMs/windows/

修改固定大小的虚拟硬盘为动态分配存储的硬盘:

pengdeMacBook-Air:windows pengchen$ VBoxManage modifyhd windows-disk1.vmdk -type normal

修改虚拟硬盘的大小为50G:

pengdeMacBook-Air:windows pengchen$ VBoxManage modifyhd windows-disk1.vmdk –resize 51200
0%…
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!

呃,不支持这格式、、、好吧,建个新克隆盘吧。

pengdeMacBook-Air:windows pengchen$ VBoxManage createhd
Usage:

VBoxManage createhd –filename
[–size |–sizebyte ]
[–diffparent |
[–format VDI|VMDK|VHD] (default: VDI)
[–variant Standard,Fixed,Split2G,Stream,ESX]

pengdeMacBook-Air:windows pengchen$ VBoxManage createhd –filename windows.vhd –size 51200 –format VHD –variant Standard
0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%
Disk image created. UUID: 1092de3a-f9ce-40bc-88c3-6a29ebc84321

克隆用法:

pengdeMacBook-Air:windows pengchen$ VBoxManage clonehd
Usage:

VBoxManage clonehd
[–format VDI|VMDK|VHD|RAW|]
[–variant Standard,Fixed,Split2G,Stream,ESX]
[–existing]

pengdeMacBook-Air:windows pengchen$ VBoxManage clonehd windows-disk1.vmdk windows.vhd –existing
0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%
Clone hard disk created in format ‘VHD’. UUID: 1092de3a-f9ce-40bc-88c3-6a29ebc84321

好了,克隆完了,去界面上把就虚拟硬盘删了,添加好新的就OK啦。

About 智足者富

http://chenpeng.info

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>