NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.71k stars 13.85k forks source link

nixos/libvirt: Unable to find a satisfying virtiofsd #187078

Closed bbjubjub2494 closed 9 months ago

bbjubjub2494 commented 2 years ago

Describe the bug

libvirt fails to start KVM domains when a virtiofs filesystem is present.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Enable libvirtd
  2. Run virt-install -n scratch --connect qemu:///system --os-variant nixos-unstable --memory 1536 --memorybacking=access.mode=shared --disk none --import --filesystem /nix/store/,nix-store,driver.type=virtiofs
  3. ERROR operation failed: Unable to find a satisfying virtiofsd

Expected behavior

It should "just work" for good UX

Additional context

This probably requires patching libvirt. I don't understand the codebase enough to do so.

I tried upgrading libvirt to 8.5.0, it doesn't seem to change anything.

There is a workaround:

Maintaining <binary path='/run/current-system/sw/bin/virtiofsd' xattr='on'> through all XML's seems ugly

Originally posted by @kvtb in https://github.com/NixOS/nixpkgs/issues/113172#issuecomment-1114183820

Notify maintainers

@fpletz @globin @lovesegfault @Kranzes

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.59, NixOS, 22.05 (Quokka), 22.05.20220815.3d47bba`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.8.1`
 - nixpkgs: `/etc/nix/channels/nixos`
cyounkins commented 1 year ago

Minor clarification: the tag needs a self-closing / so it's <binary path='/run/current-system/sw/bin/virtiofsd' xattr='on'/>, and it goes in the filesystem section.

nixos-discourse commented 1 year ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/libvirt-session-mode-and-virtiofs/27857/4