我已经用完了虚拟机磁盘(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大小。
其他回答
我可以通过克隆vmdk,然后修改和调整它的大小来调整它的大小。
vboxmanage clonehd "virtualdisk.vmdk" "new-virtualdisk.vdi" --format vdi
vboxmanage modifyhd "new-virtualdisk.vdi" --resize 30720
使用这些简单的步骤来调整vmdk的大小。
单击File ->虚拟媒体播放器
选择“vdi文件”,单击“属性”
在这里,您可以增加或减少vdi大小。
一个快速而简单的选择:
关闭机器 创建所需大小的新虚拟盒磁盘 将内容从旧磁盘移动到新磁盘: Vboxmanage clonehd“源磁盘。vmdk”“新磁盘。vmdk”——现有的 打开机器 您可能必须在操作系统中调整分区大小,以填充磁盘的其余部分
警告
如果新磁盘比源磁盘短,则会丢失源磁盘上新磁盘大小位置上的数据。
在步骤1之前,您可以防止在操作系统内源磁盘的末端释放delta空间,其中delta = size(source-disk) - size(new-disk)。
这是一种调整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.
接下来,在您的客户操作系统上,您需要调整分区大小以使用新的可用空间。
如果您希望结束返回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文件也会得到同样的错误。