Commit graph

68 commits

Author SHA1 Message Date
3146745a1e Bump deps, fix crosvm pulseaudio-rs git URL 2026-03-16 17:13:56 +00:00
00c9994e01 Bump wayland-proxy-virtwl to fix segfault 2026-03-10 16:03:32 +00:00
823cc4750d Fix memory leak in wayland proxy 2026-03-08 15:24:13 +00:00
cde2c3e727 crosvm: Add disable-msix option for PCI passthrough
Work around an annoying issue with the Intel AX210. It has a hardware bug
where the PCIe link will go into L1 before initialisation is complete. The
driver works around this by spamming read calls to an MSI-X register to keep
the link alive until firmware is ready. But these register accesses are
trapped by crosvm, and that's not fast enough.

As a shitty workaround, add an option to hide device MSI-X capability from
the VM. It should fall back to MSI. I hope.
2026-02-26 17:39:20 +00:00
ced153597a Improve battery life by not using polling for corked audio streams 2026-02-26 07:26:42 +00:00
86fe2d7f49 Fix wayland-proxy-virtwl build error 2026-02-25 23:26:30 +00:00
72b78e0573 Cork pulseaudio streams when VM pauses virtio-snd
Reduces unnecessary wakeups to improve battery life.
2026-02-25 22:54:41 +00:00
9b1b22df84 Bump wayland-proxy-virtwl (build warning fixes) 2026-02-25 22:53:51 +00:00
77ce2423d5 Fix audio capture configuration (was always enabled) 2026-02-25 21:19:40 +00:00
49fc439ebb Bump wayland-proxy-virtwl for build fix 2026-02-25 13:06:46 +00:00
7a3c610341 Bump crosvm
Adds a --disable-gpu-render-server-sandbox option for debugging
2026-02-21 02:51:23 +00:00
23a3cace1c crosvm gpu-render-server: more seccomp fixes 2026-02-21 01:23:06 +00:00
16b08cc3c8 Add nvidiaWeakenSandbox option to select crosvm-nvidia package
Nvidia GPU drivers require RWX memory pages, which crosvm's seccomp
sandbox blocks. This option switches to a crosvm-nvidia build with
a relaxed W+X memory policy, keeping the default secure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 00:46:58 +00:00
bc8659fed9 Fix seccomp crash with crosvm --gpu-render-server 2026-02-21 00:11:43 +00:00
5d29d8cc9e Use non-blocking socket mode for serial console
Enabled with changes in our crosvm fork. Prevents the VM locking up when
the PTY is full.
2026-02-20 14:08:07 +00:00
b9a06d83ec Bump crosvm to fix audio capture 2026-02-20 12:07:11 +00:00
e382e6003c Enable realtime priority for audio thread
crosvm changes for realtime audio, plus some minor log message improvements.

Also stop pinning nixpkgs as the upstream build failure has been resolved.
2026-02-19 17:33:49 +00:00
cd1fc27a4a Add sound capture support, bump crosvm and wayland proxy 2026-02-19 00:53:27 +00:00
2450a4f06f Implement wayland protocol whitelist for VM windows
Also pin nixpkgs to avoid build failure for deno in current master.
2026-02-18 11:44:37 +00:00
28dff03560 Add support for frog-color-management-v1, fifo-v1 and presentation-time 2026-02-15 22:08:47 +00:00
d080a41203 Bump wayland proxy for color-management-v1, color-representation-v1 and alpha-modifier-v1 2026-02-15 21:05:11 +00:00
28a554356e Bump wayland proxy for single-pixel-buffer-v1 support 2026-02-15 18:08:43 +00:00
5962f97df6 Update wayland-proxy-virtwl with fractional scaling 2026-02-15 17:42:13 +00:00
0d36da9f55 Move project under dsg gitlab namespace 2026-02-15 13:15:50 +00:00
dd992ada34 Fix crosvm-gpu crash with wayland security context (for reals this time) 2026-02-08 23:03:07 +00:00
17b4739325 Bump flake.lock for crosvm GPU seccomp policy fix 2026-02-08 22:01:14 +00:00
ba53a83762 flake.lock: Bump crosvm 2026-02-08 20:46:07 +00:00
d8b93f4e29 Fix vm-switch socket reconnection and add VIRTIO_F_VERSION_1
- Add VIRTIO_F_VERSION_1 feature flag required by Linux kernel for
  modern virtio devices
- Wrap daemon in reconnection loop so crosvm can reconnect after
  disconnecting (fixes "Connection refused" error)
- Add clear_state() to reset backend between connections
- Add INFO logging for client connect/disconnect and thread lifecycle

Also disable timestamps in crosvm output as journald already adds them.
Having two timestamps per log line is annoying.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 20:05:18 +00:00
3cc28f2d73 Fix crosvm pulse socket access when running as root 2026-02-07 15:20:59 +00:00
4d87706264 Run VMs as system services for PCI passthrough and sandboxing
- Convert systemd.user.sockets/services to systemd.sockets/services
- VMs run as root; crosvm drops privileges before starting guest
- Sockets in /run/qubes-lite/ with SocketUser for user access
- Add polkit rule so configured user can manage VM services
- Update soundDefault to use PulseAudio with user-specific paths
- Update wayland socket to explicit /run/user/<uid>/wayland-0
- vm-start-debug now requires sudo (root privileges)
- User must have explicit UID set in users.users

