Skip to content
libvirtd(8) manual
InteractiveCommands
LIBVIRTD(8)EXAMPLESlibvirtd.com

EXAMPLES

Common libvirtd and virsh examples

Small, copy-ready examples for daemon checks and virtualization inventory.

section 08 / 14
manual group: virtualization support
living notes: enabled
deep links: enabled

Reference core

verify upstream ↗
$ libvirtd --version

Print the installed libvirtd/libvirt version.

$ libvirtd -d

Start the monolithic daemon in traditional background mode.

$ virsh --connect qemu:///system list --all

List all QEMU/KVM domains visible through the system libvirt instance.

$ virsh uri

Print the canonical URI for the current virsh connection.

$ systemctl status libvirtd.socket libvirtd.service

Inspect the monolithic socket and service when the host uses libvirtd.

$ systemctl status virtqemud.socket virtqemud.service

Inspect the modular QEMU daemon when the host uses modular libvirt.

$ virsh net-list --all

List defined libvirt virtual networks.

$ virsh pool-list --all

List defined libvirt storage pools.

$ virsh dumpxml DOMAIN

Display a domain XML definition.

Living manual · why this matters

How do you turn examples into a safe workflow?

Start by proving the connection URI, inventorying state and reading definitions before mutating anything. The examples below are deliberately small building blocks; the living manual links them to deeper domain, network, storage and daemon procedures.

Operator checks

$ virsh uri$ virsh list --all$ virsh dominfo DOMAIN$ virsh net-list --all$ virsh pool-list --all$ virsh dumpxml DOMAIN

What to notice

  • Read before change: URI, current state and XML first.
  • Use --all when inactive definitions matter.
  • After any state change, verify both the immediate result and persistent/autostart expectations.
Interactive command console →Full command explorer →Practice in XML lab →

Deep reference

Keep going without losing the layer.

all docs →
virshCommon virsh workflowsThis page groups the virsh commands that usually travel together during provisioning, incident handling, and cleanup. Inventory and inspect first Do this before changing anything. list all Use virsh list all when you neevirshDaily domain operations with virshStart every change by pinning the URI, capturing current state, and defining the evidence that will prove success. Inventory before change Apply and verify Use config, live, or both deliberately for device changes. A livvirshvirsh connection URIsThe URI tells virsh which driver, transport, host, and privilege scope to use. Most confusion comes from using the right command against the wrong URI. Common URI families | URI | Meaning | Typical use | | | | | | qemu:/DomainsConsoles, graphics, and the QEMU guest agentSerial consoles, graphical consoles, and the guest agent solve different problems. Configure at least one recovery path that does not depend on guest networking. Serial console The guest kernel and init system must also DomainsDomain lifecycle and state transitionsA libvirt domain is a guest definition plus its runtime state. Persistent definitions survive host reboots; transient domains disappear when stopped. Inspect state Controlled transitions shutdown requests an orderly guesVirtual NetworkingBridge design and host uplinksA Linux bridge is a layer 2 switch in the host. The host address belongs on the bridge, while the physical interface becomes a port of that bridge. Inspect without changing NetworkManager pattern Move the host IP configu
← previousFILESImportant root and per-user paths used by libvirtd and its drivers.next →BUGSWhere libvirt and distribution-specific problems should be reported.
Manual indexLiving labCommands