How to Disable the Ubuntu ‘Libvirtd’ Service

The Virtualization Daemon

In Ubuntu Linux, libvirtd is the core background service (daemon) responsible for managing platform virtualization. It is the primary engine that tools like Virtual Machine Manager (virt-manager), Virsh, and OpenStack use to interact with hypervisors such as KVM (Kernel-based Virtual Machine) and QEMU. It handles the lifecycle of virtual machines, configuring virtual networks, and managing virtual storage pools.

While this daemon is essential if your Ubuntu server is acting as a host for virtual machines, it is completely unnecessary overhead on a system that is not running any virtualization workloads. If your machine is a dedicated web server, a database node, or a desktop PC where you do not run local VMs via KVM, running libvirtd in the background wastes system memory and CPU cycles. To streamline your system and minimize its attack surface, you should disable this virtualization management service.

How to Disable the Libvirtd Service

You can permanently stop this virtualization daemon using systemctl.

Warning: Do not perform this if you actively run virtual machines using KVM/QEMU, or tools like Multipass. Disabling this service will prevent you from starting or managing those VMs.

  1. Open your Ubuntu Terminal or connect via SSH.
  2. Stop the active service and its associated sockets if they are currently running:
sudo systemctl stop libvirtd.service
sudo systemctl stop libvirtd.socket
sudo systemctl stop libvirtd-ro.socket
sudo systemctl stop libvirtd-admin.socket
  1. Disable the service to prevent it from starting automatically on the next boot:
sudo systemctl disable libvirtd.service
  1. To ensure no other virtualization tools attempt to wake it up on demand, mask it completely:
sudo systemctl mask libvirtd.service

Your Ubuntu system will immediately stop managing virtualization infrastructure, freeing up resources for your primary applications.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.