lost and found ( for me ? )

Showing posts with label compile. Show all posts
Showing posts with label compile. Show all posts

CentOS 6.3 64 bit : install dnsperf from source code

dnsperf is a DNS stressing tool provided by Nominum.
dnsperf is similar to queryperf in which included BIND source packages.

As for CentOS4,5,6 32bit ver , there are RPM packages , however there are no RPM packages for 64bit OSes.
http://www.nominum.com/support/measurement-tools/

So I’ll build dnsperf from source code.

# uname –ri
2.6.32-279.11.1.el6.x86_64 x86_64

# cat /etc/centos-release
CentOS release 6.3 (Final)


[ logs when building dnsperf including trial and error ]

download dnsperf-src-2.0.0.0-1.tar.gz from http://www.nominum.com/support/measurement-tools/
# tar xzvf dnsperf-src-2.0.0.0-1.tar.gz
# cd dnsperf-src-2.0.0.0-1


To build dnssperf , BIND 9.4 or greater has been installed , including library and header files. ( please check README file )

install bind , bind library , bind header files , gcc and make with yum
# yum install -ybind bind-devel bind-libs
# yum install make gcc –y


build dnsperf
# sh configure


error.. dns.c:46:25: error: isc/hmacsha.h: No such file or directory
# make
gcc -g -O2 -I/usr/include -D_REENTRANT -DDIG_SIGCHASE -D_GNU_SOURCE -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_LIBNSL=1 -DHAVE_PTHREAD=1 -pthread -c dnsperf.c
gcc -g -O2 -I/usr/include -D_REENTRANT -DDIG_SIGCHASE -D_GNU_SOURCE -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_LIBNSL=1 -DHAVE_PTHREAD=1 -pthread -c datafile.c
gcc -g -O2 -I/usr/include -D_REENTRANT -DDIG_SIGCHASE -D_GNU_SOURCE -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_LIBNSL=1 -DHAVE_PTHREAD=1 -pthread -c dns.c
dns.c:46:25: error: isc/hmacsha.h: No such file or directory
dns.c:96: error: expected specifier-qualifier-list before 'isc_hmacsha1_t'
dns.c: In function 'perf_dns_parsetsigkey':
dns.c:246: error: 'ISC_SHA1_DIGESTLENGTH' undeclared (first use in this function)
dns.c:246: error: (Each undeclared identifier is reported only once
dns.c:246: error: for each function it appears in.)
dns.c:248: error: 'ISC_SHA224_DIGESTLENGTH' undeclared (first use in this function)
dns.c:250: error: 'ISC_SHA256_DIGESTLENGTH' undeclared (first use in this function)
dns.c:252: error: 'ISC_SHA384_DIGESTLENGTH' undeclared (first use in this function)
dns.c:254: error: 'ISC_SHA512_DIGESTLENGTH' undeclared (first use in this function)
dns.c: In function 'hmac_init':
dns.c:344: error: 'hmac_ctx_t' has no member named 'hmacsha1'
dns.c:347: error: 'hmac_ctx_t' has no member named 'hmacsha224'
dns.c:350: error: 'hmac_ctx_t' has no member named 'hmacsha256'
dns.c:353: error: 'hmac_ctx_t' has no member named 'hmacsha384'
dns.c:356: error: 'hmac_ctx_t' has no member named 'hmacsha512'
dns.c: In function 'hmac_update':
dns.c:370: error: 'hmac_ctx_t' has no member named 'hmacsha1'
dns.c:373: error: 'hmac_ctx_t' has no member named 'hmacsha224'
dns.c:376: error: 'hmac_ctx_t' has no member named 'hmacsha256'
dns.c:379: error: 'hmac_ctx_t' has no member named 'hmacsha384'
dns.c:382: error: 'hmac_ctx_t' has no member named 'hmacsha512'
dns.c: In function 'hmac_sign':
dns.c:396: error: 'hmac_ctx_t' has no member named 'hmacsha1'
dns.c:399: error: 'hmac_ctx_t' has no member named 'hmacsha224'
dns.c:402: error: 'hmac_ctx_t' has no member named 'hmacsha256'
dns.c:405: error: 'hmac_ctx_t' has no member named 'hmacsha384'
dns.c:408: error: 'hmac_ctx_t' has no member named 'hmacsha512'
dns.c: In function 'add_tsig':
dns.c:427: error: 'ISC_SHA256_DIGESTLENGTH' undeclared (first use in this function)
make: *** [dns.o] Error 1


Seen from README , it describes:
  Note: many versions of bind do not correctly install the <isc/hmacsha.h>
  header file, so if the compilation fails, obtain this file from the BIND
  source distribution, and install it in the appropriate place.


where is “hmacsha.h” header file ?
# rpm -ql `rpm -qa | grep bind-devel` | grep hmac
/usr/include/isc/hmacmd5.h
#


nn , hmacsha.h has not been installed..

download bind-9.9.2.tar.gz from www.isc.org and copy hmacsha.h file to /usr/include/isc directory.
# bind-9.9.2.tar.gz
# tar xzvf bind-9.9.2.tar.gz
# cp bind-9.9.2/lib/isc/include/isc/hmacsha.h /usr/include/isc/


try again
# sh configure


error .
# make
gcc -pthread dnsperf.o  libperf.a -lnsl  -L/usr/lib -lbind9 -ldns -lgssapi_krb5 -lcrypto -lisccfg -lisc -ldl -lcap -lpthread -lxml2 -lz -lm  -lm -o dnsperf
/usr/bin/ld: cannot find -lgssapi_krb5
collect2: ld returned 1 exit status
make: *** [dnsperf] Error 1


where is “lgssapi_krb5” ?
# locate gssapi_krb5
/lib64/libgssapi_krb5.so.2
/lib64/libgssapi_krb5.so.2.2


make a symbolic link.
# ln -s /lib64/libgssapi_krb5.so.2.2 /usr/lib64/libgssapi_krb5.so

# ls -l /usr/lib64/libgssapi_krb5.so
lrwxrwxrwx 1 root root 28 Oct 31 21:59 /usr/lib64/libgssapi_krb5.so -> /lib64/libgssapi_krb5.so.2.2


error
# make
gcc -pthread dnsperf.o  libperf.a -lnsl  -L/usr/lib -lbind9 -ldns -lgssapi_krb5 -lcrypto -lisccfg -lisc -ldl -lcap -lpthread -lxml2 -lz -lm  -lm -o dnsperf
/usr/bin/ld: cannot find -lcrypto
collect2: ld returned 1 exit status
make: *** [dnsperf] Error 1

# ln -s /usr/lib64/libcrypto.so.10 /usr/lib64/libcrypto.so


error
# make
gcc -pthread dnsperf.o  libperf.a -lnsl  -L/usr/lib -lbind9 -ldns -lgssapi_krb5 -lcrypto -lisccfg -lisc -ldl -lcap -lpthread -lxml2 -lz -lm  -lm -o dnsperf
/usr/bin/ld: cannot find -lcap
collect2: ld returned 1 exit status
make: *** [dnsperf] Error 1

# yum install libcap-devel

# make
gcc -pthread dnsperf.o  libperf.a -lnsl  -L/usr/lib -lbind9 -ldns -lgssapi_krb5 -lcrypto -lisccfg -lisc -ldl -lcap -lpthread -lxml2 -lz -lm  -lm -o dnsperf
/usr/bin/ld: cannot find -lxml2
collect2: ld returned 1 exit status
make: *** [dnsperf] Error 1

# yum install libxml2-devel -y

# sh configure

# make
gcc -pthread dnsperf.o  libperf.a -lnsl  -L/usr/lib -lbind9 -ldns -lgssapi_krb5 -lcrypto -lisccfg -lisc -ldl -lcap -lpthread -lxml2 -lz -lm  -lm -o dnsperf
gcc -g -O2 -I/usr/include -D_REENTRANT -DDIG_SIGCHASE -D_GNU_SOURCE -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_LIBNSL=1 -DHAVE_PTHREAD=1 -pthread -c resperf.c
gcc -pthread resperf.o  libperf.a -lnsl  -L/usr/lib -lbind9 -ldns -lgssapi_krb5 -lcrypto -lisccfg -lisc -ldl -lcap -lpthread -lxml2 -lz -lm  -lm -o resperf

