Oracle Linux 9: Manage the Libvirtd Service

The following information describes how to start, enable, and check the status of the libvirt service.

What Do You Need?

Steps

Follow these steps to start and enable the libvirtd service:

  1. To start the libvirtd service with full virtualization functionality, run:
    for drv in qemu network nodedev nwfilter secret storage interface; 
      do
       sudo systemctl enable virt${drv}d.service
       sudo systemctl enable virt${drv}d{,-ro,-admin}.socket;
       sudo systemctl start virt${drv}d{,-ro,-admin}.socket; 
      done

    You don't need to start the service for each daemon, as the service is automatically started when the first socket is established.

    Note:

    For legacy systems, the libvirtd socket is available for use to manage remote virtual guest connections.
    1. Enable the virtproxyd daemon to let remote hosts connect to guests.
      If connections from remote hosts are needed, the virtproxyd daemon must be enabled and started:
      sudo systemctl enable virtproxyd.service
      sudo systemctl enable virtproxyd-tls.socket
      sudo systemctl start virtproxyd-tls.socket
  2. To check the status of the libvirtd service, type:
    sudo systemctl list-units --type=socket virt*

    The output identifies all enabled units and their current status.

Oracle Linux 9: Types of libvirt Driver Daemons

Oracle Linux 9 provides functionality for two different types of libvirt driver daemons: Modular and Monolithic. The granularity in which you can configure individual virtualization drivers depends on which libvirt daemon you use. For example:

  • Modular libvirt - Oracle Linux 9 Fresh Install

    Modular libvirt, which is newly introduced in Oracle Linux 9, provides a specific daemon for each hypervisor driver. These include:

    • virtqemud: is the QEMU management daemon, for running virtual machines on KVM.
    • virtnetworkd: is the virtual network management daemon.
    • virtnodedevd: is the host physical device management daemon.
    • virtnwfilterd: is the host firewall management daemon.
    • virtsecretd: is the host secret management daemon.
    • virtstoraged: is the host storage management daemon.
    • virtinterfaced: is the host Network Interface Card (NIC) management daemon.
    • virtproxyd is a virtualization proxy daemon that lets remote clients to securely access the libvirt APIs.

    The name of the daemon reflects the name of the host driver, for example: virt [DRIVER]d. Each driver daemon has a separate configuration file that resides in libvirt directory. For example, the configuration file path for QEMU management driver daemon is /etc/libvirt/virtqemud.conf.

    Modular driver daemons provide better options for fine-tuning and managing the libvirt system resources. When you perform a fresh install of Oracle Linux 9, the libvirt modular virtualization driver daemons are configured by default.

    Note:

    When the virt$[DRIVER]d daemon is managed by systemd other features are also available, most notably socket activation. For more information about the use of modular sockets and systemd integration, see https://libvirt.org/daemons.html#modular-sockets.
  • Monolithic libvirt - Update to Oracle Linux 9

    By default, the traditional monolithic daemon, known as libvirtd is configured when you update from Oracle Linux 8 to Oracle Linux 9. The libvirtd daemon controls a wide variety of virtualization drivers by using a single configuration file (/etc/libvirt/libvirtd.conf). In some instances, system resources might be used inefficiently when using the libvirtd centralized configuration. Therefore, we recommend that Oracle Linux 9 users switch to the modular libvirt driver daemons. For instructions, see https://libvirt.org/daemons.html#switching-to-modular-daemons

For general information about the usage of libvirt daemons, see https://libvirt.org/daemons.htmlj.