Using virsh (command line)

By default, virsh will connect as a normal user to his|her own set of guests on the local machine or, when run as root, to the guests owned by root (known as the system hypervisor).

As we typically share management of servers, we would normally install guests in the system hypervisor.

To access guests in the system hypervisor from a normal user, you need to call virsh with the --connect option.

virsh --connect qemu:///system  ......

To access guests in the system hypervisor on a remote machine, use the following

virsh --connect qemu+ssh://<remoteserver/system .....

The following assume you are running as root, connecting to the system hypervisor on the local machine.

Starting a guest (and connect to serial console)
virsh start <guest> --console

Connect to guest's serial console
virsh console <guest>

Clean shutdown
virsh shutdown <guest>

Kill a guest
virsh destroy <guest>

Modify boot order to network,hd
kvmtool setbootorder --name <guest> --bootorder network,hd

Deleting a guest
kvmtool delete --name <guest>

Note that kvmtool defaults to the system hypervisor regardless of whether it is called as a normal user or root. It also accepts the shortcut --host as a way of accessing the system hypervisor on a remote host.

-- AlastairScobie - 28 Oct 2011

Edit | Attach | Print version | History: r5 | r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 28 Oct 2011 - 15:31:18 - AlastairScobie
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
This Wiki uses Cookies