- Command Reference

This site is command references for system engineers.

User Tools

Site Tools

Top     SiteMap


Top     SiteMap





Server Software#Virtualization


Brief overview


virsh dialogue terminal

$ virsh --connect qemu:///system
virsh # list --all

virsh commands

Command Description
virsh list ← active guest only
virsh list --all
virsh list --inactive ← inactive guest only
check virtual server status
virsh dominfo GUEST checking guest information(CPU, Memory, Auto start)
virsh console GUEST For logout with 'CTRL+]'
virsh vncdisplay GUEST :0 is TCP 5900
:1 is TCP 5901
virsh start GUEST
virsh autostart GUEST
virsh autostart --disable GUEST
guest start with os boot
ls -lh /etc/libvirt/qemu/autostart/
virsh shutdown GUEST
virsh destroy GUEST
virsh edit GUEST edit xml file for cpu numbers, memory size.
The place of xml file is /etc/libvirt/qemu/GUEST.xml.
virsh dumpxml HOST | less
virsh dumpxml HOST | grep mac
virsh dumpxml GUEST | grep graphics | grep port
virsh define /etc/libvirt/qemu/SERVER.xml
virsh define xxxxx.xml
registration new virtual machine
virsh create /etc/libvirt/qemu/SERVER.xml
virsh create xxxxx.xml
registration new virtual machine and start
virsh undefine SERVER

Installing KVM in Host OS

yum install kvm
yum install virt-manager libvirt libvirt-python python-virtinst
yum groupinstall Virtualization "Virtualization Client" "Virtualization Platform" "Virtualization Tools"
chkconfig libvirtd on

KVM Networking

Checking KVM Network

# brctl show

Creating Bridge Interface

Creating Bridge Interface with brX

brX Basic /etc/sysconfig/network-scripts/ifcfg-eth0
brX bonding /etc/modprobe.d/bonding.conf
brX VLAN /etc/sysconfig/network

Creating Bridge Interface with virbrX

This bridge is use iptables's NAT function.

How to delete virbr0 of NAT.

# brctl show
# ifconfig virbr0
# virsh net-destroy default
# brctl show

# virsh net-list --all
# virsh net-autostart default --disable
# virsh net-list --all

Guest OS




  • If you want to use snapshot, you must use a qcow2 file format.
Command Description
create snapshot virsh snapshot-create-as [Guest_Name] [Snapshot_Name] [Description]
recovery snapshot virsh snapshot-revert [Guest_Name] [Snapshot_Name]
list snapshot virsh snapshot-list [Guset_Name]
virsh snapshot-list [Guset_Name] --tree
delete snapshot virsh snapshot-delete [Guset_Name] [Snapshot_Name]


virsh migrate --live centos7 qemu+ssh://xx.xx.xx.xx/system

middleware/virtualization/kvm/index.html.txt · Last modified: 2017/05/30 by admin