https://fosspost.org/use-qemu-test-operating-systems-distributions/

how-to-use-qemu.png

QEMU is a virtualization technology emulator that allows you to run operating systems and Linux distributions easily on your current system without the need to install them or burn their ISO files. It is like VMware or VirtualBox. You can use it at anytime to emulate running any operating system you want on a lot of devices and architecture.

QEMU is free and open source. And is licensed under GPL 2. it has the ability to run under both KVM and XEN models (if you enabled virtualization technology from your BIOS first) and offers a lot of options and virtualization options. In this article, we’ll explain how to use QEMU and install it.

How To Install QEMU

Fortunately, QEMU is available to install from almost all the official Linux distributions repositories. Which is a good thing for us since we won’t need to download or install anything from 3rd party repositories.

To install QEMU on Ubuntu/Linux Mint:

sudo apt install qemu qemu-kvm libvirt-bin

To install QEMU on Red Hat/CentOS/Fedora (replace dnf with yum for Red Hat/CentOS):

To install QEMU on SUSE/openSUSE

sudo zypper in qemu

To install QEMU on Arch Linux:

How To Use QEMU

QEMU provides a lot of options, architectures and formats to use. And we’ll see many different examples in order to understand the possible ways to achieve our goals using QEMU.

First, we have to create a virtual hard drive image if we want to install our virtual operating system somewhere. This image file will contain all the data and files of the operating system after installation. To do this, we can use the “qemu-img” tool.

To create an image file with the size of 10GB and qcow2 format (default format for QEMU images), run:

qemu-img create -f qcow2 testing-image.img 10G

Note that a new file called “testing-image.img” is now created at your home folder (or the place where you run the terminal). Note also that the size of this file is not 10 Gigabytes, it’s around 150KB only; QEMU won’t use any space unless needed by the virtual operating system, but it will set the maximum allowed space for that image to 10 Gigabytes only

Now that we’ve created our image file, if we have an ISO file for a Linux distribution or any other operating system and we want to test it using QEMU and use the new image file we created as a hard drive, we can run: