How to create images from iso for KVM?

Hi all :) I want to create a KVM image from an existing iso file (for glance on OpenStack), but I didn't find how to do it. Can you help me please?


Solution 1:

Create a VM with a size (6G below) (it will be small until the install is done into it)

qemu-img create myvm.img -f qcow2 6G

Then install the iso into your vm

kvm -m 750 -cdrom ${PWD}/whatever.iso -boot d myvm.img

And run it in 990M of memory:

kvm -m 990 myvm.img

Solution 2:

This isn’t correct. This is for booting a KVM instance using an image that was created and a foreign ISO.

Maybe something similar to this in order to "convert" an ISO to an qcow2 image. I might be confused about the OP. I was looking to convert an ISO to qcow2.

Your instructions seem right to boot an ISO for an blank qcow2 disk image for a hard drive for 6G.

qemu-img convert -f raw -O qcow2 eProx-Clover.iso eProx-Clover.qcow2

(but it has to flagged as a bootable ISO in order to boot with -d.)