Converting images from one format to another is generally straightforward.
An ISO is a disk image of a CD specifically, and the VMDK is one of a hard drive. There's ways to mount a VMDK directly - vmware discmount comes to mind as does its linux counterpart vmware-mount.pl, or you can convert it to quite a few formats with qemu-img programme.
The qemu-img convert command can do conversionbetween multiple formats, including qcow2
, qed
,raw
, vdi
, vhd
, and vmdk
.
Image format | Argument to qemu-img blogging apps mac os x |
---|---|
QCOW2 (KVM, Xen) |
|
QED (KVM) |
|
raw |
|
VDI (VirtualBox) |
|
VHD (Hyper-V) |
|
VMDK (VMware) |
|
This example will convert a raw image file named image.img
to a qcow2 image file.
Run the following command to convert a vmdk image file to a raw image file.
Run the following command to convert a vmdk image file to a qcow2 image file.
Note
The -fformat
flag is optional. If omitted, qemu-img
will try to infer the image format.
When converting an image file with Windows, ensure the virtiodriver is installed.Otherwise, you will get a blue screen when launching the imagedue to lack of the virtio driver.Another option is to set the image properties as below when youupdate the image in the Image service to avoid this issue,but it will reduce virtual machine performance significantly.
If you’ve created a VDI image using VirtualBox, you can convertit to raw format using the VBoxManage
command-line toolthat ships with VirtualBox. On Mac OS X, and Linux, VirtualBoxstores images by default in the ~/VirtualBoxVMs/
directory.The following example creates a raw image in the current directoryfrom a VirtualBox VDI image.
The ISO file is a widely used Disk file format for installing different bootable operating systems. Although you can use directly the ISO file to boot any OS on VirtualBox, HyperV or VMware Workstations, however, in case you don’t want to first boot & install ISO file to convert it to VDI or VDMK (virtual hard drives) format. You can use the pre-conversion method. Yes, this is the method in which we directly convert the ISO image file (.iso) into VDI (virtual disk image) format using VirtualBox. Not only to VDI but also using the same VBOXmanage tools of VirtualBox the user can convert the ISO image file to VDMK or VHD. It is also very useful to convert and use other format Virtual Disks in different Virtual Machines.
For example, we can convert
After the conversion of ISO image to VDI, the user can directly boot the OS to install it converted VDI or VDMK format for admin or testing purposes.
Here we are using the command-line tool on Windows 10 but the commands given here are same for Mac and Linux systems too.
So, to start the conversion first of all the VirtualBox should be installed on the system to use the VBoxManage command-line tool. We are assuming that you have the VirtualBox software which is free and open-source (FOSS) virtual machine creator tool.
Right-click on the Address bar and select the Edit address option.
You will get the path of the folder where your ISO image resides.
Same for VHD.
If you want to convert VDI to VDMK/VHD or VDMK to VDI or VHD to VDI/VDMK then use the same above command just instead. For example: To convert VDI to VDMK, the command will be
VBoxManage Convertfromraw C:USersRajDownlaodsxyz.VDI C:UsersRajDownlaodsxyz.VDMK
In the same for other files too you can use the VBoxManage tool for Virtual Hard disk images to convert.
Other Tutorials: