Skip to content

Instantly share code, notes, and snippets.

@bluemonk
Last active January 25, 2026 10:26
Show Gist options
  • Select an option

  • Save bluemonk/8e70f5720f9c39d25ffe2e9eb33d550d to your computer and use it in GitHub Desktop.

Select an option

Save bluemonk/8e70f5720f9c39d25ffe2e9eb33d550d to your computer and use it in GitHub Desktop.
Looking Glass on NixOS

Synopsis

This howto illustrates how to configure Looking Glass on NixOS.

Prerequisites

  • NixOS 25.11 (unstable should work, but I haven't tested it)
  • Looking Glass B7
  • systemd 258 (because of this)

Configuration

IVSHMEM with the KVMFR module (reference]

  1. Installing (reference) and Loading (reference)
  boot.extraModulePackages = [ config.boot.kernelPackages.kvmfr ];
  boot.initrd.kernelModules = [ "kvmfr" ];
  boot.kernelParams = [ "kvmfr.static_size_mb=64" ]; # replace with your calculated MEM requirement
  1. Permissions (reference)
  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" ];
    };
  };
  1. CGroups (reference)
  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 Looking Glass client

  environment.systemPackages = with pkgs; [
    looking-glass-client
  ];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment