Pages

Showing posts with label virsh-error. Show all posts
Showing posts with label virsh-error. Show all posts

Wednesday, February 27, 2013

error: Requested operation is not valid: Disk does not support snapshotting

error: Requested operation is not valid: Disk  does not support snapshot

This error arises when you try to take a snapshot of a VM hard disk with virsh command
as shown below


virsh snapshot-create Clusterbase

error: Requested operation is not valid: Disk '/path/to/kvm/clusterbase.img' does not support snapshot.

If you see image of this VM is .img format, by default Virsh snapshot will work only for qcow2 format as of time of this post writing. So first convert that image to qcow2 format and then try to do a snapshot t with same command.

Convert img file to  qcow2 format


qemu-img convert -f raw -O qcow2 /path/to/kvm/clusterbase.img /path/to/kvm/clusterbase.qcow2

Hope this helps to resolve this error.

Wednesday, October 3, 2012

Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied

Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied


This error will occurs if the user do not have permissions to connect to virt-manager or virtviewer tools.
To resolve this issue execute below commands

Step1: Conform if your root user account have permissions or not

virsh -c qemu:///system list

if you dont see any issue from root user, try to execute the same command with normal user where you want to start virt-viewer or virt-manager. If you see any issues such as "failed to connect socket" issue with normal user then he should be member of libvirtd group first. Follow below procedure.

Step2: Add the user account as secondary group member to libvirtd group

Note: Before doing anything keep in mind that this user may be member of many other already existing groups so add this user account to them as well.

usermod -G libvirtd,group2,group3 -a username

Step3: Now we have to change the settings in /etc/libvirt/libvirtd.conf. Open /etc/libvirt/libvirtd.conf as root and search for following lines and remove the comments for that lines.
vi /etc/libvirt/libvirtd.conf
Now remove comments from the lines which contains below info.

unix_sock_group = "libvirtd"
unix_sock_ro_perms = "0777"
 unix_sock_rw_perms = "0770"

With the first line we are mentioning that libvirtd group is allowed to very one and r/o and r/w permissions for all the users who belongs to this group.

Hope this helps some one.