# make install
mkdir -p /usr/local/bin
mkdir -p /usr/local/share/man/man1
/usr/bin/install -c  dnsperf /usr/local/bin
/usr/bin/install -c  resperf /usr/local/bin
/usr/bin/install -c  resperf-report /usr/local/bin
/usr/bin/install -c -m 644  dnsperf.1 /usr/local/share/man/man1
/usr/bin/install -c -m 644  resperf.1 /usr/local/share/man/man1


Okay , get things done :D

compile unbound 1.4.16 on CentOS 6.2 64bit


# cat /etc/redhat-release
CentOS release 6.2 (Final)

# uname -ri
2.6.32-220.7.1.el6.x86_64 x86_64

download unbound-1.4.16.tar.gz from http://www.unbound.net/download.html

[ preparation ]

install RPMs via yum
# yum install –y gcc openssl openssl-devel expat expat-devel make


download ldns from http://www.nlnetlabs.nl/projects/ldns/ and compile it.
# tar xzvf ldns-1.6.12.tar.gz
# cd ldns-1.6.12
# ./configure --disable-gost
# make
# make install

# ls /usr/local/lib/
libldns.a  libldns.la  libldns.so  libldns.so.1  libldns.so.1.6.12

# ls /usr/local/include/ldns/
buffer.h         dnssec_zone.h  ldns.h    resolver.h      tsig.h
common.h         error.h        net.h     rr.h            update.h
dname.h          higher.h       packet.h  rr_functions.h  util.h
dnssec.h         host2str.h     parse.h   sha1.h          wire2host.h
dnssec_sign.h    host2wire.h    rbtree.h  sha2.h          zone.h
dnssec_verify.h  keys.h         rdata.h   str2host.h

[ compile unbound ]

# yum install –y gcc openssl openssl-devel expat expat-devel
# tar xzvf unbound-1.4.16.tar.gz
# cd unbound-1.4.16
# ./configure --disable-gost
# make
# make install


config file
# head -5 /usr/local/etc/unbound/unbound.conf
#
# Example configuration file.
#
# See unbound.conf(5) man page, version 1.4.16.
#


start unbound
nn , error
# /usr/local/sbin/unbound
/usr/local/sbin/unbound: error while loading shared libraries: libldns.so.1: cannot open shared object file: No such file or directory

# locate libldns.so.1
/usr/local/lib/libldns.so.1
/usr/local/lib/libldns.so.1.6.12


re-compile unbound
specify ldns’s dir.
# ./configure --disable-gost --with-ldns=/usr/local/
# make
# make install

start unbound
# /usr/local/sbin/unbound
[1333368325] unbound[25463:0] fatal error: user 'unbound' does not exist.

add unbound user.
# adduser unbound -s /bin/false

start unbound
# /usr/local/sbin/unbound
# lsof -ni:53
COMMAND   PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
unbound 25484 unbound    3u  IPv6  94645      0t0  UDP [::1]:domain
unbound 25484 unbound    4u  IPv6  94647      0t0  TCP [::1]:domain (LISTEN)
unbound 25484 unbound    5u  IPv4  94649      0t0  UDP 127.0.0.1:domain
unbound 25484 unbound    6u  IPv4  94651      0t0  TCP 127.0.0.1:domain (LISTEN)


make keys to use unbound-control command
# /usr/local/sbin/unbound-control-setup


edit unbound.conf
# egrep control-enable  /usr/local/etc/unbound/un
bound.conf
       # control-enable: no
        control-enable: yes

stop/start unbound
# kill ‘unbound’s PID’

# /usr/local/sbin/unbound

# unbound-control status
version: 1.4.16
verbosity: 1
threads: 1
modules: 2 [ validator iterator ]
uptime: 7 seconds
unbound (pid 25521) is running...

confirm name resolution
# dig @127.1 www.google.com +short
www.l.google.com.
74.125.235.83
74.125.235.81
74.125.235.84
74.125.235.82
74.125.235.80


Linux Mint 12 : Build qemu-kvm , libvirt , virt-manager from source ( not apt-get ! )




Here’s an explanation of how to build qemu-kvm , libvirtd and virt-manager from source including trial and error.
# uname -ri
3.0.0-15-generic x86_64
# tail -1 /etc/lsb-release
DISTRIB_DESCRIPTION="Linux Mint 12 Lisa"


[ uninstall kvm , libvirt-bin , virt-manager via apt-get if you have installed them ]
# apt-get remove kvm libvirt-bin virt-manger –y
# apt-get autoremove


