Last updated
Last updated
virsh
is a command-line interface for managing virtual machines via libvirt, typically used with KVM, QEMU, and other virtualization technologies. It supports operations like VM lifecycle management, storage, network, snapshots, and resource monitoring.
Lifecycle Management: Start, stop, suspend, and destroy VMs.
Persistent and Transient VMs: Manage both runtime and saved configurations.
Storage and Networking: Control virtual disks, volumes, and virtual networks.
Snapshots: Create and revert to VM snapshots.
Remote Management: Manage VMs on remote hosts over SSH or TLS.
Interactive and Non-interactive Use: Run commands or enter an interactive shell.
Example:
List VMs (running or all)
Start / Shutdown / Destroy / Reboot
Suspend / Resume
Autostart on Boot
Get VM Information
CPU and Memory Statistics
Dump or Edit XML Configuration
Define or Undefine Domains
Create and Manage Snapshots
Connect to Serial Console
To exit: Ctrl+]
List, Create, and Delete Volumes
Pool Management
List, Start, and Define Networks
Connect to Remote Host
Enter Interactive Shell
virsh
is an indispensable tool for Linux-based virtualization environments using libvirt. It provides complete lifecycle control, resource introspection, and management capabilities for virtual machines, networks, and storage — both locally and remotely. It’s highly scriptable and favored for automation and infrastructure orchestration workflows.