How to resize a VirtualBox vmdk file

I've run out of space on a virtual machine disk which is a vmdk and need to resize the virtual image. Resizing with the command

vboxmanage modifyhd Machine-disk1.vmdk --resize 30720

gives the error

Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!

How can I resize a vmdk image?


yes, Brian, you are right: those are the steps, but if you want to end having back a vmdk hard disk (maybe you are interested in using the disk in vwmare too) you miss one more step. So the complete howto is:

VBoxManage clonehd "source.vmdk" "cloned.vdi" --format vdi
VBoxManage modifyhd "cloned.vdi" --resize 51200
VBoxManage clonehd "cloned.vdi" "resized.vmdk" --format vmdk

The above will resize the hard disk up to 50GB (50 * 1024MB).

To complete things you need to resize the drive too! To achieve this, you might want to download gparted iso and boot from that iso to resize your drive (select the iso from within the virtualbox settings).

PS If your new size is too small, you'll get the same error even with your new vdi file.


我能够通过克隆它然后修改和调整大小来调整vmdk的大小。

vboxmanage clonehd "virtualdisk.vmdk" "new-virtualdisk.vdi" --format vdi
vboxmanage modifyhd "new-virtualdisk.vdi" --resize 30720

I have a Windows 7 client on a Mac host and this post was VERY helpful. Thanks.

I would add that I didn't use gparted. I did this:

  • Launch new enlarged vmdk image.
  • Go to Start and right click Computer and select Manage.
  • Click Disk Management
  • You should see some grayed space on your (in my case) C drive
  • Right click the C drive and select Extend Volume.
  • Choose size and go
  • Sweet! I preferred that to using a 3rd party tool with warnings about data loss.

    Cheers!

    链接地址: http://www.djcxy.com/p/18218.html

    上一篇: 在虚拟窗口机器上运行的本地版本的网站

    下一篇: 如何调整VirtualBox vmdk文件的大小