libvirt-windows

libvirt, native on Windows.

An unofficial port of libvirt 12.9.0 to Windows x64: virsh, the daemons and QEMU guests accelerated by the Windows Hypervisor Platform. libvirt's own code with its platform layers ported, so the same API, XML and commands.

PS> install\sbin\virtqemud.exe --daemon
PS> virsh -c qemu:///system start guest
Domain 'guest' started
PS> virsh -c qemu:///system net-dhcp-leases default
 Expiry Time           MAC address         Protocol   IP address         Hostname
--------------------------------------------------------------------------------
 2026-11-06 17:54:49   52:54:00:6e:65:74   ipv4       192.168.122.2/24   ubuntu
PS> virsh -c qemu:///system console guest
Connected to domain 'guest'
Escape character is ^] (Ctrl + ])
ubuntu@ubuntu:~$

Not an official libvirt release, and not affiliated with the libvirt project. The Windows changes were written with an AI assistant; libvirt declines contributions that include AI-generated content, so nothing here is to be submitted upstream. Experimental: try it on machines you can afford to break.

What it does

Tested on Windows 11 with Ubuntu 24.04 guests.

The libvirt daemons

libvirtd or the modular virtqemud, virtnetworkd, virtsecretd…, on AF_UNIX sockets, running in the background and taking guests back after a restart.

QEMU with WHPX

<domain type='whpx'>: start, stop, suspend, resume, screenshots, QMP, NIC hotplug, a memory balloon that gives memory back.

virsh console

The guest's serial port on a UNIX socket, typed into from the Windows console, with libvirt's single-session rule and --force.

Virtual networks

NAT and isolated networks without any driver: DHCP, DHCPv6, DNS, IPv6, net-update, leases, guests talking to each other and to the host.

QoS and statistics

domiftune limits, floors and network bandwidth, applied by the network's switch; domifstat counters.

Upgrade in place

Install over running daemons, networks and guests; edited configuration files are kept.

Status

What works, and what is not done or not tested yet.

AreaWorks and testedNot yet
Daemonsmodular and monolithic, reload, stop, reconnectionWindows services
RemoteUNIX sockets, ext transportssh (untested), TLS
QEMUlifecycle, console, screenshot, QMP, hotplug, balloon, memory statssave/restore, migration, snapshots
Guest networkinguser, network, bridge to a libvirt networkethernet and host bridges (TAP)
Virtual networksnat, isolated, DHCP, DHCPv6, DNS, IPv6, QoSroute and open (need Wintun, untested)
Other driverssecretsstorage, nodedev, interface, nwfilter, LXC

How it works

The POSIX and Linux mechanisms libvirt relies on, and what takes their place.

On LinuxOn this port
fork + execCreateProcess suspended, resumed after the handshake
Signalsnamed events, console control handlers
PTY consolesQEMU serial on a UNIX socket
KVMWHPX, TCG otherwise
Bridge, TAP, dnsmasq, iptableslibvirt_netswitch: one process per network, an Ethernet switch that QEMU joins with -netdev stream, libslirp for NAT, its own DHCP and DNS
tctoken buckets in the switch
Symbolic linkssymbolic links, or the system files of Cygwin and MSYS2

Quick start

Windows 10 1803 or later, x64, with MSYS2 (UCRT64) and QEMU for Windows built with the patch in windows/qemu.

  1. Build and install from an MSYS2 UCRT64 shell:
    git clone --recurse-submodules https://github.com/EGKrb/libvirt-windows
    cd libvirt-windows
    windows/build.sh deps
    windows/build.sh
  2. Put install\bin, C:\msys64\ucrt64\bin and QEMU on PATH, then start the daemons:
    install\sbin\virtnetworkd.exe --daemon
    install\sbin\virtqemud.exe --daemon
  3. Define a guest of type whpx and start it, as with libvirt anywhere:
    virsh -c qemu:///system define guest.xml
    virsh -c qemu:///system start guest

The README has a complete guest definition, how to stop a daemon and where the files are.