Linux Virtualization Management Daemon
Here are practical examples of using libvirtd in different scenarios:
Start libvirtd as a daemon:
libvirtd -d
This is the most common way to start libvirtd in production environments.
Start with verbose output and custom config:
libvirtd -v -f /etc/libvirt/libvirtd.conf
Useful for debugging configuration issues or testing new settings.
Start with TCP listening enabled:
libvirtd -l -d
Enables remote management over the network while running as a daemon.
Run for testing with timeout:
libvirtd -t 300
Runs for 5 minutes then exits, perfect for testing configurations.
virsh list --all
Shows all virtual machines, both running and stopped.
virsh start my-vm
Starts a virtual machine named "my-vm".
virsh shutdown my-vm
Gracefully shuts down a virtual machine.
virsh destroy my-vm
Immediately stops a virtual machine (use with caution).
virsh net-list --all
Shows all virtual networks configured on the system.
virsh net-start default
Starts the default virtual network.
virsh net-define network.xml
Creates a new network from an XML definition file.
virsh pool-list --all
Shows all storage pools available to libvirt.
virsh vol-list default
Lists all volumes in the default storage pool.
virsh vol-create-as default my-volume 10G
Creates a 10GB volume in the default pool.
virsh -c qemu+ssh://user@remote-host/system list
Connect to a remote libvirtd instance via SSH.
virt-install --name my-vm --memory 2048 --vcpus 2 --disk size=20 --cdrom /path/to/iso
Creates a new VM with specified resources.
virt-clone --original my-vm --name my-vm-clone --file /path/to/clone.qcow2
Creates a copy of an existing virtual machine.