mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-29 20:02:46 +01:00
chore(scripts): probe a WSL2 NixOS VM for KVM, WSLg and RDP
The port can only be tried on a Windows machine, through a NixOS virtual machine in WSL2, which the machines this history is built on do not have. What such a machine can do for a Plasma guest is not known until something runs there, and every guess about it is a risk for what comes next. wsl2-probe is that something: one command, nix run .#wsl2-probe, that answers in about two minutes what the guest needs to know and prints, for each answer that is not a yes, the exact change: the .wslconfig lines, the NixOS option, the PowerShell command. It checks the environment (WSL2, memory, disk, .wslconfig, Nix); KVM (/dev/kvm, its group, and a tiny guest booted under KVM and under TCG, with the same loop timed in both and on the machine itself, which must differ by several times); the display (a QEMU GTK window through WSLg for a few seconds, and whether you saw it); the GPU (/dev/dxg, the Windows driver libraries, the OpenGL renderer in four environments, and virtio-vga-gl with gl=on); the Windows side (interop, mstsc.exe, whether Windows reaches a port that WSL listens on); whether memory, cores and disk are enough for the real guest; and virtiofs, which the real guest uses for its /nix/store and every shared directory (/dev/fuse, virtiofsd as the user with the options of nixpkgs' runner, and a guest that mounts the host's /nix/store and a writable directory, reads, writes and compares). Each probe runs apart from the others, so one that fails leaves the rest alone, and the output ends in a block to paste back, which is also written to wsl2-probe-report.txt. The flake wraps the script with QEMU, virtiofsd, Mesa's eglinfo and glxinfo and socat from nixpkgs, and builds the guest, a kernel from the binary cache, the two modules of it that virtiofs needs and a static busybox initrd, as wsl2-probe-guest, so nothing is compiled on the machine. Two checks keep the script from rotting: wsl2-probe builds the wrapper, which runs ShellCheck over the script and over the guest's init, and wsl2-probe-dry-run runs --dry-run in the build sandbox, which has no KVM, no network and no display. docs/dev/wsl2-probe.md says what each check means and how to read it.
This commit is contained in:
1 parent
1dde9fd257
commit
9b60a0020d
11 files changed
+2150
-3
No files matched your search
@@ -34,6 +34,10 @@ it.
|
||||
TCG is software emulation. It is slow enough that only short suites are worth
|
||||
running that way, and the library's `scale` argument (below) is 8 for it.
|
||||
|
||||
Whether a machine has working KVM is not always obvious, and under WSL2 it
|
||||
depends on settings of Windows. `nix run .#wsl2-probe` boots a tiny guest with
|
||||
and without KVM and times both ([wsl2-probe.md](wsl2-probe.md)).
|
||||
|
||||
The suites are what `testedMax` in
|
||||
[`nix/supported-kwin.nix`](../../nix/supported-kwin.nix) means: the newest KWin
|
||||
every suite has passed against. When the weekly canary job, which runs every
|
||||
|
||||
Reference in new issue
Block a user