0

What are the actual technical differences apart from ISO being read only and their purposes? Can I convert an ISO image to a virtual disk (Ex: qcow2) without changing its content? If that is possible how can I do that? Can I use a virtual disk image (Ex: qcow2) as an installation media in place of an ISO image for a VM?

The use case: Most cloud providers only support virtual disk images such as qcow2 and they don't support installing the OS from an ISO. Instead they use preinstalled OS images (virtual disks). What I want is to run the installation program just like from an ISO but using a virtual disk instead (Ex: qcow2)? I think it should be possible just as we can make bootable flash drives out of ISOs in the physical world. Installation program needs to be run. That's the requirement.

1 Answers1

2

ISO files are just "raw" virtual disks, too. The reason for the name is that they're specifically virtual disks containing the ISO 9660 filesystem that is used on CDs (or the UDF filesystem for DVDs), and they're read-only primarily because the ISO 9660 filesystem is not made for in-place updates – it's a bit like a SquashFS image.

If you have a "hybrid ISO" that can be written to a USB stick using 'dd' (such as the ones provided by Linux distributions), then you can literally just rename it to .img or .raw and that's your virtual HDD image. You can then compress it to the .qcow2 or .vhd formats using the qemu-img tool that comes with Qemu.

On the other hand, "pure" ISO images made for CDs/DVDs use a boot process somewhat incompatible with fixed disk (HDD/USB) boot process – their boot sectors are different, their partition tables are different. For example, an official Windows 10 ISO cannot be written directly to USB, so it cannot be directly converted to a bootable .vhd either.

grawity
  • 501,077