QEMU: Difference between revisions

Onny (talk | contribs)
Onny (talk | contribs)
Register binfmt emulate different architectures
Line 2: Line 2:


== Setup ==
== Setup ==
 
Install the QEMU program system wide<syntaxhighlight lang=nix>
<syntaxhighlight lang=nix>
   environment = {
   environment = {
     systemPackages = [ pkgs.qemu ];
     systemPackages = [ pkgs.qemu ];
Line 40: Line 39:


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".
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 ===
Following configuration will enable the emulation of different architectures. For example to run aarch64 and riscv64 binaries on an native x86_64 host, add following part to your system configuration, apply it and reboot your system.<syntaxhighlight lang="nix">
boot.binfmt.emulatedSystems = [
  "aarch64-linux"
  "riscv64-linux"
];
</syntaxhighlight>


== Tips and tricks ==
== Tips and tricks ==