Skip to navigationSkip to content
libvirtd docs
InteractiveCommands

Manual nav

Search `/` · tty `~` · g top · G bottom

Portal

  • Manual index
  • Interactive lab
  • Command explorer
Foundations5 sections
  • libvirtd Overview1
  • Host & Installation2
  • Architecture & Concepts6
  • Domains2
  • Domain XML2
Subsystems6 sections
  • Daemons3
  • virsh3
  • Virtual Networking5
  • Virtual Storage4
  • Virtualization Security3
  • Remote libvirt1
Operations5 sections
  • Migration2
  • Snapshots & Backup2
  • Performance3
  • Troubleshooting2
  • Reference2
guidevirshReviewed August 8, 2026

Common virsh workflows

This 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 nee

virshstartconsoledumpxmlmigrate

This page groups the virsh commands that usually travel together during provisioning, incident handling, and cleanup.

Inventory and inspect first

Do this before changing anything.

BASH
virsh -c qemu:///system list --all
virsh dominfo vm01
virsh dumpxml vm01 | less
virsh domblklist vm01
virsh domiflist vm01

list --all

Use virsh list --all when you need the authoritative inventory for the current URI, including shut off guests.

dumpxml

Use virsh dumpxml before assuming anything about disks, interfaces, firmware, consoles, or security labels.

Start, stop, and console access

BASH
virsh start vm01
virsh reboot vm01
virsh shutdown vm01
virsh destroy vm01
virsh console vm01

Use shutdown first. Reserve destroy for the same situations where you would force-stop a process.

start

virsh start asks libvirt to boot a defined guest without forcing a configuration change.

shutdown

virsh shutdown is the graceful stop path and should be your default before you escalate to destroy.

console

virsh console DOMAIN attaches your terminal to a text console exposed by the running guest. It is useful when guest networking or SSH is unavailable because the connection travels through libvirt rather than through the guest network.

BASH
virsh console vm01

The domain must be running and its definition must expose a serial or console device. The guest operating system must also be configured to present a serial console or login prompt on that device.

If the command connects but you see no useful output, inspect both sides of that boundary before assuming libvirt is broken:

BASH
virsh domstate vm01
virsh ttyconsole vm01
virsh dumpxml vm01 | grep -A8 -E '<(serial|console)'

virsh ttyconsole vm01 reports the host-side pseudo-terminal associated with the guest console when one is available. The XML shows whether libvirt has a serial/console device configured; the guest still needs its own kernel console and/or getty configuration to use it.

To leave an attached virsh console session, use the default escape sequence Ctrl+]. That disconnects your terminal from the console; it does not stop the virtual machine.

A domain name is the final argument, so the same operation against a guest named bridge-record follows the same shape:

TEXT
virsh console DOMAIN

Substitute the actual domain name only after you have identified the target you intend to attach to.

Snapshot and migration checks

BASH
virsh snapshot-list vm01
virsh domjobinfo vm01
virsh migrate --live vm01 qemu+ssh://hv-b/system

Safe cleanup

BASH
virsh undefine vm01 --nvram
virsh undefine oldvm --remove-all-storage

Read the XML and storage mapping before using the storage removal flags. They are convenient and easy to misuse.

connect

Use virsh connect URI when you want to switch the interactive shell to a different libvirt endpoint without restarting the client.

Field fragment A / 3

A buried recovery channel is watching for knowledge gathered from the manual. This fragment is not an answer to any drill; it proves you reached and read the right subsystem.

Related

  • virsh connection URIs
  • Consoles, graphics, and the QEMU guest agent
  • Libvirt network modes
  • Pool and volume workflows

On this page

  • Inventory and inspect first
  • list --all
  • dumpxml
  • Start, stop, and console access
  • start
  • shutdown
  • console
  • Snapshot and migration checks
  • Safe cleanup
  • connect