How to Install QEMU on Ubuntu

QEMU is a Linux emulator used to create virtual machines. Many people use Virtual Box on Windows, but fir Linux, you can use QEMU instead.

Make sure the CPU supports hardware virtualization.

Check if the CPU for the support of hardware for virtualization.

On Intel, the processor is Intel VT and for AMD processors, it’s AMD-V. Run the following command to check your machine’s virtualization features:

  • egrep ‘(vmx

Install bridge-utils at the command line.

This utility is used to bridge managed devices.

To install:

  • sudo apt-get install -y bridge-utils resolvconf
  • sudo ifup br1
  • sudo service networking restart

Install KVM.

You’ll need KVM for virtualization.

To install:

  • apt-get update
  • sudo apt-get install -y qemu-kvm qemu virt-manager virt-viewer libvirt-bin

Create a virtual machine.

Once you’re all set up, you can create a virtual machine at the command line or in the GUI.

Here’s how:

  • For the command line, the command is:sudo virt-install –name=itzgeekguest –ram=1024 –vcpus=1 –cdrom=/var/lib/libvirt/images/CentOS-6.9-x86_64-minimal.iso –os-type=linux –os-variant=rhel7 –network bridge=br1 –graphics=spice –disk path=/var/lib/libvirt/images/itzgeekguest.dsk,size=4
  • sudo virt-install –name=itzgeekguest –ram=1024 –vcpus=1 –cdrom=/var/lib/libvirt/images/CentOS-6.9-x86_64-minimal.iso –os-type=linux –os-variant=rhel7 –network bridge=br1 –graphics=spice –disk path=/var/lib/libvirt/images/itzgeekguest.dsk,size=4
  • For graphical mode, you need to be root. Sometimes starting the Virtual Machine Manager from Dashboard does not give all the features to create a virtual machine.sudo virt-manager
  • sudo virt-manager

Manage your virtual machines.

You can manage your virtual machines in the virtual machine manager.

To do so:

  • Choose “File” and “New Virtual Machine”.
  • Browse for the desired operating system.
  • Choose the type and version for your operating system.
  • Choose your memory and CPU settings.
  • Tick “Enable storage for this virtual machine” and “Create a disk on the computer’s hard drive,” or pick “Select managed or other existing storage” and select your desired storage.
  • Choose “Advanced options” to select bridge networking; this allows the communication to outside networks.
  • Give a name to the VM and tick “Set a fixed MAC address”.

Leave a Comment