LIBVIRTD(8)

๐Ÿฆ‹ LIBVIRTD โ€” the libvirt management daemon (straight out of section 8 of the manual, under "Virtualization Support")

okay so bestie, buckle up ๐Ÿ’– this is the page for libvirtd(8) โ€” yes the one and only, the manual page for libvirtd, and we're gonna get through it together. no cap.


โœจ NAME โœจ

libvirtd โ€” the libvirt management daemon. it's the server-side bestie of the whole libvirt virtualization management system ๐Ÿซถ


โœจ SYNOPSIS โœจ

libvirtd [OPTION]...

literally just the program plus options. that's the whole vibe check.


โœจ DESCRIPTION โœจ

so libvirtd is the server side daemon component of the libvirt virtualization management system ๐Ÿ‘‘

this daemon runs on host servers and does all the required management tasks for your virtualized guests. what does that mean in practice? activities like starting, stopping, and migrating guests between host servers, configuring and manipulating networking, and managing storage for guests to use. it's giving main character energy in the virtualization stack, honestly ๐Ÿ”ฅ

the libvirt client libraries and utilities connect to this daemon to send over tasks and collect info about the configuration and resources of the host system and the guests. so like, all your clients are texting this daemon and it's answering. iconic.

by default, libvirtd listens for requests on a local Unix domain socket. but with the -l | --listen command line option, you can tell it to additionally listen on a TCP/IP socket. which TCP/IP socket it uses is defined in the libvirtd configuration file. slay.

๐Ÿ’€ restarting libvirtd does not impact running guests. your guests keep operating and will be picked up automatically if their XML configuration has been defined. any guests whose XML configuration has not been defined will be lost from the configuration. so write your XML, bestie. write it. ๐Ÿ˜ญ

โœจ SYSTEM SOCKET ACTIVATION โœจ

libvirtd can start up in two modes โ€” two whole modes, iykyk ๐Ÿ’…

traditional mode: it creates and listens on UNIX sockets itself. if the --listen parameter is given, it will also listen on TCP/IP socket(s), according to the listen_tcp and listen_tls options in /etc/libvirt/libvirtd.conf.

socket activation mode: it relies on systemd to create and listen on the UNIX (and optionally TCP/IP) sockets, and systemd passes them in as pre-opened file descriptors. in this mode you are not permitted to pass the --listen parameter, and most of the socket-related config options in /etc/libvirt/libvirtd.conf will no longer have any effect. to enable TCP or TLS sockets, use either:

$ systemctl start libvirtd-tls.socket

or:

$ systemctl start libvirtd-tcp.socket

socket activation mode is generally the default when running on a host OS that uses systemd. to go back to traditional mode, all the socket unit files must be masked:

$ systemctl mask libvirtd.socket libvirtd-ro.socket \
   libvirtd-admin.socket libvirtd-tls.socket libvirtd-tcp.socket

and on top of that, make sure the --timeout argument is not used for the daemon, since it would not be started upon any later connection. lowkey important ๐Ÿซถ

if you're using the libvirt-guests service, then the ordering for that service needs to be adapted so that it's ordered after the service unit instead of the socket unit. and since dependencies and ordering cannot be changed with drop-in overrides, the whole libvirt-guests unit file needs to be changed. to preserve that change, copy the installed /usr/lib/systemd/system/libvirt-guests.service to /etc/systemd/system/libvirt-guests.service and make the change there โ€” specifically, make sure the After= ordering mentions libvirtd.service and not libvirtd.socket:

[Unit]
After=libvirtd.service

periodt. ๐ŸŒธ


โญ OPTIONS โญ

  • -h, --help โ€” display command line help usage, then exit. the "what do I do again" button โœจ
  • -d, --daemon โ€” run as a daemon & write PID file.
  • -f, --config FILE โ€” use this configuration file, overriding the default value.
  • -l, --listen โ€” listen for TCP/IP connections. this should not be set if you're using systemd socket activation โ€” instead activate the libvirtd-tls.socket or libvirtd-tcp.socket unit files.
  • -p, --pid-file FILE โ€” use this name for the PID file, overriding the default value.
  • -t, --timeout SECONDS โ€” exit after the timeout period (in seconds), provided there are neither any client connections nor any running domains.
  • -v, --verbose โ€” enable output of verbose messages. chatty daemon, love that for us ๐Ÿ’ฌ
  • --version โ€” display version information, then exit.

โœจ SIGNALS โœจ

on receipt of SIGHUP, libvirtd will reload its configuration. one signal, one job, does it well ๐Ÿ’œ


๐ŸŽ€ FILES ๐ŸŽ€