back up the current libvirtd configuration.
# tar czvf libvirt.tgz /etc/libvirt/
tar: メンバ名から先頭の `/' を取り除きます
/etc/libvirt/
/etc/libvirt/storage/
/etc/libvirt/storage/default.xml
/etc/libvirt/storage/disk1.xml
/etc/libvirt/storage/autostart/
/etc/libvirt/storage/autostart/default.xml
/etc/libvirt/storage/autostart/disk1.xml
/etc/libvirt/qemu/
/etc/libvirt/qemu/centos6-32-vm1.xml
/etc/libvirt/qemu/centos6-64-vm1.xml
/etc/libvirt/qemu/networks/
/etc/libvirt/qemu/networks/autostart/
/etc/libvirt/qemu/networks/autostart/default.xml

rm /usr/bin/kvm which is a symbolic file to /usr/bin/qemu-system-x86_64.
# rm -rf /usr/bin/kvm



[ build qemu-kvm from source ]

download qemu-kvm-1.0.tar.gz from http://sourceforge.net/projects/kvm/files/qemu-kvm/1.0/
and build it.
# tar xzvf qemu-kvm-1.0.tar.gz
# ./configure
# make
# make install

# ls /usr/local/bin/qemu-*
/usr/local/bin/qemu-ga   /usr/local/bin/qemu-nbd
/usr/local/bin/qemu-img  /usr/local/bin/qemu-system-x86_64
/usr/local/bin/qemu-io

# /usr/local/bin/qemu-system-x86_64 --version
QEMU emulator version 1.0 (qemu-kvm-1.0), Copyright (c) 2003-2008 Fabrice Bellard


[ build libvirt ]

download libvirt-0.9.9 tar.gz from http://libvirt.org/sources/ and build it.
# tar xzvf libvirt-0.9.9.tar.gz
# cd libvirt-0.9.9/


nn , error
# ./configure
checking for LIBXML... no
checking libxml2 xml2-config >= 2.6.0 ... configure: error: Could not find libxml2 anywhere (see config.log for details).


I have already installed libxml2 via apt-get
# dpkg -l libxml2 | tail -1
ii  libxml2                                2.7.8.dfsg-4ubuntu0.1                        GNOME XML library

# dpkg -L  libxml2 | grep "/lib/"
/usr/lib/libxml2.so.2.7.8
/usr/lib/libxml2.so.2


error
# ./configure --with-libxml=/usr/lib
checking pkg-config is at least version 0.9.0... yes
checking libxml2 /usr/lib/bin/xml2-config >= 2.6.0 ... configure: error: Could not find libxml2 anywhere (see config.log for details).


install libxml2-dev
# apt-get install libxml2-dev -y

# dpkg -l libxml2*
ii  libxml2        2.7.8.dfsg-4ub GNOME XML library
ii  libxml2-dev    2.7.8.dfsg-4ub Development files for the GNOME XML library
ii  libxml2-utils  2.7.8.dfsg-4ub XML utilities


try again. another error.
# ./configure
configure: error: You must install the GnuTLS library in order to compile and run libvirt


install gnutls via apt-get
# apt-get install gnutls-bin gnutls-dev

# ./configure
configure: error: You must install device-mapper-devel/libdevmapper >= 1.0.0 to compile libvirt

# apt-get install libdevmapper-dev libdevmapper

# ./configure
configure: error: You must install python-devel to build Python bindings

# apt-cache search python-dev

# ./configure
checking for LIBNL... no
configure: error: libnl-devel >= 1.1 is required for macvtap support

# apt-get install libnl1 libnl-dev

# ./configure
configure:      Readline: no
configure:        Python: yes
configure:        DTrace: no
configure:   XML Catalog: /etc/xml/catalog
configure:   Init script: check
configure:
configure: Privileges
configure:
configure:       QEMU: root:root
configure:#

# make
# make install

# ls /usr/local/bin/vir*
/usr/local/bin/virsh         /usr/local/bin/virt-install
/usr/local/bin/virt-clone    /usr/local/bin/virt-pki-validate
/usr/local/bin/virt-convert  /usr/local/bin/virt-xml-validate
/usr/local/bin/virt-image
# /usr/local/sbin/libvirtd --version
/usr/local/sbin/libvirtd (libvirt) 0.9.9


[ build virt-manager ]

download virtinst 0.600.1 and virt-manager 0.90.1 from http://virt-manager.org/download.html

At first , build virtinst
# tar xzvf virtinst-0.600.1.tar.gz
# cd virtinst-0.600.1
# python setup.py install


build virt-manager
# tar xzvf virt-manager-0.9.1.tar.gz
# cd virt-manager-0.9.1/

# ./configure
configure: Required virtinst:               0.600.1
configure: Default qemu user:               root
configure: Install TUI:                     yes
configure: Enable unsupported RHEL options: yes
configure: Preferred distros:               none
configure: Libvirt packages:                none
configure: KVM packages:                    none
configure: Default graphics:                vnc

# make

# ls /usr/local/bin/virt-ma*
/usr/local/bin/virt-manager  /usr/local/bin/virt-manager-tui


Okay , get everything done , I think..

[ start libvirtd ]

start libvirtd ( -d : run libvirtd as daemon. )
# /usr/local/sbin/libvirtd –d


[ connect to libvirt via virsh ]
# LANG=C /usr/local/bin/virsh

virsh # version
Compiled against library: libvir 0.9.9
Using library: libvir 0.9.9
Using API: QEMU 0.9.9
Running hypervisor: QEMU 1.0.0


[ connect to libvirt via virt-manager ]
$ /usr/local/bin/virt-manager
   import urlgrabber.progress as progress
ImportError: No module named urlgrabber.progress


install python-urlgrabber
# apt-get install python-urlgrabber -y

$ /usr/local/bin/virt-manager
   import gtkvnc
ImportError: No module named gtkvnc

# apt-get install –y libgtk-vnc-1.0-0 python-gtk-vnc


GUI has appeared..  however I can’t connect to livbirtd.

Unable to connect to libvirt:
 File "/usr/local/lib/python2.7/dist-packages/libvirt.py", line 102, in openAuth
   if ret is None:raise libvirtError('virConnectOpenAuth() failed')


I can connect to libvirtd via virsh , so I think libvirtd is running.
# LANG=C /usr/local/bin/virsh -c qemu:///system
Welcome to virsh, the virtualization interactive terminal.

virsh # version
Compiled against library: libvir 0.9.9
Using library: libvir 0.9.9
Using API: QEMU 0.9.9
Running hypervisor: QEMU 1.0.0

virsh # quit


Let’s check the libvirt.log .. Auth fail from a user which UID is 1000.
UID 1000 is an account which I always use when logging on Mint.
# tail -f /usr/local/var/log/libvirt/libvirtd.log
error : remoteDispatchAuthPolkit:2521 : PolicyKit がアクション org.libvirt.unix.manage を PID 18318, UID 1000 から拒否しま した: 終了ステータス 127
error : remoteDispatchAuthPolkit:2540 : 認 証に失敗しました: 認証に失敗しました

# egrep 1000 /etc/group
hattori:x:1000:


confirm whether or not UID 1000 can connect to libvirt.
nnn , authentication failed when connecting to libvirt with UID 1000.
# /usr/local/bin/virsh -c qemu+ssh://hattori@127.0.0.1/system
hattori@127.0.0.1's password:
error: 認証に失敗しました: 認証に失敗しました
error: failed to connect to the hypervisor


how about root user ? .. can connect to libvirt with root user.
It might be permission problems..
# /usr/local/bin/virsh -c qemu+ssh://root@127.0.0.1/system
root@127.0.0.1's password:
Welcome to virsh, the virtualization interactive terminal.
virsh # quit


run libvird with debug mode and start virt-manager to locate the problem.
# LIBVIRT_DEBUG=1 /usr/local/sbin/libvirtd > libvirt.logs 2>&1
# /usr/local/bin/virt-manager


debug logs.
Error checking for authorization org.libvirt.unix.manage: GDBus.Error:org.freede
sktop.PolicyKit1.Error.Failed: Action org.libvirt.unix.manage is not registered
20844: error : remoteDispatchAuthPolkit:2521 : PolicyKit がアクション org.libvirt.unix.manage を PID 20894, UID 1000 から拒否しま
した: 終了ステータス 127
20844: debug : remoteDispatchAuthPolkit:2554 : RPC_SERVER_CLIENT_AUTH_DENY: client=0x7fa510000ae0 auth=2 identity=pid:20894,uid:1000
20844: error : remoteDispatchAuthPolkit:2540 : 認
証に失敗しました: 認証に失敗しました


PolicyKit ?
Let’s google it.

It seems that Policy kit is an ACL for user authentication  
http://libvirt.org/auth.html

Allow UID 1000 named hattori to connect to libvirtd
# cat /etc/polkit-1/localauthority/50-local.d/50-org.libvirt.access.pkla
[libvirt Management Access]
Identity=unix-user:hattori
Action=org.libvirt.unix.manage
ResultAny=yes
ResultInactive=yes
ResultActive=yes


try again ,,, same error
Error checking for authorization org.libvirt.unix.manage: GDBus.Error:org.freede
sktop.PolicyKit1.Error.Failed: Action org.libvirt.unix.manage is not registered
error : remoteDispatchAuthPolkit:2521 : PolicyKit がアクション org.libvirt.unix.manage を PID 20894, UID 1000 から拒否しま
した: 終了ステータス 127
20844: debug : remoteDispatchAuthPolkit:2554 : RPC_SERVER_CLIENT_AUTH_DENY: client=0x7fa510000ae0 auth=2 identity=pid:20894,uid:1000
20844: error : remoteDispatchAuthPolkit:2540 : 認
証に失敗しました: 認証に失敗しました


oh ,, I also need to edit libvirtd.conf.
# groupadd libvirt
# usermod -G libvirt -a hattori

# egrep unix_sock /usr/local/etc/libvirt/libvirtd.conf | grep -v ^#
unix_sock_group = "libvirt"
unix_sock_ro_perms = "0777"
unix_sock_rw_perms = "0770"


nn still error
Error checking for authorization org.libvirt.unix.manage: GDBus.Error:org.freede
sktop.PolicyKit1.Error.Failed: Action org.libvirt.unix.manage is not registered

error : remoteDispatchAuthPolkit:2521 : PolicyKit がアクション org.libvirt.unix.manage を PID 23628, UID 1000 から拒否しま
した: 終了ステータス 127


nnn , okey ,, disable Policykit auth.
# egrep '(unix_sock|none)' /usr/local/etc/libvirt/libvirtd.conf | grep
-v ^#
unix_sock_group = "libvirt"
unix_sock_ro_perms = "0777"
unix_sock_rw_perms = "0770"
auth_unix_ro = "none"
auth_unix_rw = "none"


try again
# LIBVIRT_DEBUG=1 /usr/local/sbin/libvirtd -d > libvirt.logs 2>&1


I can connect to libvirt with UID 1000.
# LANG=C /usr/local/bin/virsh -c qemu+ssh://hattori@127.0.0.1/system
hattori@127.0.0.1's password:
Welcome to virsh, the virtualization interactive terminal.

virsh # version
Compiled against library: libvir 0.9.9
Using library: libvir 0.9.9
Using API: QEMU 0.9.9
Running hypervisor: QEMU 1.0.0

virsh # quit


try to connect libvirtd via virt-manager. another error
$ /usr/local/bin/virt-manager –debug
   if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirtError: Failed to connect socket to '/usr/local/var/run/libvirt/libvirt-sock': Permission denied

# egrep '(unix_sock|none)' /usr/local/etc/libvirt/libvirtd.conf | grep
-v ^#
unix_sock_group = "libvirt"
unix_sock_ro_perms = "0777"
unix_sock_rw_perms = "0777"
unix_sock_dir = "/usr/local/var/run/libvirt"
auth_unix_ro = "none"
auth_unix_rw = "none"


can connect to libvirtd both virsh and virt-manager with UID 1000.

[ fly a VM on KVM 1.0 ]

make a symbolic link.
virsh or virt-manager seems to check /usr/bin/kvm or /usr/local/bin/kvm when starting a VM.
# ln -s /usr/local/bin/qemu-system-x86_64 /usr/bin/kvm


install a VM via virsh or virt-manager.

a VM , CentOS6 32bit , is running on KVM 1.0.
virsh # list –all
Id Name                 State
----------------------------------
 1 centos6-32-vm1       running

virsh # qemu-monitor-command centos6-32-vm1 'info version
1.0.0 (qemu-kvm-1.0)