Home

virsh

Virsh is a command-line interface for managing virtual machines through the libvirt virtualization API. It provides a text-based control interface to the libvirtd daemon, enabling management of hypervisors such as KVM, QEMU, Xen, and LXC. Virsh can connect to local or remote hosts using libvirt URIs, for example qemu:///system for system-wide VMs or qemu:///session for user sessions.

Core capabilities include listing domains, starting and stopping VMs, defining, undefining, and editing domain definitions, and

Virsh supports a full VM lifecycle and administrative tasks, including shutdown, reboot, suspend, resume, and forceful

Connection and security aspects include authentication and support for remote connections over TLS. Connections can use

managing
related
resources
such
as
storage
pools
and
networks.
It
operates
with
XML
domain
definitions;
users
can
define
a
VM
with
virsh
define
path.xml,
start
it
with
virsh
start
domain,
and
remove
it
with
virsh
undefine
domain.
It
can
also
create
VMs
from
XML,
edit
running
configurations
with
virsh
edit,
and
display
domain
information
with
virsh
dominfo.
destruction.
It
offers
migration
between
hosts,
and
comprehensive
snapshot
management
(snapshot-create-as,
snapshot-list,
snapshot-revert).
Console
access
is
available
via
virsh
console,
and
devices
can
be
attached
or
detached.
It
also
provides
commands
for
managing
storage
pools,
volumes,
and
networks.
various
URIs
such
as
qemu+ssh://,
qemu+tcp://,
or
tls+tcp,
depending
on
the
setup.
Virsh
is
widely
used
in
conjunction
with
graphical
tools
like
virt-manager
and
is
a
core
component
of
many
Linux
virtualization
environments.
It
is
maintained
as
part
of
the
libvirt
project
and
released
under
its
open-source
license.