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.
| Area | Works and tested | Not yet |
|---|---|---|
| Daemons | modular and monolithic, reload, stop, reconnection | Windows services |
| Remote | UNIX sockets, ext transport | ssh (untested), TLS |
| QEMU | lifecycle, console, screenshot, QMP, hotplug, balloon, memory stats | save/restore, migration, snapshots |
| Guest networking | user, network, bridge to a libvirt network | ethernet and host bridges (TAP) |
| Virtual networks | nat, isolated, DHCP, DHCPv6, DNS, IPv6, QoS | route and open (need Wintun, untested) |
| Other drivers | secrets | storage, nodedev, interface, nwfilter, LXC |
How it works
The POSIX and Linux mechanisms libvirt relies on, and what takes their place.
| On Linux | On this port |
|---|---|
fork + exec | CreateProcess suspended, resumed after the handshake |
| Signals | named events, console control handlers |
| PTY consoles | QEMU serial on a UNIX socket |
| KVM | WHPX, TCG otherwise |
| Bridge, TAP, dnsmasq, iptables | libvirt_netswitch: one process per network, an Ethernet switch that QEMU joins with -netdev stream, libslirp for NAT, its own DHCP and DNS |
tc | token buckets in the switch |
| Symbolic links | symbolic 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.
- 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
- Put
install\bin,C:\msys64\ucrt64\binand QEMU onPATH, then start the daemons:install\sbin\virtnetworkd.exe --daemon install\sbin\virtqemud.exe --daemon
- Define a guest of type
whpxand 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.