The virsh command is an alternative command to manage a Red Hat Enterprise Linux 5 KVM environment using a Command Line Interface(CLI). The virsh command is provided as part of the libvirt API which provides a common API to applications requiring standardized access to interact with KVM using a stable interface.
The following are basic and commonly used virsh commands:
help print help list list domains create create a domain from an XML file start start a previously created inactive domain destroy destroy a domain define define (but do not start) a domain from an XML file domid convert a domain name or UUID to domain id domuuid convert a domain name or id to domain UUID dominfo domain information domname convert a domain id or UUID to domain name domstate domain state quit quit this interactive terminal reboot reboot a domain restore restore a domain from a saved state in a file resume resume a domain save save a domain state to a file shutdown gracefully shutdown a domain suspend suspend a domain undefine undefine an inactive domain
List running guest VMs
Type the following command:
# virsh list
Sample outputs:
Id Name State ---------------------------------- 1 VM01 running 2 VM02 running
Staring a guest VM
Type the following command:
# virsh start VM01
Shutddowwn a guest VM
Type the following command:
# virsh shutdown VM01
Or, you can forcefully stop a guest VM with following command:
# virsh destroy VM01
Rebooting a guest VM
Type the following command:
# virsh reboot VM01
Related Posts:
- How To Install Solr 4.10.4 On CentOS 6.5
- How To Restore Default Permissions Of All Files Under / (ROOT)
- How To Install Subversion (SVN) Extension Working With PHP 5.3
- How To Setup Iptables Firewall For A Web Server On CentOS
- How Do I Fix “Host is blocked because of many connection error” In MySQL
- Repel port flood by CSF and IPT_Recent
- What is the role of this variables in php.ini file (expose_php – allow_url_fopen – register_globals) ?
- How Do I Block An IP Address On Linux Server ?
- How To Flush The Entire Contents Of Memcache Server
- How To Setup A LAMP Server On Centos 6.0