Skip to content

Libvirtd

virtualisation.libvirtd.allowedBridges

List of bridge devices that can be used by qemu:///session

Type: list of string

Default

["virbr0"]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.enable

This option enables libvirtd, a daemon that manages virtual machines. Users in the "libvirtd" group can interact with the daemon (e.g. to start or stop VMs) using the {command}virsh command line tool, among others.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.extraConfig

Extra contents appended to the libvirtd configuration file, libvirtd.conf.

Type: strings concatenated with "\n"

Default

""

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.extraOptions

Extra command line arguments passed to libvirtd on startup.

Type: list of string

Default

[ ]

Example

["--verbose"]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.hooks

Hooks related options.

Type: submodule

Default

{ }

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.hooks.daemon

Hooks that will be placed under /var/lib/libvirt/hooks/daemon.d/ and called for daemon start/shutdown/SIGHUP events. Please see https://libvirt.org/hooks.html for documentation.

Type: attribute set of path

Default

{ }

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.hooks.libxl

Hooks that will be placed under /var/lib/libvirt/hooks/libxl.d/ and called for libxl-handled xen domains begin/end events. Please see https://libvirt.org/hooks.html for documentation.

Type: attribute set of path

Default

{ }

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.hooks.lxc

Hooks that will be placed under /var/lib/libvirt/hooks/lxc.d/ and called for lxc domains begin/end events. Please see https://libvirt.org/hooks.html for documentation.

Type: attribute set of path

Default

{ }

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.hooks.network

Hooks that will be placed under /var/lib/libvirt/hooks/lxc.d/ and called for networks begin/end events. Please see https://libvirt.org/hooks.html for documentation.

Type: attribute set of path

Default

{ }

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.hooks.qemu

Hooks that will be placed under /var/lib/libvirt/hooks/qemu.d/ and called for qemu domains begin/end/migrate events. Please see https://libvirt.org/hooks.html for documentation.

Type: attribute set of path

Default

{ }

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.nss

libvirt NSS module options.

Type: submodule

Default

{ }

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.nss.enable

This option enables the older libvirt NSS module. This method uses DHCP server records, therefore is dependent on the hostname provided by the guest. Please see https://libvirt.org/nss.html for more information.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.nss.enableGuest

This option enables the newer libvirt_guest NSS module. This module uses the libvirt guest name instead of the hostname of the guest. Please see https://libvirt.org/nss.html for more information.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.onBoot

Specifies the action to be done to / on the guests when the host boots. The "start" option starts all guests that were running prior to shutdown regardless of their autostart settings. The "ignore" option will not start the formerly running guest on boot. However, any guest marked as autostart will still be automatically started by libvirtd.

Type: one of "start", "ignore"

Default

"start"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.onShutdown

When shutting down / restarting the host what method should be used to gracefully halt the guests. Setting to "shutdown" will cause an ACPI shutdown of each guest. "suspend" will attempt to save the state of the guests ready to restore on boot.

Type: one of "shutdown", "suspend"

Default

"suspend"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.package

The libvirt package to use. Type: package

Default

pkgs.libvirt

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.parallelShutdown

Number of guests that will be shutdown concurrently, taking effect when onShutdown is set to "shutdown". If set to 0, guests will be shutdown one after another. Number of guests on shutdown at any time will not exceed number set in this variable.

Type: unsigned integer, meaning >=0

Default

0

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.qemu

QEMU related options.

Type: submodule

Default

{ }

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.qemu.ovmf

QEMU's OVMF options.

Type: submodule

Default

{ }

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.qemu.ovmf.enable

Allows libvirtd to take advantage of OVMF when creating new QEMU VMs with UEFI boot.

Type: boolean

Default

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.qemu.ovmf.packages

List of OVMF packages to use. Each listed package must contain files names FV/OVMF_CODE.fd and FV/OVMF_VARS.fd or FV/AAVMF_CODE.fd and FV/AAVMF_VARS.fd

Type: list of package

Default

[ pkgs.OVMF.fd ]

Example

[ pkgs.OVMFFull.fd pkgs.pkgsCross.aarch64-multiplatform.OVMF.fd ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.qemu.package

The qemu package to use. pkgs.qemu can emulate alien architectures (e.g. aarch64 on x86) pkgs.qemu_kvm saves disk space allowing to emulate only host architectures.

Type: package

Default

pkgs.qemu

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.qemu.runAsRoot

If true, libvirtd runs qemu as root. If false, libvirtd runs qemu as unprivileged user qemu-libvirtd. Changing this option to false may cause file permission issues for existing guests. To fix these, manually change ownership of affected files in /var/lib/libvirt/qemu to qemu-libvirtd.

Type: boolean

Default

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.qemu.swtpm

QEMU's swtpm options.

Type: submodule

Default

{ }

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.qemu.swtpm.enable

Allows libvirtd to use swtpm to create an emulated TPM.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.qemu.swtpm.package

The swtpm package to use. Type: package

Default

pkgs.swtpm

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.qemu.verbatimConfig

Contents written to the qemu configuration file, qemu.conf. Make sure to include a proper namespace configuration when supplying custom configuration.

Type: strings concatenated with "\n"

Default

'' namespaces = []''

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.qemu.vhostUserPackages

Packages containing out-of-tree vhost-user drivers.

Type: list of package

Default

[ ]

Example

[ pkgs.virtiofsd ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix

virtualisation.libvirtd.sshProxy

Weither to configure OpenSSH to use the SSH Proxy.

Type: boolean

Default

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix