Quickemu --vm windows-11.conf # ERROR! SecureBoot was requested but no SecureBoot capable firmware was found. Please install OVMF firmware

 - system: `"x86_64-linux"` 
 - host os: `Linux 5.15.43, NixOS, 22.05 (Quokka), 22.05.751.8b66e3f2ebc` 
 - multi-user?: `yes` 
 - sandbox: `yes` 
 - version: `nix-env (Nix) 2.8.1` 
 - channels(root): `"home-manager-22.05.tar.gz, nixos-22.05"` 
 - channels(usera): `""` 
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
{
  services.qemuGuest.enable = true;
  virtualisation = {
    kvmgt.enable = true;

    libvirtd  = {
      allowedBridges = [
        "nm-bridge"
        "virbr0"
      ];

      enable = true;
      qemu.runAsRoot = false; 
      qemu.ovmf.enable = true ;
    };
  };
quickget windows 11

Getting Windows 11 URL...
Downloading Windows 11 [22000.318]...
windows-11/virtio-win.iso                                  100%[++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>] 507.00M   316KB/s    in 0.2s    
Making unattended.iso

To start your Windows virtual machine run:
    quickemu --vm windows-11.conf

quickemu --vm windows-11.conf

Quickemu 3.15 using /nix/store/rip5wzqm2wvf33v8qlzg85aa4pgjyhg3-qemu-7.0.0/bin/qemu-system-x86_64 v7.0.0
 - Host:     "NixOS 22.05 (Quokka)" running Linux 5.15 (nixosP34)
 - CPU:      Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
 - CPU VM:   1 Socket(s), 4 Core(s), 2 Thread(s), 16G RAM
ERROR! SecureBoot was requested but no SecureBoot capable firmware was found.
       Please install OVMF firmware.

Secure boot in โ€œbiosโ€ was deactivated when installing nixos while OVMFFull was installed


How to configure qemu/quickemu to start e.g. win11 in nixos correctly?

I have installed Windows 11 VM but it was done on Virt Machine Manager. My current libvirtd config is like this:

  virtualisation.libvirtd = {
    enable = true;
    qemu = {
      runAsRoot = false;
      ovmf = {
        enable = true;
        package = pkgs.OVMFFull;
      };
      swtpm.enable = true;
    };
  };

.
Also, I have looked at quickemu code. It seems like it searches for OVMF on directories which are not provided by NixOS. Try exporting those variables before running quickemu:

export ENV_EFI_CODE_SECURE=/run/libvirt/nix-ovmf/OVMF_CODE.fd ENV_EFI_VARS_SECURE=/run/libvirt/nix-ovmf/OVMF_VARS.fd

.

thanks, that was a step forward
but after starting there are issues (not sure if that is nixos related)

quickemu --vm windows-11.conf # --display spice

Quickemu 3.15 using /nix/store/rip5wzqm2wvf33v8qlzg85aa4pgjyhg3-qemu-7.0.0/bin/qemu-system-x86_64 v7.0.0
 - Host:     "NixOS 22.05 (Quokka)" running Linux 5.15 (nixosP34)
 - CPU:      Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
 - CPU VM:   1 Socket(s), 4 Core(s), 2 Thread(s), 16G RAM
 - EFI:      WARNING! /run/libvirt/nix-ovmf/OVMF_CODE.fd is a symlink.
             Resolving to... /nix/store/k42akcjj7yk8srkpilf3ddrykh7clbr9-OVMF-202202-fd/FV/OVMF_CODE.fd
 - BOOT:     EFI (Windows), OVMF (/nix/store/k42akcjj7yk8srkpilf3ddrykh7clbr9-OVMF-202202-fd/FV/OVMF_CODE.fd), SecureBoot (on).
 - Disk:     windows-11/disk.qcow2 (64G)
             Looks unused, booting from windows-11/Win11_EnglishInternational_x64v1.iso
 - MSR:      WARNING! Ignoring unhandled Model-Specific Registers is disabled.

             echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs

             If you are unable to run macOS or Windows VMs then run the above ๐Ÿ‘†
             This will enable ignoring of unhandled MSRs until you reboot the host.
             You can make this change permenant by running: 'quickemu --ignore-msrs-always'
 - Boot ISO: windows-11/Win11_EnglishInternational_x64v1.iso
 - CD-ROM:   windows-11/virtio-win.iso
 - Display:  SPICE, qxl-vga, GL (on), VirGL (off)
 - ssh:      On host:  ssh user@localhost -p 22220
 - SPICE:    On host:  spicy --title "windows-11" --port 5930 --spice-shared-dir /home/ae/Public
 - WebDAV:   On guest: dav://localhost:9843/
 - TPM:      windows-11/windows-11.swtpm-sock (322773)
qxl_send_events: spice-server bug: guest stopped, ignoring
 - Process:  Starting windows-11.conf as windows-11 (322778)