You are here:Home»KB»PC»Virtual Machines»My QEMU Notes
Wednesday, 09 September 2026 12:17

My QEMU Notes

Written by

These are my QEMU notes

  • KVM gives access to the host hardware through the kernel.
  • QEMU emulates the hardware.

How to QEMU install on Windows

Main Software

Frontend GUI for QEMU on Windows

QEMU is by it's nature only a command line application, however you can install QtEMU (Windows) or virt-manager (Linux).

Batch File

This is an example batch script to run QEMU directly from the command line.

This will run a virtio-blk, RAW image file, Logical and Physical sectors set to 4096 and boots with UEFI (GPT, with an EFI System Partition)?

if not exist "D:\VM Backups\Web_Server_OVMF_VARS.fd" copy "C:\Program Files\qemu\share\edk2-i386-vars.fd" "D:\VM Backups\Web_Server_OVMF_VARS.fd"

"C:\Program Files\qemu\qemu-system-x86_64.exe" ^
-L "C:\Program Files\qemu\share" ^
-drive if=pflash,format=raw,readonly=on,file="C:\Program Files\qemu\share\edk2-x86_64-code.fd" ^
-drive if=pflash,format=raw,file="D:\VM Backups\Web_Server_OVMF_VARS.fd" ^
-monitor tcp:127.0.0.1:36000,server,nowait ^
-cpu qemu64 ^
-k en-gb ^
-vga std ^
-machine pc ^
-accel whpx ^
-drive file="D:\VM Backups\Web_Server_disk_2026-09-09.raw",if=none,id=drive0,format=raw ^
-device virtio-blk-pci,drive=drive0,logical_block_size=4096,physical_block_size=4096 ^
-net nic,model=virtio-net-pci ^
-net user ^
-serial tcp:127.0.0.1:1370,server,nowait ^
-rtc base=localtime,clock=rt ^
-object rng-builtin,id=rng0 ^
-device virtio-rng-pci,rng=rng0 ^
-device virtio-balloon-pci ^
-device virtio-keyboard-pci ^
-device qemu-xhci,id=aqemu_usb_hub ^
-name test ^
-display sdl,show-cursor=on,gl=on
  • Notes
    • edk2-x86_64-code.fd / edk2-i386-vars.fd are the filenames used by the official QEMU-for-Windows builds (weilnetz.de)
    • You can simply just change the -drive line if you want to swap the image type.
      raw
      -drive file="D:\VM Backups\Web_Server_disk_2026-09-09.raw",if=none,id=drive0,format=raw ^
      
      qcow
      -drive file="D:\VM Backups\Web_Server_disk_2026-09-09.qcow",if=none,id=drive0,format=qcow ^
      
      qcow2
      -drive file="D:\VM Backups\Web_Server_disk_2026-09-09.qcow2",if=none,id=drive0,format=qcow2 ^
      • The ^ is a batch file thing to say, this is not the end of the line, carry on. It allows you to split one long line for easier reading. ` (backtick) is the PowerShell version.
    • This is for a virtio-scsi disk
      -device virtio-scsi-pci,id=scsi0 \
      -drive file=disk.qcow2,if=none,id=drive0,format=qcow2 \
      -device scsi-hd,drive=drive0,bus=scsi0.0,physical_block_size=4096,logical_block_size=4096
  • 512/4096/4Kn Sectors
    • QEMU exposes logical_block_size and physical_block_size as device properties on the drive/device (not on qemu-img). You set them via -device (or -global), not as a qemu-img switch. 
    • if you want to run 512 sectors, you can do one of the following:
      • Remove the physical_block_size and logical_block_size values
      • Change them to 512. physical_block_size=512 and logical_block_size=512 values
    • You can apply these globally instead of per individual device
      -global scsi-hd.physical_block_size=4k -global scsi-hd.logical_block_size=4k
      • will set the physical and logical sector size for all virtual SCSI disks for your VM.

Hardware Devices

Information relating to QEMU hardware devices

  • BIOS
  • AHCI
    • An AHCI-attached drive in QEMU is locked to 512-byte logical sectors. This isn't an AHCI-specific limit, it's baked into the underlying IDE device model that AHCI ports use.
      • QEMU's AHCI controller (hw/ide/ahci.c) doesn't implement its own disk device — each SATA port is just an IDEBus with an ide-hd/ide-cd device attached (-device ide-hd,drive=X,bus=ahci.0).
      • That device realization code in hw/ide/ide-dev.c explicitly enforces: "logical_block_size must be 512 for IDE". See https://git.zx2c4.com/qemu/plain/hw/ide/ide-dev.c
      • physical_block_size is not restricted — only logical_block_size is pinned to 512. So you can do "512e" emulation (4Kn-style physical alignment reported to the guest, but still addressed in 512-byte logical sectors):
    • Don't use this except where compatibility is required for the Guest OS.

Troubleshooting

QtEMU

  • QtEMU will not start a virtual machine and you get these errors: `tcp whpx` and `Accelerators supported in QEMU binary:`
     
    • Cause
      • The "Windows Hypervisor Platform" is not enabled.
    • Solution
      • Enable the Windows Hypervisor Platform (WHPX)
      • Enable the Accelerator in QtEMU 
        • QtEMU --> Machine Settings/Preferences --> Accelerator --> Windows Hypervisor Platform (WHPX)
        • NB:
          • Tiny Code Generator (TCG) - no idea what this is
          • Hardware Accelerated Execution Manager (HAXM) - Is no longer supported

Windows Hypervisor Platform (WHPX)

Might move to its own page

Enable

  • Instructions
    • Press Win + R, type OptionalFeatures.exe, and press Enter.
    • In the Windows Features dialogue that appears, you need to turn these on (including their child options)
      • Hyper-V
        • Hyper-V Management Tools
        • Hyper-V Platform
    • Click OK and wait for the process to complete.
    • Restart your PC to apply the changes.
  • Links

Using

Links

  • Official Software
  • Documentation
    • Disk Images — QEMU documentation - QEMU supports many disk image formats, including growable disk images (their size increase as non empty sectors are written), compressed and encrypted disk images.
    • QEMU block drivers reference — QEMU documentation
      • QEMU supports many image file formats that can be used with VMs as well as with any of the tools (like qemu-img). This includes the preferred formats raw and qcow2 as well as formats that are supported for compatibility with older QEMU versions or other hypervisors.
      • Depending on the image format, different options can be passed to qemu-img create and qemu-img convert using the -o option. This section describes each format and the options that are supported for it.
  • Tutorials
    • Stop using Virtualbox, Here's how to use QEMU instead - YouTube - In the first 60 seconds of this video I benchmark Virtualbox vs QEMU. Then follow my quick guide to get QEMU working on YOUR system!
    • QEMU KVM Tutorial for Beginners | Run Windows & Linux on Linux - YouTube
      • Want to run Windows 11 inside Linux, test other Linux distributions, or safely experiment with software without touching your main operating system? In this beginner-friendly tutorial, I'll show you how to install and configure QEMU and KVM on Debian 13, one of the fastest and most powerful virtualization solutions available for Linux.
      • Unlike VirtualBox or VMware, QEMU and KVM take advantage of hardware virtualization to deliver near-native performance, making them ideal for developers, home lab enthusiasts, system administrators, and anyone who needs reliable virtual machines.
      • uses virt-manager for the frontend.
    • QEMU QED
      • The missing manual for QEMU for digital preservation
      • QEMU is also a complex application with a vast range of configuration options. QEMU QED is intended to lower the barrier to first-time users by breaking down QEMU use into more digestible concepts and recipes.
  • Frontend Software (Windows)
  • Frontend Software (Linux)
    • Virtual Machine Manager
      • The virt-manager application is a desktop user interface for managing virtual machines through libvirt.
      • It primarily targets KVM VMs, but also manages Xen and LXC (linux containers).
  • Installing QEMU on Windows
    • QEMU on Windows 10 - Shells KB - Step-by-step guide to install QEMU on Windows 10. Complete tutorial with commands and configuration.
    • How to Install QEMU on Windows: A Simple Guide for Virtualization Enthusiasts
      • So, you want to install QEMU on Windows. Maybe you’ve heard about its reputation as a powerful virtualization tool, or maybe you just want to experience the thrill of running Linux, Windows, or other systems without sacrificing your main setup. Either way, QEMU (Quick Emulator) is a flexible open-source option that can emulate and run multiple operating systems on one machine.
      • Here’s a step-by-step guide on how to install QEMU on Windows, from setup to configuration, with just the right dose of tech and simplicity.
  • QEMU Command Line Generators  (Some are better than others)
Read 36 times Last modified on Wednesday, 16 September 2026 14:43