Windows: would you consider a libkrun/WHP VM backend instead of a WSL 2 distro?

Open
#336 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
docker, linux, rust

Research direction

Start by reading crates/kiri-vmm and docs/features.md to understand the existing Virtualization.framework backend and the Windows WSL bridge described in the issue. Then check libkrun's current WHP support and whether its kernel, vsock, networking, and memory features meet Kiri's needs. Done would require a reviewed backend proposal covering feasibility, Windows guest assets, and tradeoffs; the issue does not specify implementation steps.

Written by the indexing model from the issue text.

Description

Kiri on Windows today runs the x86-64 Linux build inside a WSL 2 distro, and kiri-win.exe carries the engine API over npipe through one wsl.exe … kiri bridge. That keeps the host side small, but it also means the guest Kiri runs on Windows is Microsoft's kernel, not the 10 MB kernel in guest/kernel that the macOS path is built around. A fair number of the open Windows issues trace back to that one fact:

  • #277 — the WSL kernel boots a hybrid cgroup tree, so kiri-init exits 1
  • #44 — no MASQUERADE rule, so bridge-network containers have no egress
  • #60 — containers reach the internet unfirewalled on kernels before 6.3
  • #209 — BuildKit has no usable DNS
  • #189 — Stop leaves vmmemWSL running with its memory unclaimed
  • #297, #314, #318 — the distro itself as an install and lifecycle dependency
  • and the engine API has to stay on npipe, because WSL's localhost relay drops half-closes (docs/features.md)

So: would you consider giving Windows a VM backend of Kiri's own — libkrun and the Windows Hypervisor Platform — instead of a WSL 2 distro?

What that would bring to the architecture Kiri already has:

  • Your own guest kernel. krun_set_kernel takes a raw Image, so guest/out/Image and its four patches could be the Windows kernel too — cgroup v2, netfilter, the GSO/GRO fixes — instead of whatever WSL ships.
  • A real vsock channel. libkrun provides virtio-vsock, and krun_add_vsock hands the host plain listen/connect fds: the same shape as the kiri-proto link on macOS, and it removes the reason the Windows API sits on npipe at all.
  • virtio-net with host port forwarding, instead of a relay that drops half-closes, plus TSI for containers that only need outbound.
  • virtio-fs and virtio-block — the same devices crates/kiri-vmm already drives on Virtualization.framework, so Windows would be a sibling backend rather than a separate engine.
  • Memory that goes back to Windows. virtio-balloon plus idle vCPUs sleeping in the hypervisor is what #189 asks for. libkrun's own balloon is free-page reporting only, so this one needs checking before it counts.
  • Less install surface. One signed .msi, no distro, no Store, no separate wsl --update to keep working.

What it costs, as far as I can tell: WHP is still a Hyper-V platform feature, so the virtualization prerequisite does not go away (the WSL distro does); libkrun's own README still lists WHP as upcoming; and the WHP path is x86-64 only as far as I can see, so Kiri's Windows on Arm build would be the odd one out or at least unproven. The work is a new backend, not a port.

The only existing evidence I have that libkrun on WHP runs at all is smolvm, which I am mentioning as a data point, not as something for Kiri to depend on. What I would like to know:

  1. Is WSL 2 the intended long-term Windows story, or a stepping stone?
  2. Have you looked at libkrun/WHP and set it aside? If so, on what ground — vsock on Windows, USB passthrough, signing, or the maintainer cost?
  3. Would you review a proposal for a second VM backend? If yes, how would you want the Windows guest assets (kernel, data disk) built and shipped?

Thanks — the macOS and Linux paths are genuinely impressive, and Windows is the one place where it does not feel like the same engine.

Dominant language
Rust
Stars
7.5k
Forks
329
Avg merge
7h 48m
Merged PRs (30d)
105

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from libracoder/kiri

All issues in libracoder/kiri

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.