Tutorial, Internet, Hardware, Software, Os, Linux, Android, Security, Mikrotik

13 March, 2015

Managing A KVM Guest From The Command Line

Managing A KVM Guest From The Command Line
KVM guests can be managed through virsh, the "virtual shell". To connect to the virtual shell, run
virsh --connect qemu:///system
This is how the virtual shell looks:
[root@server1 ~]# virsh --connect qemu:///system
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit
You can now type in commands on the virtual shell to manage your guests. Run
help to get a list of available commands:
virsh # help
virsh #list
shows all running guests;
virsh #list --all
shows all guests, running and inactive:
virsh # list --all
 Id Name                 State
----------------------------------
  3 vm11                 running
  - vm10                 shut of
If you modify a guest's xml file (located in the /etc/libvirt/qemu/ directory), you must redefine the guest:
define /etc/libvirt/qemu/vm10.xml
Please note that whenever you modify the guest's xml file in /etc/libvirt/qemu/, you must run the define command again!
To start a stopped guest, run:
start vm10
To stop a guest, run
shutdown vm10
To immediately stop it (i.e., pull the power plug), run
destroy vm10
Suspend a guest:
suspend vm10
Resume a guest:
resume vm10
These are the most important commands.Type :
quit
to leave the virtual shell.

No comments:

Post a Comment

Terima kasih atas komentarnya