TechBuzzPro

How to Use QEMU to Run Windows 10 or 11

· 5 min read · Windows & PC

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can run Windows on QEMU. It works by virtualizing the CPU and hardware components to create an isolated environment where a Windows ISO image boots as if it were physical hardware. This method is ideal for testing software, running legacy applications, or isolating potentially malicious files without risking your main operating system.

What You'll Need

  • A host machine running Linux, macOS, or Windows (Linux is recommended for performance).
  • QEMU installed on your host system.
  • A valid Windows installation ISO file (Windows 10 or 11).
  • Sufficient storage space: at least 64GB for the virtual disk, plus space for the ISO.
  • At least 4GB of RAM allocated to the VM (8GB+ recommended for smooth operation).
  • Basic familiarity with terminal commands or command-line interfaces.

Step-by-Step

  1. Create a Virtual Disk: Open your terminal or command prompt. Create a raw disk image that will serve as the hard drive for your Windows VM. For example, use the command qemu-img create -f qcow2 windows.img 64G. This creates a 64GB dynamically expanding image named "windows.img".
  2. Prepare the ISO: Ensure your Windows ISO file is accessible from the directory where you plan to run QEMU. Let's assume it is named windows.iso.
  3. Run the Initial Command: Execute the following command to start the VM with the necessary parameters:
    qemu-system-x86_64 \
      -m 4096 \
      -cpu host \
      -enable-kvm \
      -drive file=windows.img,format=qcow2 \
      -cdrom windows.iso \
      -boot d \
      -netdev user,id=net0 \
      -device virtio-net-pci,netdev=net0 \
      -device virtio-scsi-pci \
      -device usb-tablet \
      -vga std \
      -soundhw ac97
    Note: If you are on macOS or Windows without KVM support, remove the -enable-kvm flag. Performance will be slower but functional.
  4. Install VirtIO Drivers: Before installing Windows, you must attach the VirtIO driver ISO. Download the latest VirtIO drivers from the Fedora Project repository. Add another CD-ROM device to your QEMU command line pointing to the VirtIO ISO: -drive file=virtio-win.iso,format=raw,media=cdrom. Restart the VM with this additional parameter.
  5. Boot into Windows Installer: The VM should boot from the Windows ISO. Proceed through the initial language and region selection screens.
  6. Select Custom Install: When asked where to install Windows, choose "Custom: Install Windows only (advanced)." Select the unallocated space corresponding to your windows.img drive.
  7. Load Storage Drivers: During the installation, when asked to select a drive, you may see no drives available because standard drivers are not loaded. Click "Load Driver," browse to the VirtIO CD-ROM, and navigate to the virtio-win folder. Select the appropriate storage driver (usually under viostor for SCSI controllers) and load it. The drive should now appear.
  8. Complete Installation: Continue with the standard Windows setup process. Once Windows boots for the first time, shut it down.
  9. Remove ISOs and Optimize: Edit your QEMU command to remove the -cdrom references for both the Windows ISO and the VirtIO ISO. Keep the -drive file=windows.img part. Also, ensure you have -cpu host and -enable-kvm (if supported) for maximum performance. Start the VM again; it should boot directly into your new Windows installation.
  10. Install Guest Tools: Inside Windows, mount the VirtIO ISO again via Device Manager or the QEMU monitor to install network, graphics, and balloon drivers. This ensures proper resolution, internet connectivity, and memory management.

Common Mistakes

One frequent error is forgetting to load the VirtIO storage drivers during installation, which leaves the installer unable to see the virtual hard drive. Another mistake is using the default VGA adapter instead of -vga std or -vga qxl, resulting in poor graphical performance and low screen resolution. Users also often neglect to add -usb-tablet, causing mouse cursor lag and misalignment within the guest OS.

Tips

Use -cpu host to pass through your host CPU features, significantly improving performance over generic emulation. Always allocate enough RAM; Windows 10/11 struggles with less than 4GB. If you experience slow disk I/O, consider using cache=writeback in the drive definition, though this slightly increases the risk of data corruption if the host crashes. For better graphics, install the SPICE guest tools after installation.

Troubleshooting

If the VM fails to boot, check that the ISO path is correct and the file exists. If you get a "No bootable device" error, ensure -boot d is set and the ISO is attached. If the mouse behaves erratically, verify -usb-tablet is included. For network issues, confirm that the VirtIO network driver is installed in Windows and that the -netdev user configuration is active. If the system hangs during boot, try reducing the allocated RAM or switching from KVM to TCG emulation by removing -enable-kvm to rule out hardware compatibility issues.

Frequently Asked Questions

Can I run Windows 11 on QEMU?

Yes, but you may need to bypass TPM 2.0 and Secure Boot checks using specific QEMU flags or registry edits inside the guest, as standard QEMU does not emulate these natively by default.

Is QEMU faster than VirtualBox or VMware?

On Linux, QEMU with KVM is generally faster and more lightweight. On Windows or macOS, it may require additional configuration to achieve comparable performance to native hypervisors.

Do I need a license key for Windows in QEMU?

Yes, you must activate Windows with a valid product key. Unactivated Windows will have limitations like personalization restrictions and periodic notifications.

Can I access my host files from the Windows VM?

Not directly by default. You can share folders using Samba/NFS on the host and accessing them via the network in Windows, or use 9p filesystem mounting if configured.

Why is my mouse cursor stuck or laggy?

This usually happens because the pointer is not synchronized with the guest. Adding -usb-tablet to your launch command fixes this by sending absolute mouse coordinates.

Does QEMU support GPU passthrough?

Advanced users can configure GPU passthrough (VFIO), but it requires complex setup involving IOMMU grouping and kernel parameters. It is not supported out-of-the-box.