How to Install an Ubuntu Virtual Machine with QEMU
When it comes to virtualization, QEMU is miles ahead of VirtualBox and VMware with its near-native performance and rich feature set. It uses Linux KVM (Kernel-based Virtual Machine) to create virtual environments on a host computer.
Like any other Linux tool, using QEMU to create virtual machines is straightforward. You can create an Ubuntu virtual machine using QEMU in two different ways: from the command line and using virt-manager, a graphical front-end for QEMU.

Download the Ubuntu ISO
To install Ubuntu on a virtual machine, you need the ISO file available on the Ubuntu website.
Download:Ubuntu Desktop

Download the installation image and save it to a preferred location on your computer.
Prerequisite: Check if Virtualisation Is Enabled on Your PC
Before installing QEMU, check whether your machine supports virtualization. you may do so by running:
If the output returns a number greater than 0, you can safely proceed to the next steps. If not,enable virtualization on your machineby booting into the BIOS.

Install QEMU on Your Linux PC
The next step is to install QEMU and other tools required for running an Ubuntu virtual machine. You need to install qemu-kvm, libvirt-daemon, bridge-utils, and virt-manager.
On Ubuntu and Debian, run:

On Arch Linux:
And to install the packages on Fedora or RHEL, run:

Post-installation, add your current user to the libvirt and kvm groups:
Start and enable the libvirtd service to run at boot:
Using virt-manager to Create an Ubuntu VM
With virt-manager, you can manage QEMU virtual machines using a GUI. If you prefer the command line instead, skip to the next section.
Launch Virtual Machine Manager from the applications menu. When it opens, click theCreate a new virtual machineicon from the secondary menu and selectLocal install media (ISO image or CDROM)from the available options.
ClickForwardto proceed. SelectBrowseto open the ISO media locator. Here, you’ll need to add a storage pool from where you’ll select the ISO.
To do that, click thePlusicon located in the bottom left and set a name for the pool (inputDownloadsif the file is in the Downloads directory). ClickBrowseto locate the folder and hitOpen. Then, clickFinish.
Once done, select the newly created pool from the left sidebar and highlight the Ubuntu ISO file. ClickChoose Volumeto continue.
virt-manager will automatically detect the OS you’re trying to install. If not, you can type the name in the search field and select the appropriate OS from the results. When you’re done, clickForward.
In the memory and CPU settings window, specify the amount of memory and CPU threads you’d like to allocate to the VM. For this guide, let’s go with 4096MB of memory and 6 CPU threads. You can allocate more if your hardware supports it. ClickForwardto proceed further.
On the following screen, configure storage for the Ubuntu virtual machine. You can either create a disk image automatically in the current directory or choose a custom location by creating a new storage pool, as earlier.
Proceed withCreate a disk image for the virtual machineand specify the size (in GB) you wish to allocate. For an Ubuntu VM, anything more than 20GB works. Make sure theEnable storage for this virtual machinebox is checked off.
Finally, clickFinishand virt-manager will set up the virtual machine for you. As soon as it finishes the preliminary setup, a boot menu will appear asking you toTry or Install Ubuntu. Select that from the list of available options.
When Ubuntu boots, you can either try the Ubuntu desktop or install it in the VM, the choice is yours!
The steps to install Ubuntu using QEMU are more or less similar toinstalling Ubuntu on your PC.
By default, the resolution of the virtual machine will be lower than your display resolution. You can change this by heading over toSystem Settingson Ubuntu and configuring the resolution manually.
When you’re done testing the machine, clickVirtual machine > Shut down > Shut down to turn it off.
If you wish to start the virtual machine later, simply launch virt-manager again and double-click the Ubuntu VM entry to launch the environment.
Setting Up an Ubuntu VM Through the QEMU CLI
The terminal is the quickest way to configure virtual machines using QEMU. With a few simple commands, you’re able to set up a usable QEMU VM running Ubuntu.
To begin, first, create a new folder for the virtual machine files and move the downloaded Ubuntu ISO into the newly created directory:
Run the following command to create an image file in the current directory:
The above command will create a virtual disk image file that’s 20GB in size. The virtual machine will use this disk image to store data, so ensure to specify a size accordingly.
Next, run the following command to start the Ubuntu virtual machine:
The virtual machine window will pop up. PressEscapeto open the boot menu and select the appropriate option to boot from the ISO file.
Select theTry and Install Ubuntuoption from the list and Ubuntu will boot. As earlier, it’s possible to either test the desktop or install Ubuntu on your computer.
After installing Ubuntu, make sure you remove the-cdromflag from the qemu command. This will boot Ubuntu from the disk image file rather than the ISO file.
The command will then become:
Feel free tocreate a command-line aliasfor this command if you plan on running it frequently.
QEMU Is Essential to Virtual Machine Users
Virtualization is a great way to experience new desktops and test your software on different OSes. QEMU is the hypervisor of choice for thousands of virtual machine users, given its high performance and less setup time.
There are several other hypervisors for Linux users, namely KVM, QEMU, VirtualBox, and VMware. Which one you should choose, depends on what you expect from the software.
When it comes to virtualization, you’ve got plenty of options: KVM, QEMU, Hyper-V, and VirtualBox. But how are they different from each other?
These films will leave you questioning humanity, but also wanting more.
Don’t let aging hardware force you into buying expensive upgrades.
These plugins will make you wonder why you used Photoshop in the first place.
Windows is great, but adding this makes it unstoppable.
The best features aren’t the ones being advertised.