我已经用完了虚拟机磁盘(vmdk)上的空间,需要调整虚拟映像的大小。使用命令调整大小
vboxmanage modifyhd Machine-disk1.vmdk --resize 30720
给出错误
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!
如何调整vmdk映像的大小?
我已经用完了虚拟机磁盘(vmdk)上的空间,需要调整虚拟映像的大小。使用命令调整大小
vboxmanage modifyhd Machine-disk1.vmdk --resize 30720
给出错误
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!
如何调整vmdk映像的大小?
当前回答
使用这些简单的步骤来调整vmdk的大小。
单击File ->虚拟媒体播放器
选择“vdi文件”,单击“属性”
在这里,您可以增加或减少vdi大小。
其他回答
您可以使用Vmware player来调整vmdk的大小。 如果你想保持vmdk格式,这将删除往返转换(在其他文章中提到)。只要确保当你将vmdk添加到vmware时,不要在提示时单击升级格式,保持当前的格式以防VirtualBox不接受它。
我可以通过克隆vmdk,然后修改和调整它的大小来调整它的大小。
vboxmanage clonehd "virtualdisk.vmdk" "new-virtualdisk.vdi" --format vdi
vboxmanage modifyhd "new-virtualdisk.vdi" --resize 30720
如果您希望结束返回vmdk硬盘(可能您也有兴趣在vwmare中使用该磁盘),完整的步骤如下:
VBoxManage clonemedium "source.vmdk" "cloned.vdi" --format vdi
VBoxManage modifymedium "cloned.vdi" --resize 51200
VBoxManage clonemedium "cloned.vdi" "resized.vmdk" --format vmdk
以上将调整硬盘大小至50GB (50 * 1024MB)。 要完成事情,你也需要调整驱动器的大小!要实现这一点,您可能需要下载gparted iso,并从该iso引导来调整驱动器的大小(从virtualbox设置中选择iso)。
附注:如果你的新大小太小,即使你的新vdi文件也会得到同样的错误。
为了缩小图像大小,我使用以下步骤:
在客户端机器cat /dev/zero > z;sync;sleep 3;sync;rm -f z 关闭客户端机器 在主机VBoxManage clonehd”源代码上。vmdk”“克隆。Vdi”——格式化Vdi 在VBoxManage modifyhd克隆的主机上。vdi,紧凑 在主机VBoxManage clonehd“克隆。vdi”“调整大小。Vmdk "——格式化Vmdk
这是一种调整VirtualBox磁盘大小的方法,无论它是固定格式的磁盘还是动态格式的磁盘。具体来说,它可以防止磁盘是固定格式时出现的错误。
⚠️备份虚拟磁盘。你永远不知道会出什么问题。
在主机上:
Open a terminal window. On Windows: Open the command prompt cmd. Go to the directory with the virtual disk you want to resize. For example: cd "My VMs" Create a new VirtualBox disk with your desired filename, size (in megabytes) and format (either Standard (dynamic) or Fixed). For example, to create a 50 GB fixed-format disk called MyNewDisk.vdi: VBoxManage createmedium --filename "MyNewDisk.vdi" --size 50000 --variant Fixed If VBoxManage is not recognized as a command, specify the full path to it. It can be found in the VirtualBox installation directory. On Windows the above command would become: "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" createmedium --filename "MyNewDisk.vdi" --size 50000 --variant Fixed Copy the original disk to the new disk. VBoxManage clonemedium "MyOriginalDisk.vdi" "MyNewDisk.vdi" --existing The resize is done! You can check the properties of the new disk if you want: VBoxManage showmediuminfo "MyNewDisk.vdi" Change the virtual machine to use the new disk instead.
接下来,在您的客户操作系统上,您需要调整分区大小以使用新的可用空间。