When run as root ๐Ÿ‘‘

  • /etc/libvirt/libvirtd.conf

the default configuration file used by libvirtd, unless overridden on the command line using the -f | --config option.

depending on what driver is installed, the following files are also read:

  • /etc/libvirt/qemu.conf for the QEMU driver
  • /etc/libvirt/lxc.conf for the LXC driver
  • /etc/libvirt/libxl.conf for the libxl driver

these files contain various knobs and default values for virtual machines created within their respective drivers, and offer a way to override the built-in defaults โ€” for instance (but not limited to): paths to various supplementary binaries, TLS certificates location, graphical consoles configuration, and others. the location of neither of these files can be overridden by any command line switch. ๐Ÿšซ

  • /run/libvirt/libvirt-sock
  • /run/libvirt/libvirt-sock-ro

the sockets libvirtd will use.

  • /etc/pki/CA/cacert.pem

the TLS Certificate Authority certificate libvirtd will use.

  • /etc/pki/libvirt/servercert.pem

the TLS Server certificate libvirtd will use.

  • /etc/pki/libvirt/private/serverkey.pem

the TLS Server private key libvirtd will use. ๐Ÿ”

  • /run/libvirtd.pid

the PID file to use, unless overridden by the -p | --pid-file option.

When run as non-root ๐Ÿงš

  • $XDG_CONFIG_HOME/libvirt/libvirtd.conf

the default configuration file used by libvirtd, unless overridden on the command line using the -f | --config option.

if the QEMU driver is installed, then the following file is also read:

  • $XDG_CONFIG_HOME/libvirt/qemu.conf

if the file exists, it can contain various knobs and default values for virtual machines created within the QEMU driver, and offers a way to override the built-in defaults โ€” for instance (but not limited to): paths to various supplementary binaries, TLS certificates location, graphical consoles configuration, and others. the location of this file can't be overridden by any command line switch.

  • $XDG_RUNTIME_DIR/libvirt/libvirt-sock

the socket libvirtd will use.

  • $HOME/.pki/libvirt/cacert.pem

the TLS Certificate Authority certificate libvirtd will use.

  • $HOME/.pki/libvirt/servercert.pem

the TLS Server certificate libvirtd will use.

  • $HOME/.pki/libvirt/serverkey.pem

the TLS Server private key libvirtd will use. ๐Ÿ”

  • $XDG_RUNTIME_DIR/libvirt/libvirtd.pid

the PID file to use, unless overridden by the -p | --pid-file option.

if $XDG_CONFIG_HOME is not set in your environment, libvirtd will use $HOME/.config

if $XDG_RUNTIME_DIR is not set in your environment, libvirtd will use $HOME/.cache


๐ŸŒˆ EXAMPLES ๐ŸŒˆ

to retrieve the version of libvirtd:

# libvirtd --version
libvirtd (libvirt) 12.8.0

to start libvirtd, instructing it to daemonize and create a PID file:

# libvirtd -d
# ls -la /run/libvirtd.pid
-rw-r--r-- 1 root root 6 Jul  9 02:40 /run/libvirtd.pid

look at that PID file living its best life ๐Ÿ“


๐Ÿ’€ BUGS ๐Ÿ’€

please report all bugs you discover. this should be done via either:

  1. the mailing list

https://libvirt.org/contact.html

  1. the bug tracker

https://libvirt.org/bugs.html

alternatively, you may report bugs to your software distributor / vendor. we're not gatekeeping the bug reports, fr fr ๐Ÿ™ˆ


๐Ÿซถ AUTHORS ๐Ÿซถ

please refer to the AUTHORS file distributed with libvirt.


Copyright (C) 2006-2012 Red Hat, Inc., and the authors listed in the libvirt AUTHORS file.


๐Ÿ‘‘ LICENSE ๐Ÿ‘‘

libvirtd is distributed under the terms of the GNU LGPL v2.1+. this is free software; see the source for copying conditions. there is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. like, none. zero. don't come for them if it breaks ๐Ÿ˜ญ


๐ŸŒธ SEE ALSO ๐ŸŒธ

virsh(1), virt-install(1), virt-xml-validate(1), virt-top(1), virt-df(1), https://libvirt.org/


aaaand that's the whole page, bestie, you ate that ๐Ÿ’…โœจ this little gem is from the LIBVIRTD(8) manual page, Virtualization Support edition, dated 2025-08-14 (libvirt 12.8.0 energy) โ€” go forth and manage some guests, you've got this ๐Ÿฆ‹๐Ÿ’–

๐Ÿ“ฆ where this page comes from