Virt-manager: Difference between revisions

From NixOS Wiki
imported>Timokau
(Add declarative way of configuring the default hypervisor.)
imported>BridgerB
mNo edit summary
Line 10: Line 10:
You will get a warning when you open it for the first time
You will get a warning when you open it for the first time


<code>Could not detect a default hypervisor. Make sure the appropriate virtualization packages containing kvm, qemu, libvirt, etc. are installed and that libvirtd is running.</code>
<code>Could not detect a default hypervisor. Make sure the appropriate QEMU/KVM virtualization packages are installed to manage virtualization on this host.
 
A virtualization connection can be manually added via File->Add Connection</code>


To resolve
To resolve

Revision as of 14:59, 20 August 2023

Installation

NixOS

virtualisation.libvirtd.enable = true;
programs.dconf.enable = true;
environment.systemPackages = with pkgs; [ virt-manager ];

You will get a warning when you open it for the first time

Could not detect a default hypervisor. Make sure the appropriate QEMU/KVM virtualization packages are installed to manage virtualization on this host.

A virtualization connection can be manually added via File->Add Connection

To resolve

File (in the menu bar) -> Add connection

HyperVisor = QEMU/KVM
Autoconnect = checkmark

Connect

The same can also be achieved decoratively by setting the corresponding dconf settings with home-manager. If you want to do this instead of the imperative configuration described above, add the following snippet to your home-manager configuration:

dconf.settings = {
  "org/virt-manager/virt-manager/connections" = {
    autoconnect = ["qemu:///system"];
    uris = ["qemu:///system"];
  };
};

You can get the following error :

authentication unavailable: no polkit agent available to authenticate action 'org.libvirt.unix.manage'

To resolve, add the user to the libvirtd group.

{
  users.users.<myuser>.extraGroups = [ "libvirtd" ];
}