How to Install QEMU on Ubuntu to Set Up a Virtual Machine

If you want to try out different operating systems on your Ubuntu machine, consider installing QEMU, a hypervisor for Linux-based operating systems.

Virtualization is a nifty way to use both Linux and Windows, getting the best of both worlds without having to deal with dual booting and all the issues that come with it.

VirtualBox and VMware are household names when it comes to best virtualization solutions. But did you know that there are also alternatives? QEMU is one of those free and open source alternatives to try, if you want to explore.


Prerequisites for installing QEMU on Linux

Before installing software packages on Linux, it is important to update the repositories and upgrade the system. This reduces the risk of downloading insecure and incompatible software.

Launch the terminal in Ubuntu and enter these commands to update the software repositories:

sudo apt update && upgrade

Type Yes Where Yes when prompted for permission and let the system upgrade complete. Once you have updated and upgraded your system, there is only one task to check before installing QEMU.

To ensure that you can configure virtual machines with QEMU, you must install and activate the libvirt daemon that runs virtualization in the background. Without it, QEMU or any other hypervisor will refuse to work.

Launch the terminal and enter these commands to install and activate the libvirt daemon on your Ubuntu machine:

sudo apt install libvirt-daemon
sudo systemctl enable libvirtd
sudo systemctl start libvirtd

Once you have completed this step, you can move on to the QEMU installation process.

Download and install QEMU on Ubuntu

You can install QEMU on your Ubuntu machine using the APT package manager. Launch the terminal and run the following command to install QEMU on Ubuntu:

sudo apt install qemu-kvm 

Walk in Yes Where Yes when prompted and wait for the installation process to complete. If you prefer a more hands-on approach, you can manually download the software source from the official website of the QEMU Where GitHub repository then compile it.

Open a new terminal and enter these commands one by one to compile QEMU from source:

sudo apt install git
git clone https:
cd qemu
git submodule init
git submodule update

After installing QEMU, it’s time to install Virtual Machine Manager or, in short, virt-manager. It is a handy graphical tool for setting up and managing virtual machines in Linux.

If you are new to virtualization on Linux, it is highly recommended to install virt-manager as the graphical layout helps new users get familiar with VirtualBox and VMware.

Download and install the virtual machine manager

You can install Virtual Machine Manager directly from the terminal using the package manager of your choice. Launch a terminal and install the virt-manager package using the APT package manager:

sudo apt install virt-manager

Once the installation is complete, you can access it from the command line by typing virt-manager or search for the application in the applications menu.

Configure a Linux virtual machine with QEMU/KVM

Now that QEMU is configured, it’s time to do a test. Install the operating system of your choice and be sure to play around with virtual machine configurations to determine what works best with your system. To start, you can try installing a Linux distribution such as Manjaro.

Source link

Steven L. Nielsen