openSUSE KVM getting started notes

Posted on Fri 03 January 2014 in misc

Some sparse notes on installing KVM on openSUSE locally

Configure libvirtd

Firstly, lets not have to be root every time I want to use virt-manager and without using policy kit.  In /etc/libvirt/libvirtd.conf uncomment and set

unix_sock_group = "libvirt"
unix_sock_ro_perms = "0770"
unix_sock_rw_perms = "0770"
auth_unix_ro = "none"
auth_unix_rw = "none"

(https://doc.opensuse.org/documentation/htmlsingle/openSUSE_122/opensuse-kvm.html#sec.libvirt.connect.auth.libvirt.traditional)

Set default url

I'm just using kvm locally and I don't want to have to type virsh -c qemu:///system every-time to admin on the command-line so I create

~/.config/libvirt/libvirt.conf

and add

uri_default = "qemu:///system"

Now I can just type

virsh list --all

(http://libvirt.org/uri.html)

virsh command hosts

virsh nodeinfo dump CPU and RAM info for the hypervisor 

virsh commands domain management

virsh list --all list info on all vm (domains)

virsh (start|shutdown|reboot|reset) domain

virsh (suspend|resume) domain

virt-viewer domain - open the graphical console for the domain

virsh commands domain info gathering

virsh dominfo domain - show overview of domain (name, cpu, state etc)

virsh domstate domain - show the state of the domain (shut off, running etc)

virsh dumpxml domain - dump the xml configuation for the domain to stdout

virsh edit domain - open the xml configuration for the domain in $EDITOR

virsh define (file) - import a domain from an xml config