This is an old revision of the document!
LIBVIRT
virsh cheatsheet:http://blog.programster.org/kvm-cheatsheet/External Link
BASIC OPERATIONS
virsh shutdown guest1 --mode acpi
virsh suspend guest1
virsh reset guest1
virsh managedsave guest1 --running # to save running state. virsh start guest1 # starts it from the point it was saved
Hypervisor level network definitions (xml) are in:
/usr/share/libvirt/networks/
Rest of them (virtual networks) are in:
/var/lib/libvirt/dnsmasq
If you edit the network with “virsh net-edit”, any changes you make won't take effect until the network is destroyed and re-started, which unfortunately will cause a all guests to lose network connectivity with the host until their network interfaces are explicitly re-attached.
SOMETIMES the only way is to produce an xml file of the current network with xmldump, destroy-undefine it , modify the xml and then define and start it!
XML config can be reloaded & activated:
virsh net-define /usr/share/libvirt/networks/default.xml
Network default defined from /usr/share/libvirt/networks/default.xml
virsh net-autostart default
Network default marked as autostarted
virsh net-start default
Network default started
Deactivate and then remove a network:
virsh net-destroy <name> virsh net-undefine <name>
Editing the attributes of a Virtual Machine
$ virsh dumpxml foo > /tmp/foo.xml $ virsh define /tmp/foo.xml
Install restart and add vms from cli:
yum groupinstall Virtualization "Virtualization Client" \ "Virtualization Platform" "Virtualization Tools"
http://jensd.be/207/linux/install-and-use-centos-7-as-kvm-virtualization-host
Logs location:
VIRTUALBOX\\:
CLI commands:
VBoxManage list runningvms VBoxManage controlvm <vm> savestate VBoxManage startvm "Windows XP"