Virt-manager: Difference between revisions
m Updated Formating |
SummerTime (talk | contribs) Unable to find 'efi' firmware |
||
| (2 intermediate revisions by one other user not shown) | |||
| Line 18: | Line 18: | ||
=== Networking === | === Networking === | ||
To use the default libvirt network, you will need to install the <code>dnsmasq</code> package. This is required for DNS and DCHP functionality within the network: | |||
{{File|3=environment.systemPackages = with pkgs; [ | |||
dnsmasq | |||
];|name=/etc/nixos/configuration.nix|lang=nix}} | |||
The default network starts off inactive, you must enable it before it is accessible. This can be done by running the following command: <syntaxhighlight lang="console"># virsh net-start default</syntaxhighlight>And if you would like to enable it automatically at boot:<syntaxhighlight lang="console"> | The default network starts off inactive, you must enable it before it is accessible. This can be done by running the following command: <syntaxhighlight lang="console"># virsh net-start default</syntaxhighlight>And if you would like to enable it automatically at boot:<syntaxhighlight lang="console"> | ||
# virsh net-autostart default | # virsh net-autostart default | ||
</syntaxhighlight>By default, this will enable a virtual network bridge under the name <code>virbr0</code>. | </syntaxhighlight>By default, this will enable a virtual network bridge under the name <code>virbr0</code>. You may need to allow it through your firewall filter like so: | ||
{{File|3=networking.firewall.trustedInterfaces = [ "virbr0" ];|name=/etc/nixos/configuration.nix|lang=nix}} | |||
=== Display === | === Display === | ||
| Line 59: | Line 66: | ||
name = "Vanilla-DMZ"; | name = "Vanilla-DMZ"; | ||
}; | }; | ||
== Troubleshooting == | |||
=== Unable to find 'efi' firmware === | |||
The following guide is to fix the following error which will occur when starting a virtual machine after NixOS upgrade: | |||
<code>Error: Error starting domain: operation failed: Unable to find 'efi' firmware that is compatible with the current configuration</code> | |||
Solution: | |||
# Delete old generations: <code>nix-collect-garbage -d</code> | |||
# Find where the EFI boot loaded file is located: <code>find /nix/store/ -maxdepth 1 -type d -name "*qemu*" | xargs -I {} find "{}" -type f -name "edk2-x86_64-secure-code.fd"</code> Find the dir holding the latest qemu. The directory should be something like: <code>xbfjilai721rzd9rf9dhhpv03xza4xp4-qemu-9.1.3</code>. Take a note of this directory name. | |||
# Open VM in virt-manager, go to XML and within the <code><os ...></code> tag: | |||
## Edit <code><loader ...></code> with the above directory name | |||
## Edit <code><nvram ...></code> with the above directory name. | |||
[[Category:Virtualization]] | [[Category:Virtualization]] | ||