LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

virsh

Libvirt virtualization management CLI

TLDR

List running VMs
$ virsh list
copy
List all VMs
$ virsh list --all
copy
Start VM
$ virsh start [vm-name]
copy
Shutdown VM
$ virsh shutdown [vm-name]
copy
Force stop VM
$ virsh destroy [vm-name]
copy
Connect to console
$ virsh console [vm-name]
copy
Show VM info
$ virsh dominfo [vm-name]
copy
Define VM from XML
$ virsh define [vm.xml]
copy

SYNOPSIS

virsh [-c uri] command [args]

DESCRIPTION

virsh is the command-line interface for managing virtual machines through the libvirt virtualization API. It provides unified control over KVM, QEMU, Xen, and other hypervisors, handling domain lifecycle operations, storage pools, virtual networks, and snapshots.Domains (VMs) can be started, stopped, paused, and migrated. The console command provides serial access to running VMs (exit with Ctrl+]). Domain configurations are defined in XML and can be created, modified, and exported. The tool also manages storage pools, volumes, and virtual networks for complete virtualization infrastructure control.

PARAMETERS

list

List domains.
start NAME
Start domain.
shutdown NAME
Graceful shutdown.
destroy NAME
Force stop.
console NAME
Serial console.
dominfo NAME
Domain info.
define XML
Define domain.
undefine NAME
Remove domain.
-c URI
Connection URI.

INSTALL

sudo apt install libvirt-clients
copy
sudo dnf install libvirt-client
copy
sudo apk add libvirt-client
copy
sudo zypper install libvirt-client
copy

CAVEATS

Requires libvirt daemon. Root for system VMs. XML syntax complex.

HISTORY

virsh is the command-line interface for libvirt, the virtualization API. It provides unified management for multiple hypervisors.

SEE ALSO

virt-manager(1), qemu(1), kvm(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid