Jump to content

Looking Glass: Difference between revisions

From Official NixOS Wiki
m Permissions: Missing closing bracket
Remove add user to the kvm group
 
Line 31: Line 31:
     }
     }
   );
   );
   
  users.users = {
    user = { # replace with your username
      extraGroups = [ "kvm" ];
    };
  };
</syntaxhighlight>
</syntaxhighlight>



Latest revision as of 09:22, 3 February 2026

Prerequisites

  • NixOS 25.11 (unstable should work too)
  • Looking Glass B7
  • systemd 258 (because of this)

Configuration

IVSHMEM with the KVMFR module

Installing and Loading
  boot.extraModulePackages = [ config.boot.kernelPackages.kvmfr ];
  boot.initrd.kernelModules = [ "kvmfr" ];
  boot.kernelParams = [ "kvmfr.static_size_mb=64" ]; # replace with your calculated MEM requirement
Permissions
  services.udev.packages = lib.singleton (pkgs.writeTextFile
    { 
      name = "kvmfr";
      text = ''
        SUBSYSTEM=="kvmfr", GROUP="kvm", MODE="0660", TAG+="uaccess"
      '';
      destination = "/etc/udev/rules.d/70-kvmfr.rules";
    }
  );
CGroups
  virtualisation.libvirtd.qemu = {
    verbatimConfig = ''
      namespaces = []
      cgroup_device_acl = [
        "/dev/null", "/dev/full", "/dev/zero",
        "/dev/random", "/dev/urandom",
        "/dev/ptmx", "/dev/kvm", "/dev/kqemu",
        "/dev/rtc","/dev/hpet", "/dev/vfio/vfio",
        "/dev/kvmfr0"
      ]
    '';
  };

Install the Looking Glass client

  environment.systemPackages = with pkgs; [
    looking-glass-client
  ];