3 Ways to Run a Virtual Machine on Linux

Christian Cawley 25-10-2016

You need to run another operating system on your Linux PC. But should you dual boot 7 Reasons Why You Should (and Shouldn't) Dual Boot Linux Often, making the choice of installing Linux over Windows can be tricky to justify. But why not opt for both? Here are five reasons to dual boot and two reasons you shouldn't. Read More , or use a virtual machine? And if you choose the second option, which virtual machine software should you use?


Virtual Machines vs. Dual Booting

Do you run Linux — perhaps Linux Mint or Ubuntu Linux Mint vs. Ubuntu: Which Distro Should You Choose? Linux Mint and Ubuntu are two popular Linux distros, but which is best? Should you choose Ubuntu or Linux Mint? Read More — alongside Windows? Or do you have two or more Linux distributions installed on your computer? How is it working out for you? For some, this dynamic works well. For others, rebooting can be a problem.

The time taken to restart, select a different OS at the GRUB bootloader screen, and then boot, can be problematic. This is especially true on systems where Linux is installed alongside Windows.


On slower systems, or those with many apps trying to run when Windows loads, you could be waiting 5–10 minutes before you can start being productive. Throw in an anti-virus solution, and you’re soon on a massive go-slow.

However, running your secondary OS in a virtual machine can overcome this problem.


What Is a Virtual Machine?

We’ve looked at virtual machines — known as VMs — several times in the past. Put simply, they are applications that create a software environment that mimics computer hardware. An operating system can then be installed into this environment. We call this a “guest OS”, while the operating system you have installed on your physical computer is the “host OS”.

Additionally, virtualization can be enhanced with the help of dedicated system hardware.

How to Activate Virtualization on Your PC

While your chosen guest OS might run without hardware virtualization, if the option is available, it is worth using. Not least because it will reduce the drain on your computer’s system resources.

To enable hardware virtualization, you’ll need to reboot your computer to access the BIOS. How this is achieved will depend upon your device, but it is generally done by tapping Del or F2 after the computer restarts.


Find the Advanced screen in the BIOS and look for one of the following:

  • Virtualization
  • VT-x (Intel — older systems will have VT-d)
  • AMD-V (AMD systems)

The BIOS is navigated using the arrow keys. When you have enabled virtualization, hit F10 to save and exit.

Once this is done, you have a choice of three open source VM applications, which we’ll look at below (VMWare is also available for Linux, but is not open source).

1. VirtualBox

Offering versatile virtualization, VirtualBox can create a virtual machine with virtually any operating system (except those intended for ARM devices). It also offers software and hard assisted virtualization, storing virtual machines as disk images. This makes them easy to backup or migrate to other PCs or VM applications.



VirtualBox is particularly good at running 32-bit and 64-bit Linux distros, as well as Windows. It’s even possible to run OS X on VirtualBox, perhaps to test it before configuring your PC as a Hackintosh Tech Recipe: Optimum Hardware Components for a Perfect Hackintosh Thinking of building a Hackintosh? You can make a Mac Pro for half the price of the real thing. I put together a custom Hackintosh using information gleamed from several Hackintosh enthusiast sites. Even with... Read More . Find a copy for your distribution at


If you want to run an ARM operating system (such as Android, Raspbian, or RISC OS), then this command line-based tool is the one to choose.



Short for “Quick Emulator”, QEMU is straightforward to set up, and some guest operating systems can even be downloaded with QEMU built in. Our previous look at running the Raspbian Pi primary OS Raspbian in QEMU will give you a good introduction to this tool.

Although the unabbreviated name for QEMU is “Quick Emulator”, it is in fact a hypervisor, a tool for managing hardware virtualization. You can install QEMU with:

sudo apt-get install qemu qemu-kvm libvirt-bin

3. KVM

Abbreviating Kernel-based Virtual Machine, KVM is a fork of the QEMU project, and works in conjunction with that tool to provide additional options (such as near-native speed) beyond its native VM functionality.


This means that KVM offers great speed and stability than VirtualBox, but KVM is a little trickier to set up. However, if you can get your head around para-virtualized drivers, you’ll be well on your way to understanding why KVM is a popular option for hosting VMs.

To use KVM, begin by confirming that your hardware is suitable for hardware virtualization:

sudo apt-get install cpu-checker

If the response is “KVM acceleration can be used”, proceed to install the software:

sudo apt-get install qemu-kvm libvirt-bin virtinst bridge-utils

You’ll be able to run KVM via the desktop using Virtual Machine Manager, which you should find in the desktop menu.

Which Distros Run Best in a VM?

Once you’ve chosen a suitable virtual machine application, you’ll need to tailor your choice of guest OS. For instance, you can run Windows effortlessly on VirtualBox, although Windows 7 is probably the safest option.

Conversely, QEMU is suitable for running ARM-targeted distributions, such as the Raspberry Pi’s Raspbian, or Android.

Meanwhile, something lightweight like Lubuntu Lubuntu: A Lightweight Version Of Ubuntu [Linux] Love Ubuntu, but feel skeptical about 11.04's new Unity interface? Try Lubuntu 11.04, an extremely lightweight alternative to the main branch of Ubuntu. You'll find the menu-driven interface familiar and the resources hit remarkably low.... Read More will run on any of these VM tools.

Which VM Tool Should You Use?

So, we’ve taken a look at three virtual machine applications. But which should you use?

It’s a tricky one. If you want easy virtualization that is quick and straightforward to set up, then VirtualBox should be your first stop. For more advanced virtualization, or to run a VM of an ARM device, then take a look at QEMU.

If you consider yourself a virtual machine power user, however, then KVM should be your first stop.

Do you prefer to dual boot, or is a virtual machine setup your preference for multi-platform desktop access? Tell us how you do it in the comments.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. dotarian
    November 2, 2016 at 6:52 pm

    You have an error in the first part of the article. "Hyper-V" is NOT the hardware virtualization feature on Intel chipsets. VT-x and VT-d are Intel's hardware virtualization options.

    FYI, Hyper-V is Microsoft's virtualization hypervisor (like VMWare, Virtualbox, etc).

    • Christian Cawley
      November 3, 2016 at 12:40 pm

      Crivens! How did that happen. Thanks Dotarian, change imminent.

  2. Toddicus
    October 31, 2016 at 12:14 am

    You can run cpu-checker using the command "sudo kvm-ok" in the terminal window. Should get the following response of if your cpu can use KVM :

    INFO: /dev/kvm exists
    KVM acceleration can be used

  3. Daniel
    October 27, 2016 at 12:04 am

    The article says how to install cpu-checker, but not how to run it.

  4. diros
    October 25, 2016 at 8:10 pm

    you forgot gnome boxes