Hello, I am currently working on Redhat 6 - Kernel 2.6.32-358.el6.x86_64. It has by default libvirt 0.10.2. I wanted version 1.2.7. So I downloaded this and libvirt-1.2.7.tar.gz and I followed the following steps: 1. ./configure (with its default settings) 2. make 3. make install Currently, the installation is in: /usr/local and the source tree is in /export/home/libvirt. I stopped the previously installed daemon so that the new one takes effect. I launched the daemon from /export/home/libvirt/daemon/libvirtd -d. However every time I launch the C++ code, this message appears: libvir: XML-RPC error : Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory Failed to open connection to qemu:///system My questions are: 1. How can I launch the daemon from the source tree? It does not behave as it should when it is launched from /etc/init.d 2. How can any application e.g. virt-manager look at the new paths of the newly installed libvirt? 3. How can I get libvirt to work from the source tree as if it was originally installed in Redhat? Thanks Marina
Hello, Did You try to run autogen.sh with "--system" flag before doing "make"? As it is described in http://libvirt.org/compiling.html - maybe that would help You. -- Best regards / Pozdrawiam Sławek Kapłoński slawek@kaplonski.pl On Sun, 23 Oct 2016, Marina Danial wrote:> Hello, > > I am currently working on Redhat 6 - Kernel 2.6.32-358.el6.x86_64. It has > by default libvirt 0.10.2. > > I wanted version 1.2.7. So I downloaded this and libvirt-1.2.7.tar.gz and I > followed the following steps: > > 1. ./configure (with its default settings) > 2. make > 3. make install > > > Currently, the installation is in: /usr/local > > and the source tree is in /export/home/libvirt. > > > I stopped the previously installed daemon so that the new one takes effect. > > I launched the daemon from /export/home/libvirt/daemon/libvirtd -d. > > However every time I launch the C++ code, this message appears: > > libvir: XML-RPC error : Failed to connect socket to > '/var/run/libvirt/libvirt-sock': No such file or directory > Failed to open connection to qemu:///system > > My questions are: > > 1. How can I launch the daemon from the source tree? It does not behave as > it should when it is launched from /etc/init.d > 2. How can any application e.g. virt-manager look at the new paths of the > newly installed libvirt? > 3. How can I get libvirt to work from the source tree as if it was > originally installed in Redhat? > > > Thanks > Marina> _______________________________________________ > libvirt-users mailing list > libvirt-users@redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-users
Martin Kletzander
2016-Oct-24 06:47 UTC
Re: [libvirt-users] Failed to launch libvirt 1.2.7
On Sun, Oct 23, 2016 at 12:09:51PM +0200, Sławek Kapłoński wrote:>Hello, > >Did You try to run autogen.sh with "--system" flag before doing "make"? >As it is described in http://libvirt.org/compiling.html - maybe that >would help You. >Since it was compiled from the distributed package, I would say you want to run ./configure with something like '--prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib' (which is what --system gets expanded to). But my guess here is that the replacement of the installed daemon (which this would do) is not the option here. So in that case what Marina wants (I think) is two things: a) Make sure the client code uses the newer library (the one in /usr/local/, not the default one in the system), just in case you need some newer API that's not supported in the older version. b) Connect to the daemon that's listening in the /usr/local/ directory instead of the /var/run/ one. That should be done automatically when the client application will use the library compiled with the '/usr/local/' prefix. If you don't want to use that (or don't need it and you don't want to set up the shared object dependency loading), you can use e.g.: 'qemu:///system?socket=/usr/local/var/run/libvirt/libvirt-sock' as the connect URI. Martin>-- >Best regards / Pozdrawiam >Sławek Kapłoński >slawek@kaplonski.pl > >On Sun, 23 Oct 2016, Marina Danial wrote: > >> Hello, >> >> I am currently working on Redhat 6 - Kernel 2.6.32-358.el6.x86_64. It has >> by default libvirt 0.10.2. >> >> I wanted version 1.2.7. So I downloaded this and libvirt-1.2.7.tar.gz and I >> followed the following steps: >> >> 1. ./configure (with its default settings) >> 2. make >> 3. make install >> >> >> Currently, the installation is in: /usr/local >> >> and the source tree is in /export/home/libvirt. >> >> >> I stopped the previously installed daemon so that the new one takes effect. >> >> I launched the daemon from /export/home/libvirt/daemon/libvirtd -d. >> >> However every time I launch the C++ code, this message appears: >> >> libvir: XML-RPC error : Failed to connect socket to >> '/var/run/libvirt/libvirt-sock': No such file or directory >> Failed to open connection to qemu:///system >> >> My questions are: >> >> 1. How can I launch the daemon from the source tree? It does not behave as >> it should when it is launched from /etc/init.d >> 2. How can any application e.g. virt-manager look at the new paths of the >> newly installed libvirt? >> 3. How can I get libvirt to work from the source tree as if it was >> originally installed in Redhat? >> >> >> Thanks >> Marina > >> _______________________________________________ >> libvirt-users mailing list >> libvirt-users@redhat.com >> https://www.redhat.com/mailman/listinfo/libvirt-users >>_______________________________________________ >libvirt-users mailing list >libvirt-users@redhat.com >https://www.redhat.com/mailman/listinfo/libvirt-users
On 23.10.2016 11:48, Marina Danial wrote:> Hello, > > I am currently working on Redhat 6 - Kernel 2.6.32-358.el6.x86_64. It has > by default libvirt 0.10.2. > > I wanted version 1.2.7. So I downloaded this and libvirt-1.2.7.tar.gz and I > followed the following steps: > > 1. ./configure (with its default settings) > 2. make > 3. make install > > > Currently, the installation is in: /usr/local > > and the source tree is in /export/home/libvirt. > > > I stopped the previously installed daemon so that the new one takes effect. > > I launched the daemon from /export/home/libvirt/daemon/libvirtd -d. > > However every time I launch the C++ code, this message appears: > > libvir: XML-RPC error : Failed to connect socket to > '/var/run/libvirt/libvirt-sock': No such file or directory > Failed to open connection to qemu:///systemLD_PRELOAD="/usr/local/usr/lib64/" ./myApp or whatever the directory that contains your libvirt.so is. If you are tired of this impractical way of spawning applications, use what others suggested. Michal