Skip to content

nixos/qemu-vm: virtiofsd requires shared memory - #563324

Merged
fricklerhandwerk merged 1 commit into
NixOS:masterfrom
jfly:fix-virtiofs-on-qemu
Sep 15, 2026
Merged

fricklerhandwerk merged 1 commit into
NixOS:masterfrom
jfly:fix-virtiofs-on-qemu

Conversation

@jfly

@jfly jfly commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

We recently switched to virtiofs for qemu-vms run on Linux
(#552774). I suspect we
only tested it with nixos tests, which just happen to enable shared memory
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
.

Reported by @fricklerhandwerk in
#552774 (comment).

Things done

@jfly
jfly force-pushed the fix-virtiofs-on-qemu branch from 138279e to a3e0468 Compare September 14, 2026 20:32
@jfly jfly mentioned this pull request Sep 14, 2026
4 of 13 tasks
@jfly
jfly force-pushed the fix-virtiofs-on-qemu branch from a3e0468 to a1ce3ff Compare September 14, 2026 20:40
@nixpkgs-ci nixpkgs-ci Bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Sep 14, 2026

@Erethon Erethon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per the reasoning in #552774 (comment) this makes sense to me

@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Sep 14, 2026
@nixpkgs-ci
nixpkgs-ci Bot requested a review from RaitoBezarius September 14, 2026 20:47
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. labels Sep 14, 2026
@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Sep 14, 2026
@zowoq

zowoq commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Targeting staging as this depends on #562444, which hasn't landed in master yet.

It landed in master with #563195.

We recently switched to virtiofs for qemu-vms run on Linux
(NixOS#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#552774 (comment)>.
@jfly
jfly force-pushed the fix-virtiofs-on-qemu branch from a1ce3ff to 0390e69 Compare September 14, 2026 22:47
@jfly
jfly changed the base branch from staging-nixos to master September 14, 2026 22:47
@jfly

jfly commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the FYI, @zowoq. I've retargeted this PR to land in master.

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 3+ This PR was reviewed and approved by three or more persons. and removed 12.approvals: 2 This PR was reviewed and approved by two persons. labels Sep 15, 2026
@fricklerhandwerk
fricklerhandwerk added this pull request to the merge queue Sep 15, 2026
@fricklerhandwerk

Copy link
Copy Markdown
Contributor

Thanks so much @jfly for investigating that one!

Merged via the queue into NixOS:master with commit 8a4c7e2 Sep 15, 2026
30 of 31 checks passed
@jfly
jfly deleted the fix-virtiofs-on-qemu branch September 15, 2026 13:37
@Ma27

Ma27 commented Sep 21, 2026

Copy link
Copy Markdown
Member

This breaks our test-suite:

❯ ~/Projects/nixpkgs-2 bisect/bad^2 [bisect] → nix-instantiate -A nixosTests.nixos-test-driver --sandbox-paths /dev/net --builders ''
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/zin1pcp7q472x77z4r408q80hl5wc30q-vm-test-run-Test-that-basic-tests-work-when-busybox-is-installed.drv
/nix/store/4f1j1valcrl3bz6l622qb47px5iyag9x-vm-test-run-nixos-test-driver.console-log.drv
/nix/store/mnw3q7px4w11q73l150aisv2wpqf70rv-vm-test-run-console-timeout.drv
/nix/store/jimfdsqczb2lpkzy81rwlpb473kpz2b7-container-and-vm-test-run-containers.drv
/nix/store/361c7g7hzs5li522if5alvsxwjcjfjv1-ensure-timeout-induced-failure.drv
/nix/store/r09aifdkrkj8p163r993z8wp377m4zfj-vm-test-run-efivars.drv
/nix/store/k1h6vqgli9d9d5b02xfmv337ni6890ig--test-run-extra-python-packages.drv
/nix/store/wqjijf76d567vdypd9afybvyj6hn3m4c-junit-xml-has-correct-testcases.drv
/nix/store/21sx1a6cb0jq3hfjzs93k8jcwfanjxkv-vm-test-run-multi-arch-test.drv
/nix/store/m5jwfmz7afjwbfpn9kkyfzawhm360hgp-vm-test-run-nixos-test-driver.node-name.drv
/nix/store/39ry5yrz8ppy93ac1v4wi5wjyhjfargk-container-test-run-nspawn-daemon-reexec-dbus.drv
error:
       … while evaluating an expression to select 'drvPath' on it
         at «internal»:1:551:
       … while evaluating strict
         at «internal»:1:551:
       … while evaluating the default value of option `virtualisation.qemu.enableSharedMemory`

       … while evaluating the option `virtualisation.host.pkgs':

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: A definition for option `virtualisation.host.pkgs' is not of type `An evaluation of Nixpkgs; the top level attribute set of packages'. Definition values:
       - In `/home/ma27/Projects/nixpkgs-2/nixos/modules/virtualisation/qemu-vm.nix'

       note: trace involved the following derivations:
       derivation 'nixos-test-driver-options-doc-regression'
       derivation 'nixos-system-nixos-26.11pre-git'
       derivation 'etc'
       derivation 'dbus-1'
       derivation 'system-path'
       derivation 'nixos-configuration-reference-manpage'
       derivation 'options.json'
❯ ~/Projects/nixpkgs-2 bisect/bad^2 [bisect] → g bisect bad
0390e69d8d8569776ceefd5ec424eb8e21dfed85 is the first bad commit
commit 0390e69d8d8569776ceefd5ec424eb8e21dfed85 (HEAD)
Author: Jeremy Fleischman <[email protected]>
Date:   Mon Sep 14 15:26:22 2026 -0500

    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
    <https://github.com/NixOS/nixpkgs/pull/552774#issuecomment-5668027063>.

 nixos/modules/virtualisation/qemu-vm.nix | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

@Ma27

Ma27 commented Sep 21, 2026

Copy link
Copy Markdown
Member

Fix in #565449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 3+ This PR was reviewed and approved by three or more persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants