Accelerating QEMU on Windows with HAXM (2024)

22 Nov 2017 — by Yu Ning

In this post, I’m going to introduce a useful technique to people who are using,or are interested in using, QEMU on Windows. Basically, you can make the most ofyour hardware to accelerate QEMU virtual machines on Windows: starting with its2.9.0 release, QEMU is able to take advantage ofIntel HAXM to run x86 and x86_64 VMs with hardware acceleration.

If you have used QEMU on Linux, you have probably enjoyed the performance boostbrought by KVM: the same VM runs a lot faster when you launchQEMU with the -accel kvm (or -enable-kvm) option, thanks tohardware-assisted virtualization. On Windows, you can achieve a similar speed-upwith -accel hax (or -enable-hax), after completing a one-time setup process.

First, make sure your host system meets the requirements of HAXM:

  1. An Intel CPU that supportsIntel VT-x with Extended Page Tables (EPT).
    • Intel CPUs that do not support the said feature are almost extinct now. Ifyou have a Core i3/i5/i7, you should be good to go.
  2. Windows 7 or later.
    • HAXM works on both 32-bit and 64-bit versions of Windows. For the rest ofthis tutorial, I’ll assume you are running 64-bit Windows, which is far morepopular than 32-bit nowadays.

Next, check your BIOS (or UEFI boot firmware) settings, and make sure VT-x(or Virtualization Technology, depending on your BIOS) is enabled. If there isalso a setting for Execute Disable Bit, make sure that one is enabled as well.In most cases, both settings are enabled by default.

  • If your system is protected against changes to BIOS, e.g. you have enabledBitLocker Drive Encryption or any other tamper protection mechanism, you mayneed to take preventive measures to avoid being locked out after changing thesaid BIOS settings.

After that, if you are on Windows 8 or later, make sure Hyper-V is disabled.This is especially important for Windows 10, which enables Hyper-V by default.The reason is that Hyper-V makes exclusive use of VT-x, preventing HAXM andother third-party hypervisors (such as VMware and VirtualBox) from seeing thathardware feature. There are a number of ways to disable Hyper-V; one of them isto bring up the Start menu, type Windows Features and Enter, uncheckHyper-V in the resulting dialog, and click on OK to confirm.

  • Note that changing the Hyper-V setting could also trigger the alarm of thetamper protection mechanism (e.g. BitLocker) that may be enabled on your system.Again, make sure you won’t be locked out after the reboot.

Accelerating QEMU on Windows with HAXM (1)

Now you’re ready to install HAXM, which needs to run as a kernel-mode driver onWindows so as to execute the privileged VT-x instructions. Simply download thelatest HAXM release for Windows here, unzip, and runintelhaxm-android.exe to launch the installation wizard. (Despite the filename, Android is not the only guest OS that can be accelerated by HAXM.)

Accelerating QEMU on Windows with HAXM (2)

If you haven’t installed QEMU, now is the time to do it. I recommend getting thelatest stable release from here. At the time of thiswriting, the latest stable release is 2.10.1 (build 20171006), so I downloadedqemu-w64-setup-20171006.exe, which is an easy-to-use installer.

With all that, we’re ready to launch a real VM in QEMU. You can use yourfavorite QEMU disk image, provided that the guest OS installed there iscompatible with the x86 (i386) or x86_64 (amd64) architecture. My choice forthis tutorial is debian_wheezy_amd64_standard.qcow2, which contains a freshinstallation of the standard Debian Wheezy system for x86_64, availablehere. To boot it, open a new command prompt window, switchto your QEMU installation directory (e.g. cd "C:\Program Files\qemu"), andrun:

qemu-system-x86_64.exe -hda X:\path\to\debian_wheezy_amd64_standard.qcow2 -accel hax

You don’t have to leave the screen as the VM boots up, because soon you’ll beable to see the Debian shell and log in.

Accelerating QEMU on Windows with HAXM (3)

To feel the difference made by HAXM acceleration, shut down the VM, and relaunchit without -accel hax:

qemu-system-x86_64.exe -hda X:\path\to\debian_wheezy_amd64_standard.qcow2

If you’re still not impressed, try a more sophisticated VM image such asdebian_wheezy_amd64_desktop.qcow2, which boots to a desktop environment. VMslike this are hardly usable without hardware acceleration.

That’s it! I hope HAXM gives you a more enjoyable QEMU experience on Windows.You may run into issues at some point, because there are, inevitably, bugs inHAXM (e.g. booting an ISO image from CD-ROM doesn’t work at the moment). But thegood news is that HAXM is now open source on GitHub, so everyonecan help improve it. Please create an issue on GitHub if you have a question,bug report or feature request.

  • tutorials
  • HAXM
Accelerating QEMU on Windows with HAXM (2024)

FAQs

Can you run QEMU on Windows? ›

Install QEMU for Windows

After the installer file is downloaded, you can double-click it to run directly. Before doing that, I recommend you to create a partition separately for it.

How to enable KVM for QEMU? ›

