QEMU can be used for building a virtual machine from the ISO image of a Linux distribution. Follow this procedure to create a VM image.
About this task
- Download the ISO image for your chosen operating system, for example fedora29.iso.
Create a qemu harddisk image file.
qemu-img create fedora.img 10G
Use the qemu harddisk image file created in step 2, as the harddisk in the qemu -boot command, to begin the installation
of the operating system into the VM.
qemu-system-x86_64 –boot d –cdrom fedora29.iso –hda fedora.img –enable-kvm –cpu host –smp 4 –m 4G
where fedora29.iso is the name of the ISO image downloaded in step 1.
- Follow the prompts to install the OS to the VM harddisk image file.