Libvirt is an open source virtualization API that provides a consistent interface enabling you to provision, start, stop, migrate, and monitor VMs on KVM hypervisor.

This tutorial is pulled directly from Mastering KVM Virtualization – The Ultimate eBook. Want more practical KVM insights? Grab the full guide.

The management of the libvirtd service can vary slightly depending on the host operating system – whether it uses systemd or the older init systems like SysVinit or Upstart.

Here’s we show you how the management of the libvirtd service can be performed on different init systems. The list should cover the common Libvirtd service management operations you might need to perform on various systems.

1. Systemd

Enable libvirtd service to start on system boot:

sudo systemctl enable libvirtd

Start the libvirtd service:

sudo systemctl start libvirtd

Check the libvirtd service status:

sudo systemctl status libvirtd

Stop the libvirtd service:

sudo systemctl stop libvirtd

Restart the libvirtd service:

sudo systemctl restart libvirtd

Reload the libvirtd service configuration without stopping it:

sudo systemctl reload libvirtd

Disable the libvirtd service so it does not start on boot:

sudo systemctl disable libvirtd

2. SysVinit

Enable the libvirtd service to start on boot:

sudo chkconfig libvirtd on

Start the libvirtd service:

sudo service libvirtd start

Check the status of the libvirtd service:

sudo service libvirtd status

Stop the libvirtd service:

sudo service libvirtd stop

Restart the libvirtd service:

sudo service libvirtd restart

Reload the libvirtd service configuration without stopping it:

sudo service libvirtd reload

Disable the libvirtd service so it does not start on boot:

sudo chkconfig libvirtd off

3. Upstart

Upstart is primarily used in older versions of Ubuntu (from 9.10 to 14.10) and some other distributions.

Start the libvirtd service:

sudo start libvirtd

Check the status of the libvirtd service:

sudo status libvirtd

Stop the libvirtd service:

sudo stop libvirtd

Restart the libvirtd service:

sudo restart libvirtd

Reload the libvirtd service configuration without stopping it:

sudo reload libvirtd

Summary of Commands

ActionSystemdSysVinitUpstart
Enable servicesystemctl enable libvirtdchkconfig libvirtd onN/A
Start servicesystemctl start libvirtdservice libvirtd startstart libvirtd
Check statussystemctl status libvirtdservice libvirtd statusstatus libvirtd
Stop servicesystemctl stop libvirtdservice libvirtd stopstop libvirtd
Restart servicesystemctl restart libvirtdservice libvirtd restartrestart libvirtd
Reload servicesystemctl reload libvirtdservice libvirtd reloadreload libvirtd
Disable servicesystemctl disable libvirtdchkconfig libvirtd offN/A

LEAVE A REPLY

Please enter your comment!
Please enter your name here