KVM: Starting / Stopping Guest Operating Systems With virsh Command

Submitted by erick on Mon, 08/15/2016 - 13:32

KVM

The virsh command can be used to mange local or remote guest operating systems. The program can be used to create, pause, and shutdown domains. It can also be used to list current domains.

 

List Running VMS

 

Type the following command:

[geshifilter-code]# virsh list [/geshifilter-code]

 

Sample outputs:

 

 Id Name                 State
----------------------------------
  1 smaller.com          running
  2 redhat               running

 

 

Suspend A Guest

[geshifilter-code]virsh&nbsp;suspend osclass<br /> Domain osclass suspended<br /> &nbsp;<code> [/geshifilter-code]

[geshifilter-code]<code>Shut Down A Guest[/geshifilter-code]

[geshifilter-code]<code>virsh list<br /> # virsh shutdown smaller.com<br /> # virsh shutdown redhat<br /> # virsh shutdown 2[/geshifilter-code]

[geshifilter-code]<code>&nbsp;[/geshifilter-code]

[geshifilter-code]<code>Rebooting A Guest[/geshifilter-code]

[geshifilter-code]<code># virsh list<br /> # virsh reboot domaiName<br /> # virsh reboot 3<br /> # virsh reboot win2008biz[/geshifilter-code]

[geshifilter-code]<code>&nbsp;[/geshifilter-code]