$ virsh domstats <domain_name>

root@debian01:~# virsh list
2 debian02 running
root@debian01:~# virsh list –inactive
debian03 shut off
root@debian01:~# virsh start debian03
Domain ‘debian03’ started
root@debian01:~# virsh list
2 debian02 running
3 debian03 running
root@debian01:~#
root@debian01:~# virsh net-list –all
default inactive no yes
root@debian01:~# virsh net-start default
Network default started
root@debian01:~# virsh net-autostart default
Network default marked as autostarted
root@debian01:~# virsh net-list –all
default active yes yes
root@debian01:~#
KVM (Kernel-based Virtual Machine) is a virtualization solution for Linux that enables users to run multiple virtual machines (VMs) on a single physical host. Below are some common command-line references for managing KVM:
virt-install: Command-line tool for creating new virtual machines. Example:cssCopy codevirt-install --name=myvm --memory=2048 --vcpus=2 --disk path=/var/lib/libvirt/images/myvm.qcow2,size=20 --cdrom /path/to/install.iso --network bridge=br0virsh: Command-line interface for managing virtual machines. Some useful commands include:
virsh list: List all running VMs.virsh start <domain>: Start a VM.virsh shutdown <domain>: Shutdown a VM gracefully.virsh destroy <domain>: Forcefully shutdown a VM.virsh reboot <domain>: Reboot a VM.virsh suspend <domain>: Suspend a VM.virsh resume <domain>: Resume a suspended VM.virsh net-list: List all defined virtual networks.virsh net-start <network>: Start a virtual network.virsh net-destroy <network>: Destroy a virtual network.virsh net-edit <network>: Edit a virtual network configuration.virt-clone or qemu-img to clone virtual machine disk images. Example with qemu-img:cssCopy codeqemu-img create -f qcow2 -b source_image.qcow2 cloned_image.qcow2virsh snapshot-create <domain>: Create a snapshot of a VM.virsh snapshot-list <domain>: List snapshots of a VM.virsh snapshot-revert <domain> <snapshot>: Revert a VM to a specific snapshot.virsh snapshot-delete <domain> <snapshot>: Delete a snapshot of a VM.qemu-img: Command-line tool for managing disk images. Examples:
qemu-img info disk_image.qcow2: Get information about a disk image.qemu-img resize disk_image.qcow2 +10G: Resize a disk image.qemu-img convert -f qcow2 -O raw disk_image.qcow2 disk_image.raw: Convert disk image formats.These are some of the basic commands for managing KVM virtual machines and resources. For more detailed information and advanced usage, you can refer to the official documentation for KVM and associated tools.