Jump to content

Looking Glass: Difference between revisions

From Official NixOS Wiki
Created page with " === Prerequisites === * NixOS 25.11 (unstable should work too) * Looking Glass B7 * systemd 258 (because of [https://github.com/systemd/systemd/issues/39056 this]) === Configuration === ==== IVSHMEM with the KVMFR module ==== ====== Installing and Loading ====== <syntaxhighlight lang=nix> boot.extraModulePackages = [ config.boot.kernelPackages.kvmfr ]; boot.initrd.kernelModules = [ "kvmfr" ]; boot.kernelParams = [ "kvmfr.static_..."
 
m Permissions: Missing closing bracket
 
Line 21: Line 21:
====== Permissions ======
====== Permissions ======


<syntaxhighlight lang=nix>
<syntaxhighlight lang="nix">
   services.udev.packages = lib.singleton (pkgs.writeTextFile
   services.udev.packages = lib.singleton (pkgs.writeTextFile
     {  
     {  
Line 30: Line 30:
       destination = "/etc/udev/rules.d/70-kvmfr.rules";
       destination = "/etc/udev/rules.d/70-kvmfr.rules";
     }
     }
  );
      
      
   users.users = {  
   users.users = {  
Line 36: Line 37:
     };
     };
   };
   };
</syntaxhighlight >
</syntaxhighlight>


====== CGroups ======
====== CGroups ======

Latest revision as of 01:45, 21 January 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";
    }
  );
    
  users.users = { 
    user = { # replace with your username
      extraGroups = [ "kvm" ];
    };
  };
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
  ];