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.
- 65,642
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.
- 123
- 39,269
-
This even works if the VMDK file points to (parts of) a raw disk image (as created by
VBoxManage internalcommands createrawvmdk). – krlmlr Oct 23 '14 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. – SeligkeitIstInGott Oct 08 '18 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
- 204
- 1
- 5
- 23
clonehdnot an option for you? – rozcietrzewiacz Aug 15 '11 at 11:31