It's said that VirtualBox's VBoxManage modifyhd --resize
command can only be used on either VDI or VHD files. Sadly, I have a VirtualBox image that is in VMDK format, and I don't know how to convert it to those other two formats.
3 Answers
You can use a two-step procedure then - first, use the clonemedium
command to create a VDI image:
VBoxManage clonemedium disk aaaa.vmdk aaaa.vdi --format VDI
(Have a look also at other options to clonemedium
, like --variant
. To read the help, just run VBoxManage | less
or visit https://www.virtualbox.org/manual/ch08.html#vboxmanage-clonevdi).
Once you have the .vdi
file, you can proceed with your modifications.
-
This even works if the VMDK file points to (parts of) a raw disk image (as created by
VBoxManage internalcommands createrawvmdk
).– krlmlrOct 23, 2014 at 15:59
If you would like to convert only the virtual disk, not entire VM, you can also use qemu-img for Windows: it's free, portable and it runs under command prompt.
VirtualBox, VMware, Hyper-V disk image types are all supported.
For example, to convert VMDK to VHDX:
qemu-img.exe convert FileSource-Image.vmdk -O vhdx FileDestination-Image.vhdx
Extracted from: http://www.sysadmit.com/2016/08/vmware-convertir-vhdx-en-vmdk.html
-
Thank you. This is exactly what I needed. QEMU is great since it is installable cross-platform too. Oct 8, 2018 at 14:00
You can convert .vmdk files into .vdi and .vhd files in VirtualBox7 using the GUI in the following way:
- in the VirtualBox GUI under "Copy Medium" select the file to be converted.
- and then select .vdi or .vhd as the target format.
- and then execute the conversion
clonehd
not an option for you?