QEMU: Difference between revisions

Setup: : Cleanup odd wording and add the Evaluate template.
Onny (talk | contribs)
 
Line 23: Line 23:
== Configuration ==
== Configuration ==


=== Booting UEFI ===
=== UEFI firmware support ===
To boot UEFI systems using QEMU, the UEFI firmware replacing the BIOS implementation needs to be provided while starting QEMU.
To enable UEFI firmware support in Virt-Manager, Libvirt, Gnome-Boxes etc. add following snippet to your system configuration and apply it<syntaxhighlight lang="nix">
 
systemd.tmpfiles.rules = [ "L+ /var/lib/qemu/firmware - - - - ${pkgs.qemu}/share/qemu/firmware" ];
The following installs a script, that always starts QEMU with OVMF firmware implementing UEFI support.
 
<syntaxhighlight lang=nix>
environment = {
  systemPackages = [
    (pkgs.writeShellScriptBin "qemu-system-x86_64-uefi" ''
      qemu-system-x86_64 \
        -bios ${pkgs.OVMF.fd}/FV/OVMF.fd \
        "$@"
    '')
  ];
};
</syntaxhighlight>
</syntaxhighlight>
qcow-efi images generated from [https://github.com/nix-community/nixos-generators nixos-generators] require more RAM than the default 128MB.  Failing to provide enough RAM results in grub reporting "error: start_image() returned 0x800000000000009." or systemd-boot reporting "Failed to execute NixOS: Out of resources".


=== Run binaries of different architecture ===
=== Run binaries of different architecture ===