To start QEMU in KVM mode, append -accel kvm to the additional start options. To check if KVM is enabled for a running virtual machine, enter the #QEMU monitor and type info kvm . Note: The argument accel=kvm of the -machine option is equivalent to the -enable-kvm or the -accel kvm option.

Does QEMU use hyper v? ›

Sometimes there are dependencies between enlightenments, QEMU is supposed to check that the supplied configuration is sane. When any set of the Hyper-V enlightenments is enabled, QEMU changes hypervisor identification (CPUID 0x40000000.. 0x4000000A) to Hyper-V.

How to create Linux VM with QEMU? ›

A Step-by-step guide to creating a Linux virtual machine on a Linux host with KVM,qemu,libvirt and ubuntu cloud images.
  1. Install KVM. ...
  2. Download a base image. ...
  3. Set a password for the new VM. ...
  4. Create a writable clone of the boot drive. ...
  5. Create a running VM. ...
  6. Enjoy your virtual machine.
Sep 10, 2022

Which is better, QEMU or VirtualBox? ›

How good is QEMU compared to Oracle VirtualBox or VMware virtualization platforms? For some purposes like reliable virtualization where you don't care about graphical performance, qemu can be better. For running foreign architecture OSes, qemu is the only one that has emulation.

Does QEMU need virtualization? ›

QEMU is a machine emulator that can run operating systems and programs for one machine on a different machine. However, it is more often used as a virtualiser in collaboration with KVM kernel components. In that case it uses the hardware virtualisation technology to virtualise guests.

What is the difference between KVM and QEMU? ›

KVM is a type-1 hypervisor, and QEMU is a type-2 hypervisor. That is the main difference between QEMU and KVM, but if you want to choose one for the long run, you need to learn about their unique features, and that means it's time for the ultimate comparison table. KVM vs. OpenVZ 2022: Which is the Virtualization Whiz?

What is the benefit of using QEMU with KVM? ›

The key differentiating factor is that KVM is kernel level while QEMU is a user level application. This provides KVM with much better performance for running the virtual machine session. QEMU allows VERDE VDI to communicate with KVM and implement virtualized devices that the virtual machine sessions require.

What OS can QEMU run? ›

  • Supported host architectures.
  • Linux OS, macOS, FreeBSD, NetBSD, OpenBSD.
  • Windows.

Does QEMU require Hyper-V or HAXM to work? ›

QEMU works best with Hyper-V, but it is not available with Windows Home edition. We recommend using VirtualBox hypervisor with this version. However, if you still wish to use QEMU, it is possible to install HAXM. HAXM only works with Intel CPUs.

Is QEMU a hypervisor or emulator? ›

It's often used in cloud and virtualization platforms and supports both paravirtualization and hardware virtualization. QEMU (Quick Emulator): QEMU is a versatile open-source emulator and virtualization tool that can be used as a hypervisor.

Is VMware better than QEMU? ›

Performance: Qemu tends to have slower performance compared to VMware vSphere. This is because Qemu emulates the hardware, which introduces additional overhead, while VMware vSphere's hypervisor runs directly on the physical hardware, providing better performance and efficiency.

Is there a GUI for QEMU? ›

Qemu-gui allows record executions and replay it. Execution is a scenario of work system inside qemu.

How to install QEMU img on windows? ›

Windows. Install qemu-img. Download the qemu-img installation package from https://qemu.weilnetz.de/w64/. Double-click the setup file to install qemu-img in D:\Program Files\qemu (an example installation path).

Can you run QEMU inside a VM? ›

QEMU virtual machines emulate all devices needed to run a VM Guest. QEMU supports, for example, several types of network cards, block devices (hard and removable drives), USB devices, character devices (serial and parallel ports), or multimedia devices (graphic and sound cards).

Can I run a Linux virtual machine on Windows? ›

You can use virtualization software such as Oracle VirtualBox or VMware to create a virtual machine running Linux within your Windows environment. This allows you to run Linux as a guest operating system alongside Windows.

Is QEMU better than VMware? ›

Performance: Qemu tends to have slower performance compared to VMware vSphere. This is because Qemu emulates the hardware, which introduces additional overhead, while VMware vSphere's hypervisor runs directly on the physical hardware, providing better performance and efficiency.

Can KVM run on Windows? ›

KVM is an open-source solution suitable for both Linux and Windows-based environments. It is easy to set up and manage and provides a high degree of flexibility. On the other hand, Hyper-V is a proprietary solution designed explicitly for Windows-based environments.

Top Articles
Latest Posts
Article information

Author: Annamae Dooley

Last Updated:

Views: 5689

Rating: 4.4 / 5 (65 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Annamae Dooley

Birthday: 2001-07-26

Address: 9687 Tambra Meadow, Bradleyhaven, TN 53219

Phone: +9316045904039

Job: Future Coordinator

Hobby: Archery, Couponing, Poi, Kite flying, Knitting, Rappelling, Baseball

Introduction: My name is Annamae Dooley, I am a witty, quaint, lovely, clever, rich, sparkling, powerful person who loves writing and wants to share my knowledge and understanding with you.