USB redirection error on kvm

I want to redirect the USB input/output into my virtual machine. But I get this error


I have no idea why. This is my nix module for virtualisation:

{pkgs, config, lib, user, ... }:

{
  options = {
    modules.virtualisation.virt-manager.user = lib.mkOption {
      type = lib.types.str;
      default = "root"; 
      example = "Specify a user to be added to the libvirt group";
    };

  modules.virtualisation.virt-manager.enable = lib.mkOption {
    type = lib.types.bool;
    default = false;
    example = "Whether to enable this libvirt and virt-manager";
  };
  };

  config = lib.mkIf config.modules.virtualisation.virt-manager.enable {

  environment.systemPackages = with pkgs; [
  spice-gtk
  virt-viewer
  ];
    virtualisation.libvirtd.enable = true;
    programs.virt-manager.enable = true;
    users.users.${config.modules.virtualisation.virt-manager.user}.extraGroups = [ "libvirtd" "kvm" "qemu"];


  };
}

Can your try following:

  virtualisation.spiceUSBRedirection.enable = true;
1 Like