From 0390e69d8d8569776ceefd5ec424eb8e21dfed85 Mon Sep 17 00:00:00 2001 From: Jeremy Fleischman Date: Mon, 14 Sep 2026 15:26:22 -0500 Subject: [PATCH] nixos/qemu-vm: virtiofsd requires shared memory We recently switched to virtiofs for qemu-vms run on Linux (https://github.com/NixOS/nixpkgs/pull/552774). I suspect we only tested it with nixos tests, which just [happen to enable shared memory](https://github.com/NixOS/nixpkgs/blob/673028b7b1845fb74dab830518892c917634b95a/nixos/lib/testing/driver.nix#L259) for the ssh backdoor. However, for folks using qemu-vm.nix outside of nixos tests, they'll experience virtiofsd crashing with [some very obtuse messages](https://gitlab.com/virtio-fs/virtiofsd/-/work_items/127). Reported by @fricklerhandwerk in . --- nixos/modules/virtualisation/qemu-vm.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index 61366c3ea75f..3afe34f0a2a7 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -741,7 +741,11 @@ in }; virtualisation.qemu = { - enableSharedMemory = mkEnableOption "shared memory"; + enableSharedMemory = mkOption { + type = types.bool; + default = useVirtiofs; # Need shared memory for virtiofs: + description = "Enable shared memory"; + }; package = mkOption { type = types.package;