How To

KVM Libvirt Service Management – systemd, SysVinit, Upstart

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.

Original content from computingforgeeks.com - post 87701

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

Related Articles

Containers Install LXC and Incus on Ubuntu 24.04/22.04 with Web UI KVM KVM Host Network Configurations using Virt-Manager Rocky Linux Install VMware Workstation / Player 16 on Rocky Linux 9 Linux Mint How To Install VirtualBox 7.x on Linux Mint 22

Leave a Comment

Press ESC to close