How to create images from iso for KVM?
24,701
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
.)
Related videos on Youtube
Author by
Malek
Updated on September 18, 2022Comments
-
Malek over 1 year
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?
-
Panther almost 11 yearsNormally you would just boot the iso with KVM.
-
Malek almost 11 yearsI try it but it didn't work. I must have an existing KVM image to add it to Glance and run it with nova compute.
-
Panther almost 11 yearsKVM will boot most any live iso image. Are you wanting to create a custom iso ? Clone installations ?
-
Malek almost 11 yearsI want to create a pre-installed disk images from iso file.
-
Panther almost 11 yearsSo boot the image, install from the image, and clone the resulting hard disk. help.ubuntu.com/community/KVM/CreateGuests
-
psusi almost 11 yearsQuestion doesn't make sense; an iso file is an image.
-
-
Fabby almost 6 yearsubfan, could you review other answer below?
-
ubfan1 almost 6 yearsThe question is not all that clear, and the comments add some additional inconsistencies, but the poster is not just trying to convert an ISO to something. glance is used to register/store kvm images, so create the KVM image by installing the ISO, (call this the "pre-install" image?), run it and install any additional packages, then register/store it with glance. My answer stopped at the last "run" step, since the poster didn't specify what if any additional packages they wanted.
-
xdevs23 almost 4 yearsThis is the solution if your ISO simply doesn't boot and you know it's a bootable ISO.