com.harryaskham.krun-display · Swift · Metal · libkrun · Apple silicon
Krun Display
A native display for Linux virtual machines on Apple silicon. A headless virtual-machine monitor built on libkrun gives the guest Vulkan on the Mac's GPU through virtio-gpu Venus and MoltenVK. The Krun Display app shows the guest's screen in a Metal window and sends keyboard, pointer and scroll input back. It can attach and detach at any time without disturbing the guest.
Frames without a copy
libkrun's display backend asks the VMM for a frame buffer, writes the guest's scanout into it and presents it with the damaged rectangles. Each scanout generation is one page-aligned shared file holding three frame slots; the app maps it once and wraps each slot in a shared-storage Metal texture. When a row stride does not meet Metal's alignment, the app uploads that slot instead.
Input
- No grab. The guest sees an absolute tablet, so its pointer follows the Mac's inside the window and leaves with it.
- Command is Super. ⌘Q ⌘W ⌘H ⌘M and ⌃⌘F stay with the Mac; other Command shortcuts go to Linux.
- Smooth scrolling. Trackpads and wheels send high-resolution wheel events.
- One pointer. The Mac pointer hides over the display by default, since the guest draws its own.
Status
A first pass: one scanout per window, a fixed display size per boot, and no clipboard, audio or cursor plane yet. The guest needs the virtio_gpu and virtio_input drivers.