Also update documentation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 19:27:46 +00:00
b5295fbfa7 Add PCI passthrough support for hardware isolation
Add support for passing PCI devices (USB controllers, network cards)
directly to VMs using vfio-pci, enabling Qubes-style hardware isolation.

Features:
- isolatedPciDevices option to claim devices with vfio-pci at early boot
- Per-VM pciDevices option to pass devices to crosvm
- Activation script for runtime rebinding after nixos-rebuild switch
- Build-time assertions (devices must be isolated, no duplicates)
- Runtime IOMMU group validation before VM start
- BDF format normalization (accepts 01:00.0 or 0000:01:00.0)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 16:46:25 +00:00
0444be847f Organize VM apps into submenus in desktop menu
Instead of prefixing app names with the VM name, organize apps into
"VM: <name>" submenus using XDG menu integration. This creates a
cleaner menu structure:
  VM: banking → Firefox, Konsole
  VM: disposable → Firefox, Okular

Adds .directory files for submenu definitions and a .menu file to
configure the XDG menu grouping via custom categories.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 23:03:21 +00:00
615ac9633f WIP: Use crosvm with pipewire support 2026-02-04 22:26:24 +00:00
eb4e2ffcaa Add VM configuration options and migrate to --block
- Rename `disks` to `additionalDisks` with structured format
  (path, readOnly, enableDiscard, blockSize, devIdentifier, useDirect)
- Add custom boot options: rootDisk, kernel, initramfs, rootDiskReadonly
- Add kernelParams for extra kernel command line options
- Add gpu option (default: "context-types=cross-domain:virgl2")
- Add sharedDirectories for crosvm --shared-dir
- Add global crosvmLogLevel option (default: "info")
- Add --name argument to crosvm set to VM name
- Migrate deprecated --disk/--rwdisk to --block format
- Switch flake to nixos-unstable channel

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 19:09:51 +00:00
03eb42e48b Reenable server-side decoration forcing
The double-decoration crash issue has been fixed. Verified that both konsole
(prefers server-side decorations) and firefox (prefers client-side) work and
show server-side decorations.
2026-02-04 17:16:32 +00:00
5e584681dc Revert server-side decoration forcing
Did not work with native wayland clients. Fixes:
```
feb 04 15:48:07 stofa crosvm[356756]:  [devices/src/virtio/gpu/mod.rs:759] error processing gpu command CmdSubmit3d: ErrRutabaga(RutabagaError { kind: NixError(EPIPE), context: None })
feb 04 15:48:07 stofa crosvm[356756]:  [devices/src/virtio/gpu/protocol.rs:973] Returning VIRTIO_GPU_RESP_ERR_UNSPEC for error ErrRutabaga(RutabagaError { kind: NixError(EPIPE), context: None })
```
2026-02-04 16:03:00 +00:00
3450465149 Bump crosvm (rebased on latest upstream) 2026-02-04 16:03:00 +00:00
1fcad4dca8 Add treefmt-nix formatter and clean up idiomatic Nix patterns
- Add treefmt-nix with nixfmt for code formatting (nix fmt)
- Extract cidrToNetworkBase and mkVmCase helper functions
- Use lib.nameValuePair for cleaner listToAttrs patterns
- Consolidate assertions with single let block
- Remove duplicate util-linux package
- Document formatting requirement in CLAUDE.md
- Apply nixfmt to all Nix files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 16:02:43 +00:00
6d06c1d5a2 crosvm: Allow madvise(MADV_GUARD_INSTALL) 2026-02-04 11:40:58 +00:00
45ffac9190 Update crosvm GPU seccomp policy to fix segfaults
Allow madvise(MADV_NOHUGEPAGE), setsockopt and sendmmsg. nvidia driver
calls XOpenDisplay which triggers DNS resolution so these are needed.
2026-02-04 11:09:51 +00:00
7274fafbdc Force server-side decorations
Use my wayland-proxy-virtwl fork. Unconditionally requests server-side
decorations even if the client doesn't want them.

Tested with firefox, works there.
2026-02-04 09:39:57 +00:00
b46e11d551 Use my crosvm fork for nVidia compat, home paths 2026-02-03 19:18:07 +00:00
Thomas Leonard
76c845a22f Update to NixOS 25.11
Changes needed:

- Some minor renaming for nixpkgs changes.
- Kernel modules now come from a separate output.
- dash over vsock seems to be broken; switched to bash.
  (it seems to be trying to use the console instead of the vsock)
2025-12-01 12:24:02 +00:00
Thomas Leonard
6bb8e07552 Allow configuring guest packages 2025-11-19 12:12:03 +00:00
Thomas Leonard
8f24386f06 Update to nixos-25.05 stable branch 2025-05-24 09:12:41 +01:00
Thomas Leonard
afb5b6221b Update crosvm to fix selections crash 2025-05-17 15:44:52 +01:00
Thomas Leonard
e7514f2358 Update to nixos 25.05 beta 2025-05-17 10:02:59 +01:00
Thomas Leonard
82badddf74 Update flake.lock
Mainly to get new Wayland proxy with viewport support.
2025-03-08 14:25:45 +00:00
Thomas Leonard
74e440061e Update wayland proxy
Fixes segfault.
2025-01-07 13:28:26 +00:00
Thomas Leonard
57e84cceef Update to NixOS 24.11 2024-12-28 16:20:03 +00:00