Skippy VonDrake
2013-Jan-16 21:12 UTC
[Libguestfs] libguestfs-test-tool error, libcap.so - no such file
Did install from source of libguestfs-1.20.1 on Ubuntu-12.10. And libguestfs-test-tool complains about not finding libcap.so.2 uptime: 2.26 1.00 guestfsd: error while loading shared libraries: libcap.so.2: cannot open shared object file: No such file or directory [ 2.277795] Unregister pv shared memory for cpu 0 [ 2.278324] kvm: exiting hardware virtualization [ 2.278763] sd 2:0:1:0: [sdb] Synchronizing SCSI cache [ 2.284494] sd 2:0:0:0: [sda] Synchronizing SCSI cache [ 4.224797] Disabling non-boot CPUs ... [ 4.225182] Restarting system. [ 4.225467] machine restart Full output at: http://pastebin.com/csndiF2A $ sudo find / -name 'libcap.so*' | xargs ls -lh /lib/i386-linux-gnu/libcap.so.2 -> libcap.so.2.22 /lib/i386-linux-gnu/libcap.so.2.22 /lib/x86_64-linux-gnu/libcap.so -> libcap.so.2 /lib/x86_64-linux-gnu/libcap.so.2 -> libcap.so.2.22 /lib/x86_64-linux-gnu/libcap.so.2.22 Rich, I know that you've stated in the past that you don't do 'install' and refer to the run scripts and the README file in response to problems installing libguestfs on Ubuntu. Should an install of libguestfs be considered as a "do at your own risk" endeavor? Putting it in the quasi-support realm? And is the appliance trying to find libcap.so on the host or within the appliance when it fails? Skippy
Richard W.M. Jones
2013-Jan-17 10:03 UTC
[Libguestfs] libguestfs-test-tool error, libcap.so - no such file
On Wed, Jan 16, 2013 at 04:12:21PM -0500, Skippy VonDrake wrote:> Did install from source of libguestfs-1.20.1 on Ubuntu-12.10. > And libguestfs-test-tool complains about not finding libcap.so.2 > > uptime: 2.26 1.00 > guestfsd: error while loading shared libraries: libcap.so.2: cannot > open shared object file: No such file or directory > [ 2.277795] Unregister pv shared memory for cpu 0 > [ 2.278324] kvm: exiting hardware virtualization > [ 2.278763] sd 2:0:1:0: [sdb] Synchronizing SCSI cache > [ 2.284494] sd 2:0:0:0: [sda] Synchronizing SCSI cache > [ 4.224797] Disabling non-boot CPUs ... > [ 4.225182] Restarting system. > [ 4.225467] machine restart > > Full output at: http://pastebin.com/csndiF2A > > $ sudo find / -name 'libcap.so*' | xargs ls -lh > /lib/i386-linux-gnu/libcap.so.2 -> libcap.so.2.22 > /lib/i386-linux-gnu/libcap.so.2.22 > /lib/x86_64-linux-gnu/libcap.so -> libcap.so.2 > /lib/x86_64-linux-gnu/libcap.so.2 -> libcap.so.2.22 > /lib/x86_64-linux-gnu/libcap.so.2.22 > > Rich, I know that you've stated in the past that you don't do 'install' and > refer to the run scripts and the README file in response to problems > installing libguestfs on Ubuntu. > > Should an install of libguestfs be considered as a "do at your own > risk" endeavor? > Putting it in the quasi-support realm?It should work, but it's not necessary, and it may have bad effects. It will pollute your filesystem with files which are not managed by dpkg (making them effectively impossible to remove). It will likely conflict in strange ways with the real libguestfs dpkg. The easier way is just to use the ./run script in the libguestfs directory, eg: ./run ./fish/guestfish [etc] Note that 'make quickcheck', 'make check' etc implicitly uses the ./run script.> And is the appliance trying to find libcap.so on the host or within > the appliance when it fails?The problem above is that libcap.so.2 isn't being copied into the appliance. There could be several reasons for this: (1) Most likely, what is installed on your host doesn't match what is listed in /etc/apt/sources.list; eg. libcap might have recently had an soname bump in Ubuntu and you haven't yet installed the new version on the host (but febootstrap picked up the new version for the appliance). Just doing an 'apt-get dist-upgrade' should fix it. (2) You're mixing the appliance from another installed libguestfs with the appliance from the libguestfs you built locally. This doesn't appear to be the case, from the full output you gave. (3) Did ./configure pick up that libcap is installed? Did it link guestfsd with -lcap? Did you then uninstall libcap on the host? Did febootstrap download libcap during the build? (4) There's some problem with the dpkg metadata. (5) There's some bug in febootstrap or the dpkg/apt utilities that it depends on. #4 and #5 can be diagnosed by carefully looking at whatever is being generated in '/usr/local/lib/guestfs/supermin.d/hostfiles', while at the same time reading this: http://libguestfs.org/febootstrap.8.html#supermin_appliances You can also avoid building the appliance at all by using the fixed appliance: http://libguestfs.org/download/binaries/appliance/ Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Hilko Bengen
2013-Jan-17 10:17 UTC
[Libguestfs] libguestfs-test-tool error, libcap.so - no such file
* Skippy VonDrake:> Did install from source of libguestfs-1.20.1 on Ubuntu-12.10. > And libguestfs-test-tool complains about not finding libcap.so.2I had similar problems while preparing 1.20 on Debian/unstable, but I fixed this for the package that I uploaded. (It's still stuck in the NEW queue: http://ftp-master.debian.org/new/libguestfs_1:1.20.1-2.html) Somehow I forgot to send the necessary patches to the list. Will do tonight. Cheers, -Hilko
Richard W.M. Jones
2013-Jan-18 17:19 UTC
Re: [Libguestfs] libguestfs-test-tool error, libcap.so - no such file
On Fri, Jan 18, 2013 at 12:02:35PM -0500, Skippy VonDrake wrote:> > The febootstrap output indicates that libcap2 has not been included in > > the appliance, which is ... a bug! > > > > Try this patch: > > > > https://github.com/libguestfs/libguestfs/commit/24c4178749817639ecf9ad61f7de2b0f90f6ba3b > > > > I guess that on Fedora libcap must be pulled in as an implicit dependency. > > The patch worked to complete the test of 'quickcheck' with "TEST FINISHED OK". > Thank you! > > The 'make check' results have 1 failed test but it looks like that's > from not having lvm2 configured. > > make quickcheck output: http://pastebin.com/qkjjAz6C > make check output: http://pastebin.com/FRmLaeE3 > > I still don't understand why after installing it on the system the > libraries aren't linked up properly. > > $ guestfish --version > guestfish: error while loading shared libraries: libguestfs.so.0: > cannot open shared object file: No such file or directoryIs /usr/local/lib in the dynamic linker path? You might need to add it to '/etc/ld.so.conf'.> $ libguestfs-test-tool > libguestfs-test-tool: error while loading shared libraries: > libguestfs.so.0: cannot open shared object file: No such file or > directory > > $ ldd `which libguestfs-test-tool` > linux-vdso.so.1 => (0x00007fff325ff000) > libguestfs.so.0 => not found > libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f12522a0000) > /lib64/ld-linux-x86-64.so.2 (0x00007f125267e000) > > > $ sudo find / -name 'libguestfs.so*' | xargs ls -l > /usr/local/lib/libguestfs.so -> libguestfs.so.0.391.0 > /usr/local/lib/libguestfs.so.0 -> libguestfs.so.0.391.0 > /usr/local/lib/libguestfs.so.0.391.0 > > For now I'll stick in symbolic links to "patch" the system. > And look at your suggestions regarding a static appliance.Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Richard W.M. Jones
2013-Jan-18 17:23 UTC
Re: [Libguestfs] libguestfs-test-tool error, libcap.so - no such file
On Fri, Jan 18, 2013 at 12:02:35PM -0500, Skippy VonDrake wrote:> The 'make check' results have 1 failed test but it looks like that's > from not having lvm2 configured. > > make check output: http://pastebin.com/FRmLaeE3Also I have fixed this so lvm2 is no longer required for this test. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
Hilko Bengen
2013-Jan-21 09:25 UTC
Re: [Libguestfs] Fwd: libguestfs-test-tool error, libcap.so - no such file
* Skippy VonDrake:>>> I still don't understand why after installing it on the system the >>> libraries aren't linked up properly. >>> >>> $ guestfish --version >>> guestfish: error while loading shared libraries: libguestfs.so.0: >>> cannot open shared object file: No such file or directory >> >> Is /usr/local/lib in the dynamic linker path? You might need >> to add it to '/etc/ld.so.conf'. > > Hilko, > Do you ever see the 'libguestfs.so.0' error?No, but then I haven't installed libguestfs to /usr/local/. On my Debian systems, /etc/ld.so.conf.d/libc.conf contains a single line, /usr/local/lib -- this means that the dynamic linker will look there (among other places) for shared libraries. If the library is installed by hand, one still needs to run ldconfig (as root), though because it uses some sort of caching mechanism. The library packages built for Debian make sure that ldconfig is run automatically on installation. Cheers, -Hilko