QEMU: Difference between revisions
Emulate different architectures |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
== Setup == | == Setup == | ||
To install the main QEMU program system-wide, add the following to your <code>configuration.nix</code>:<syntaxhighlight lang=nix> | |||
<syntaxhighlight lang=nix> | |||
environment = { | environment = { | ||
systemPackages = [ pkgs.qemu ]; | systemPackages = [ pkgs.qemu ]; | ||
}; | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Evaluate}} | |||
=== Quick EMU === | === Quick EMU === | ||
Line 22: | Line 23: | ||
== Configuration == | == Configuration == | ||
=== | === UEFI firmware support === | ||
To | 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" ]; | |||
</syntaxhighlight> | |||
<syntaxhighlight lang=nix> | === 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> | </syntaxhighlight> | ||
== Tips and tricks == | == Tips and tricks == | ||
Line 80: | Line 75: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight>Alternatively a different iso file can be specified in the drive-parameter, for example for Ubuntu Server ARM64. | ||
[[Category:Virtualization]] | [[Category:Virtualization]] |