<br><br><div class="gmail_quote">On Sat, Jun 23, 2012 at 3:04 AM, Trey Dockendorf <span dir="ltr"><<a href="mailto:treydock@gmail.com" target="_blank">treydock@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, Jun 22, 2012 at 10:02 AM, mallapadi niranjan<br>
<div><div class="h5"><<a href="mailto:niranjan.ashok@gmail.com">niranjan.ashok@gmail.com</a>> wrote:<br>
><br>
><br>
> On Fri, Jun 22, 2012 at 4:38 PM, mallapadi niranjan<br>
> <<a href="mailto:niranjan.ashok@gmail.com">niranjan.ashok@gmail.com</a>> wrote:<br>
>><br>
>><br>
>><br>
>> On Fri, Jun 22, 2012 at 12:56 PM, Trey Dockendorf <<a href="mailto:treydock@gmail.com">treydock@gmail.com</a>><br>
>> wrote:<br>
>>><br>
>>><br>
>>> On Jun 22, 2012 1:08 AM, "mallapadi niranjan" <<a href="mailto:niranjan.ashok@gmail.com">niranjan.ashok@gmail.com</a>><br>
>>> wrote:<br>
>>> ><br>
>>> > Hi all<br>
>>> ><br>
>>> > I have a Fedora release 17 (Beefy Miracle) with libvirt versions:<br>
>>> ><br>
>>> > libvirt-0.9.11.3-1.fc17.x86_64<br>
>>> > virt-manager-0.9.1-3.fc17.noarch<br>
>>> ><br>
>>> > I have allowed non-root user to user libvirt by allowing the user<br>
>>> > through polkit<br>
>>> ><br>
>>> > cat /etc/polkit-1/localauthority/50-local.d/cat<br>
>>> > 50-org.example-libvirt-remote-access.pkla<br>
>>> ><br>
>>> > [Remote libvirt SSH access]<br>
>>> > Identity=unix-group:virt<br>
>>> > Action=org.libvirt.unix.manage;org.libvirt.unix.monitor<br>
>>> > ResultAny=yes<br>
>>> > ResultInactive=yes<br>
>>> > ResultActive=yes<br>
>>> ><br>
>>> > After doing the above i am able to connect to virt-manager as non-root<br>
>>> > user but unable to create storage pools.<br>
>>> ><br>
>>> > [juno@reserved ~]$ id<br>
>>> > uid=1001(juno) gid=1001(juno) groups=1001(juno),1002(virt)<br>
>>> > context=staff_u:staff_r:staff_t:s0<br>
>>> > [juno@reserved ~]$ virsh<br>
>>> > Welcome to virsh, the virtualization interactive terminal.<br>
>>> ><br>
>>> > Type:  'help' for help with commands<br>
>>> >        'quit' to quit<br>
>>> ><br>
>>> > virsh # pool-list<br>
>>> > error: Failed to reconnect to the hypervisor<br>
>>> > error: no valid connection<br>
>>> > error: Failed to connect socket to '@/home/juno/.libvirt/libvirt-sock':<br>
>>> > Connection refused<br>
>>> ><br>
>>> > virsh # list<br>
>>> > error: Failed to reconnect to the hypervisor<br>
>>> > error: no valid connection<br>
>>> > error: Failed to connect socket to '@/home/juno/.libvirt/libvirt-sock':<br>
>>> > Connection refused<br>
>>> ><br>
>>> > I have defined pool called virt-images (/virt-images) which the<br>
>>> > non-root (in this case the username is Juno)  user has the read/write<br>
>>> > permissions<br>
>>> ><br>
>>> > Also tried adding the permissions to unix socket in<br>
>>> > /etc/libvirt/libvirtd.conf as below:<br>
>>> ><br>
>>> >  cat /etc/libvirt/libvirtd.conf  | grep -v ^$ | grep -v ^#<br>
>>> > unix_sock_group = "virt"<br>
>>> > unix_sock_ro_perms = "0777"<br>
>>> > unix_sock_rw_perms = "0770"<br>
>>> > unix_sock_dir = "/var/run/libvirt"<br>
>>> ><br>
>>> > But the unix socket are created in /var/run/libvirt and not in users<br>
>>> > home directory, So how do we make a non-root user virsh commands check the<br>
>>> > socket created in /var/run/libvirt. It always checks for the socket in<br>
>>> > user's home directory ?<br>
>>> ><br>
>>> > Any pointers on above would be helpfu.<br>
>>> ><br>
>>> > Regards<br>
>>> > Niranjan<br>
>>> ><br>
>>> ><br>
>>> > _______________________________________________<br>
>>> > libvirt-users mailing list<br>
>>> > <a href="mailto:libvirt-users@redhat.com">libvirt-users@redhat.com</a><br>
>>> > <a href="https://www.redhat.com/mailman/listinfo/libvirt-users" target="_blank">https://www.redhat.com/mailman/listinfo/libvirt-users</a><br>
>>><br>
>>> I believe I ran into this, try using this virsh command as the polkit<br>
>>> authorized user<br>
>>><br>
>>> virsh -c qemu:///system<br>
>>><br>
>>> - Trey<br>
>><br>
>> Yeah that worked.<br>
>><br>
>> Thanks a lot trey<br>
><br>
><br>
> Hi<br>
><br>
><br>
> How do i make the below work ?<br>
><br>
> [juno@reserved virt-img]$ virsh -c qemu:///session<br>
><br>
> error: Failed to connect socket to '@/home/juno/.libvirt/libvirt-sock':<br>
> Connection refused<br>
> error: failed to connect to the hypervisor<br>
><br>
><br>
> Regards<br>
> Niranjan<br>
><br>
> _______________________________________________<br>
> libvirt-users mailing list<br>
> <a href="mailto:libvirt-users@redhat.com">libvirt-users@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/libvirt-users" target="_blank">https://www.redhat.com/mailman/listinfo/libvirt-users</a><br>
<br>
</div></div>I'm not familiar with using "qemu:///session", to make an intial<br>
connection I always do something like this...<br>
<br>
# Local connection<br>
$ virsh -c qemu:///system<br>
<br>
# Remote<br>
$ virsh -c ssh+qemu:///treydock@host.tld/system<br>
<br>
What are you trying to achieve with "session" ?<br></blockquote><div><br></div><div>I would like to use virt-manager/virsh using non-root user ,  qemu:///system , connect as root user , I would like to create images and run them using non-root user . </div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Also I noticed you mentioned using a path other than<br>
/var/lib/libvirt/images for the pool, be sure the SELinux contexts are<br>
correct.  Should be virt_image_t, you can set that for a special path<br>
like so...<br>
<br>
$ semanage fcontext -a -t virt_image_t "/virt-img(/.*)?"<br>
$ restorecon -R /virt-img<br></blockquote><div><br></div><div>Yes, i have set the virt_image_t context set for /virt-img directory  </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<span class="HOEnZb"><font color="#888888"><br>
- Trey<br>
</font></span></blockquote></div><br>