#linux #virtualization #virsh #homelab #qemuLibvirt is an open-source API, daemon, and management tool for managing virtualization technologies. It provides a common interface for managing virtual machines (VMs) and other virtualization resources, including KVM, QEMU, and more.- libvirt-daemon-system: Includes an API library to communicate with QEMU and KVM.
- libvirt-clients: Provides three libvirt utilities designed to streamline the management of VMs:
- virt-manager: GUI to create, use, and manage VMs.
- virt-install: CLI for straightforward VM creation.
- virt-viewer: GUI to view the VM’s console.
- virtsh: CLI to create, use, and manage VMs.
Installation:
On debian based distro:
sudo apt install libvirt-daemon-systemOnly necessary if the user is not part of the sudo group: Add the user who will manage VMs to the libvirt and libvirt-qemu group. (This group will appear after reboot, once libvirt is installed.)
sudo usermod -aG libvirt,libvirt-qemu your_username
For more details see: User-ManagementVerify:
sudo systemctl status libvirtdIf it is not running yet: # First, enable it
sudo systemctl enable libvirtd.service
# Then start it
sudo systemctl start libvirtd.service
virsh should be installed automatically.