virsh worked after I created .libvirt dir in user eucalyptus home dir.
John
________________________________
From: Qu, John (IS)
Sent: Thursday, March 08, 2012 9:54 PM
To: libvirt-users at redhat.com
Cc: Qu, John (IS)
Subject: run virsh as non-root user
Hi,
I have encountered problem running virsh as non-root user. I am using eucalyptus
software on top of KVM, eucalyptus requires to run virsh as non-root user.
I've found that people had similiar issue posted in the list, but I
didn't find the solution. I've tried few things.
1) put user eucalyptus in the libvirt group.
2) even changed owner /var/run/libvirt/libvirt-sock to eucalyptus.
it didn't help. the followins showed some debug information. I would
appreciate your help.
export LIBVIRT_DEBUG=1
[eucalyptus at hp-a ~]$ virsh list
21:48:08.342: 5830: info : libvirt version: 0.9.4, package: 23.el6_2.4 (CentOS
BuildSystem <http://bugs.centos.org>, 2012-01-17-10:52:29,
c6b18n1.dev.centos.org)
21:48:08.342: 5830: debug : virInitialize:415 : register drivers
21:48:08.342: 5830: debug : virRegisterDriver:770 : driver=0x3848dc5c40
name=Test
21:48:08.342: 5830: debug : virRegisterDriver:794 : registering Test as driver 0
21:48:08.342: 5830: debug : virRegisterNetworkDriver:587 : registering Test as
network driver 0
21:48:08.342: 5830: debug : virRegisterInterfaceDriver:620 : registering Test as
interface driver 0
21:48:08.342: 5830: debug : virRegisterStorageDriver:653 : registering Test as
storage driver 0
21:48:08.342: 5830: debug : virRegisterDeviceMonitor:686 : registering Test as
device driver 0
21:48:08.342: 5830: debug : virRegisterSecretDriver:719 : registering Test as
secret driver 0
21:48:08.342: 5830: debug : virRegisterNWFilterDriver:752 : registering Test as
network filter driver 0
21:48:08.342: 5830: debug : virRegisterDriver:770 : driver=0x3848dc6e00 name=ESX
21:48:08.342: 5830: debug : virRegisterDriver:794 : registering ESX as driver 1
21:48:08.342: 5830: debug : virRegisterInterfaceDriver:620 : registering ESX as
interface driver 1
21:48:08.342: 5830: debug : virRegisterNetworkDriver:587 : registering ESX as
network driver 1
21:48:08.342: 5830: debug : virRegisterStorageDriver:653 : registering ESX as
storage driver 1
21:48:08.342: 5830: debug : virRegisterDeviceMonitor:686 : registering ESX as
device driver 1
21:48:08.342: 5830: debug : virRegisterSecretDriver:719 : registering ESX as
secret driver 1
21:48:08.342: 5830: debug : virRegisterNWFilterDriver:752 : registering ESX as
network filter driver 1
21:48:08.342: 5830: debug : virRegisterDriver:770 : driver=0x3848dc6440
name=remote
21:48:08.342: 5830: debug : virRegisterDriver:794 : registering remote as driver
2
21:48:08.342: 5830: debug : virRegisterNetworkDriver:587 : registering remote as
network driver 2
21:48:08.342: 5830: debug : virRegisterInterfaceDriver:620 : registering remote
as interface driver 2
21:48:08.342: 5830: debug : virRegisterStorageDriver:653 : registering remote as
storage driver 2
21:48:08.342: 5830: debug : virRegisterDeviceMonitor:686 : registering remote as
device driver 2
21:48:08.342: 5830: debug : virRegisterSecretDriver:719 : registering remote as
secret driver 2
21:48:08.342: 5830: debug : virRegisterNWFilterDriver:752 : registering remote
as network filter driver 2
21:48:08.342: 5830: debug : virEventRegisterDefaultImpl:204 : registering
default event implementation
21:48:08.342: 5830: debug : virEventPollAddHandle:112 : Add handle fd=4 events=1
cb=0x3848a40cb0 opaque=(nil)
21:48:08.342: 5830: debug : virEventPollAddHandle:116 : Used 0 handle slots,
adding at least 10 more
21:48:08.342: 5830: debug : virEventPollInterruptLocked:676 : Skip interrupt, 0
0
21:48:08.342: 5830: debug : virEventRegisterImpl:177 : addHandle=0x3848a41a90
updateHandle=0x3848a40bb0 removeHandle=0x3848a40a70 addTimeout=0x3848a418f0
updateTimeout=0x3848a40cf0 removeTimeout=0x3848a40970
21:48:08.342: 5830: debug : virConnectOpenAuth:1282 : name=(null),
auth=0x3848dc5bc0, flags=0
21:48:08.342: 5830: debug : do_open:1019 : no name, allowing driver auto-select
21:48:08.342: 5830: debug : do_open:1056 : trying driver 0 (Test) ...
21:48:08.342: 5830: debug : do_open:1062 : driver 0 Test returned DECLINED
21:48:08.342: 5830: debug : do_open:1056 : trying driver 1 (ESX) ...
21:48:08.342: 5830: debug : do_open:1062 : driver 1 ESX returned DECLINED
21:48:08.342: 5830: debug : do_open:1056 : trying driver 2 (remote) ...
21:48:08.343: 5830: debug : remoteOpen:825 : Auto-probe remote URI
21:48:08.343: 5830: debug : remoteOpen:828 : Auto-spawn user daemon instance
21:48:08.343: 5830: debug : doRemoteOpen:520 : proceeding with name
21:48:08.343: 5830: debug : doRemoteOpen:530 : Connecting with transport 1
21:48:08.343: 5830: debug : doRemoteOpen:577 : Proceeding with sockname
@/home/eucalyptus/.libvirt/libvirt-sock
21:48:08.343: 5830: debug : virCommandRunAsync:2048 : About to run LC_ALL=C
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/java/jdk1.6.0/jre/bin
HOME=/home/eucalyptus USER=eucalyptus LOGNAME=eucalyptus /usr/sbin/libvirtd
--timeout=30
21:48:08.343: 5830: debug : virCommandRunAsync:2064 : Command result 0, with PID
5831
21:48:08.345: 5830: debug : virCommandRun:1870 : Result status 0, stdout:
'(null)' stderr: '(null)'
---------------------------------
[eucalyptus at hp-a ~]$ id
uid=501(eucalyptus) gid=501(eucalyptus)
groups=501(eucalyptus),0(root),502(libvirt)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
-------------------------------------------------------------
Thanks
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://listman.redhat.com/archives/libvirt-users/attachments/20120309/fa96b7ca/attachment.htm>