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.)

Share:
24,701

Related videos on Youtube

Malek
Author by

Malek

Updated on September 18, 2022

Comments

  • Malek
    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
      Panther almost 11 years
      Normally you would just boot the iso with KVM.
    • Malek
      Malek almost 11 years
      I 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
      Panther almost 11 years
      KVM will boot most any live iso image. Are you wanting to create a custom iso ? Clone installations ?
    • Malek
      Malek almost 11 years
      I want to create a pre-installed disk images from iso file.
    • Panther
      Panther almost 11 years
      So boot the image, install from the image, and clone the resulting hard disk. help.ubuntu.com/community/KVM/CreateGuests
    • psusi
      psusi almost 11 years
      Question doesn't make sense; an iso file is an image.
  • Fabby
    Fabby almost 6 years
    ubfan, could you review other answer below?
  • ubfan1
    ubfan1 almost 6 years
    The 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
    xdevs23 almost 4 years
    This is the solution if your ISO simply doesn't boot and you know it's a bootable ISO.