doomedraven / Tools

Combination of different utilities, have fun!
MIT License
202 stars 96 forks source link

libjemalloc.so.2 not found after jemalloc installation #78

Closed nikAizuddin closed 3 years ago

nikAizuddin commented 3 years ago

Prerequisites

Expected Behavior

Command virt-install should success.

Current Behavior

Command virt-install failed and complained about libjemalloc.so.2 not found.

Steps to Reproduce

  1. Use a fresh-installed Ubuntu 20.04.
  2. Install QEMU/KVM and Libvirt using the following command: $ sudo /opt/doomedraven-tools/Virtualization/kvm-qemu.sh all.
  3. Reboot.
  4. Try install a Windows VM for example:
    $ sudo virt-install --name cuckoo1 --memory 2048 --vcpus 1 --machine pc --os-variant win7 --network="default",model=e1000 --cdrom /home/vagrant/Windows.iso --disk path=/var/lib/libvirt/images/cuckoo1.qcow2,size=32,bus=sata,format=qcow2 --graphics vnc,listen=0.0.0.0,port=5900 --noautoconsole

Context

Question Answer
OS version Ubuntu 20.04
doomedraven/Tools current commit 408fd7b2c3eac447b6536e7c7aa3e7b59373288e

Failure Logs

vagrant@capev2-box:~$ sudo virt-install --name cuckoo1 --memory 2048 --vcpus 1 --machine pc --os-variant win7 --network="default",model=e1000 --cdrom /home/vagrant/Windows.iso --disk path=/var/lib/libvirt/images/cuckoo1.qcow2,size=32,bus=sata,format=qcow2 --graphics vnc,listen=0.0.0.0,port=5900 --noautoconsole

Starting install...
Allocating 'cuckoo1.qcow2'                                                         |  32 GB  00:00:00     
Removing disk 'cuckoo1.qcow2'                                                      |    0 B  00:00:00     
ERROR    internal error: process exited while connecting to monitor: /usr/bin/qemu-system-x86_64: error while loading shared libraries: libjemalloc.so.2: cannot open shared object file: No such file or directory
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect qemu:///system start cuckoo1
otherwise, please restart your installation.
nikAizuddin commented 3 years ago

Here ldd /usr/bin/qemu-system-x86_64 output:

vagrant@capev2-box:~$ ldd /usr/bin/qemu-system-x86_64
        linux-vdso.so.1 (0x00007ffca5623000)
        libxenctrl.so.4.11 => /lib/x86_64-linux-gnu/libxenctrl.so.4.11 (0x00007fa0c6279000)
        libxenstore.so.3.0 => /lib/x86_64-linux-gnu/libxenstore.so.3.0 (0x00007fa0c626c000)
        libxenforeignmemory.so.1 => /lib/x86_64-linux-gnu/libxenforeignmemory.so.1 (0x00007fa0c6267000)
        libxengnttab.so.1 => /lib/x86_64-linux-gnu/libxengnttab.so.1 (0x00007fa0c6262000)
        libxenevtchn.so.1 => /lib/x86_64-linux-gnu/libxenevtchn.so.1 (0x00007fa0c625d000)
        libxendevicemodel.so.1 => /lib/x86_64-linux-gnu/libxendevicemodel.so.1 (0x00007fa0c6256000)
        libxentoolcore.so.1 => /lib/x86_64-linux-gnu/libxentoolcore.so.1 (0x00007fa0c624f000)
        libspice-server.so.1 => /lib/x86_64-linux-gnu/libspice-server.so.1 (0x00007fa0c611e000)
        liblzo2.so.2 => /lib/x86_64-linux-gnu/liblzo2.so.2 (0x00007fa0c60f9000)
        libpixman-1.so.0 => /lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007fa0c6052000)
        libsnappy.so.1 => /lib/x86_64-linux-gnu/libsnappy.so.1 (0x00007fa0c6047000)
        libgtk-3.so.0 => /lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007fa0c5896000)
        libgdk-3.so.0 => /lib/x86_64-linux-gnu/libgdk-3.so.0 (0x00007fa0c578f000)
        libcairo.so.2 => /lib/x86_64-linux-gnu/libcairo.so.2 (0x00007fa0c566c000)
        libgdk_pixbuf-2.0.so.0 => /lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007fa0c5644000)
        libgio-2.0.so.0 => /lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007fa0c5463000)
        libgobject-2.0.so.0 => /lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007fa0c5403000)
        libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fa0c52da000)
        libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007fa0c519b000)
        libnuma.so.1 => /lib/x86_64-linux-gnu/libnuma.so.1 (0x00007fa0c518e000)
        libcacard.so.0 => /lib/x86_64-linux-gnu/libcacard.so.0 (0x00007fa0c5177000)
        libusbredirparser.so.1 => /lib/x86_64-linux-gnu/libusbredirparser.so.1 (0x00007fa0c516c000)
        libbrlapi.so.0.7 => /lib/x86_64-linux-gnu/libbrlapi.so.0.7 (0x00007fa0c515d000)
        libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007fa0c5125000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fa0c5107000)
        libusb-1.0.so.0 => /lib/x86_64-linux-gnu/libusb-1.0.so.0 (0x00007fa0c50eb000)
        libjpeg.so.8 => /lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007fa0c5066000)
        libfdt.so.1 => /lib/x86_64-linux-gnu/libfdt.so.1 (0x00007fa0c505b000)
        libsasl2.so.2 => /lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007fa0c503e000)
        libncursesw.so.6 => /lib/x86_64-linux-gnu/libncursesw.so.6 (0x00007fa0c5004000)
        libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007fa0c4fd2000)
        libseccomp.so.2 => /lib/x86_64-linux-gnu/libseccomp.so.2 (0x00007fa0c4f7f000)
        libgnutls.so.30 => /lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007fa0c4da9000)
        libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fa0c4da4000)
        libjemalloc.so.2 => /usr/local/lib/libjemalloc.so.2 (0x00007fa0c4afb000)
        libaio.so.1 => /lib/x86_64-linux-gnu/libaio.so.1 (0x00007fa0c4af6000)
        librbd.so.1 => /lib/x86_64-linux-gnu/librbd.so.1 (0x00007fa0c4586000)
        librados.so.2 => /lib/x86_64-linux-gnu/librados.so.2 (0x00007fa0c4443000)
        libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007fa0c4430000)
        libiscsi.so.7 => /lib/x86_64-linux-gnu/libiscsi.so.7 (0x00007fa0c4403000)
        libcurl-gnutls.so.4 => /lib/x86_64-linux-gnu/libcurl-gnutls.so.4 (0x00007fa0c4374000)
        libnettle.so.7 => /lib/x86_64-linux-gnu/libnettle.so.7 (0x00007fa0c433a000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa0c41e9000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa0c41ce000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa0c41ab000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa0c3fb9000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fa0c71ee000)
        libxentoollog.so.1 => /lib/x86_64-linux-gnu/libxentoollog.so.1 (0x00007fa0c3fb4000)
        libxencall.so.1 => /lib/x86_64-linux-gnu/libxencall.so.1 (0x00007fa0c3faf000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa0c3fa7000)
        libopus.so.0 => /lib/x86_64-linux-gnu/libopus.so.0 (0x00007fa0c3f48000)
        liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x00007fa0c3f27000)
        libgstapp-1.0.so.0 => /lib/x86_64-linux-gnu/libgstapp-1.0.so.0 (0x00007fa0c3f15000)
        libgstreamer-1.0.so.0 => /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0 (0x00007fa0c3dce000)
        libssl.so.1.1 => /lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007fa0c3d39000)
        libcrypto.so.1.1 => /lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007fa0c3a63000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fa0c3a58000)
        liborc-0.4.so.0 => /lib/x86_64-linux-gnu/liborc-0.4.so.0 (0x00007fa0c39d5000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fa0c37f4000)
        libgmodule-2.0.so.0 => /lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007fa0c37ec000)
        libpangocairo-1.0.so.0 => /lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007fa0c37da000)
        libXi.so.6 => /lib/x86_64-linux-gnu/libXi.so.6 (0x00007fa0c37c8000)
        libXfixes.so.3 => /lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007fa0c37c0000)
        libcairo-gobject.so.2 => /lib/x86_64-linux-gnu/libcairo-gobject.so.2 (0x00007fa0c37b4000)
        libatk-1.0.so.0 => /lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007fa0c378a000)
        libatk-bridge-2.0.so.0 => /lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0 (0x00007fa0c3751000)
        libepoxy.so.0 => /lib/x86_64-linux-gnu/libepoxy.so.0 (0x00007fa0c361e000)
        libfribidi.so.0 => /lib/x86_64-linux-gnu/libfribidi.so.0 (0x00007fa0c3601000)
        libpangoft2-1.0.so.0 => /lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007fa0c35e8000)
        libpango-1.0.so.0 => /lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007fa0c3599000)
        libharfbuzz.so.0 => /lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007fa0c3494000)
        libfontconfig.so.1 => /lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007fa0c344b000)
        libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fa0c338c000)
        libXinerama.so.1 => /lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007fa0c3387000)
        libXrandr.so.2 => /lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007fa0c337a000)
        libXcursor.so.1 => /lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007fa0c336d000)
        libXcomposite.so.1 => /lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007fa0c3366000)
        libXdamage.so.1 => /lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007fa0c3361000)
        libxkbcommon.so.0 => /lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007fa0c331f000)
        libwayland-cursor.so.0 => /lib/x86_64-linux-gnu/libwayland-cursor.so.0 (0x00007fa0c3314000)
        libwayland-egl.so.1 => /lib/x86_64-linux-gnu/libwayland-egl.so.1 (0x00007fa0c330f000)
        libwayland-client.so.0 => /lib/x86_64-linux-gnu/libwayland-client.so.0 (0x00007fa0c32fe000)
        libXext.so.6 => /lib/x86_64-linux-gnu/libXext.so.6 (0x00007fa0c32e9000)
        libxcb-shm.so.0 => /lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007fa0c32e2000)
        libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fa0c32b8000)
        libxcb-render.so.0 => /lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007fa0c32a9000)
        libXrender.so.1 => /lib/x86_64-linux-gnu/libXrender.so.1 (0x00007fa0c309f000)
        libmount.so.1 => /lib/x86_64-linux-gnu/libmount.so.1 (0x00007fa0c303f000)
        libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007fa0c3012000)
        libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fa0c2ff6000)
        libffi.so.7 => /lib/x86_64-linux-gnu/libffi.so.7 (0x00007fa0c2fea000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fa0c2f77000)
        libnss3.so => /lib/x86_64-linux-gnu/libnss3.so (0x00007fa0c2e28000)
        libnspr4.so => /lib/x86_64-linux-gnu/libnspr4.so (0x00007fa0c2de6000)
        libpcsclite.so.1 => /lib/x86_64-linux-gnu/libpcsclite.so.1 (0x00007fa0c2dd9000)
        libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007fa0c2dac000)
        libp11-kit.so.0 => /lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007fa0c2c76000)
        libidn2.so.0 => /lib/x86_64-linux-gnu/libidn2.so.0 (0x00007fa0c2c55000)
        libunistring.so.2 => /lib/x86_64-linux-gnu/libunistring.so.2 (0x00007fa0c2ad3000)
        libtasn1.so.6 => /lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007fa0c2abb000)
        libhogweed.so.5 => /lib/x86_64-linux-gnu/libhogweed.so.5 (0x00007fa0c2a83000)
        libgmp.so.10 => /lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fa0c29ff000)
        libceph-common.so.2 => /usr/lib/x86_64-linux-gnu/ceph/libceph-common.so.2 (0x00007fa0b9d74000)
        libibverbs.so.1 => /lib/x86_64-linux-gnu/libibverbs.so.1 (0x00007fa0b9d55000)
        librdmacm.so.1 => /lib/x86_64-linux-gnu/librdmacm.so.1 (0x00007fa0b9d34000)
        libnghttp2.so.14 => /lib/x86_64-linux-gnu/libnghttp2.so.14 (0x00007fa0b9d0b000)
        librtmp.so.1 => /lib/x86_64-linux-gnu/librtmp.so.1 (0x00007fa0b9ceb000)
        libssh.so.4 => /lib/x86_64-linux-gnu/libssh.so.4 (0x00007fa0b9c7d000)
        libpsl.so.5 => /lib/x86_64-linux-gnu/libpsl.so.5 (0x00007fa0b9c6a000)
        libgssapi_krb5.so.2 => /lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007fa0b9c1d000)
        libldap_r-2.4.so.2 => /lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007fa0b9bc5000)
        liblber-2.4.so.2 => /lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007fa0b9bb4000)
        libbrotlidec.so.1 => /lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007fa0b9ba6000)
        libgstbase-1.0.so.0 => /lib/x86_64-linux-gnu/libgstbase-1.0.so.0 (0x00007fa0b9b28000)
        libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fa0b9ad5000)
        libatspi.so.0 => /lib/x86_64-linux-gnu/libatspi.so.0 (0x00007fa0b9a9e000)
        libthai.so.0 => /lib/x86_64-linux-gnu/libthai.so.0 (0x00007fa0b9a93000)
        libgraphite2.so.3 => /lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007fa0b9a66000)
        libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007fa0b9a38000)
        libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007fa0b9a2d000)
        libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007fa0b9a27000)
        libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fa0b9a1f000)
        libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007fa0b99c8000)
        libpcre2-8.so.0 => /lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007fa0b9938000)
        libnssutil3.so => /lib/x86_64-linux-gnu/libnssutil3.so (0x00007fa0b9903000)
        libplc4.so => /lib/x86_64-linux-gnu/libplc4.so (0x00007fa0b98fc000)
        libplds4.so => /lib/x86_64-linux-gnu/libplds4.so (0x00007fa0b98f7000)
        libboost_thread.so.1.71.0 => /lib/x86_64-linux-gnu/libboost_thread.so.1.71.0 (0x00007fa0b98cb000)
        libboost_iostreams.so.1.71.0 => /lib/x86_64-linux-gnu/libboost_iostreams.so.1.71.0 (0x00007fa0b98a4000)
        libnl-route-3.so.200 => /lib/x86_64-linux-gnu/libnl-route-3.so.200 (0x00007fa0b982a000)
        libnl-3.so.200 => /lib/x86_64-linux-gnu/libnl-3.so.200 (0x00007fa0b9807000)
        libkrb5.so.3 => /lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007fa0b972a000)
        libk5crypto.so.3 => /lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007fa0b96f9000)
        libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007fa0b96f2000)
        libkrb5support.so.0 => /lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007fa0b96e1000)
        libgssapi.so.3 => /lib/x86_64-linux-gnu/libgssapi.so.3 (0x00007fa0b969c000)
        libbrotlicommon.so.1 => /lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007fa0b9679000)
        libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007fa0b95cc000)
        libdatrie.so.1 => /lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007fa0b95c2000)
        libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fa0b95a6000)
        liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fa0b957d000)
        libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007fa0b94d4000)
        libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007fa0b94cd000)
        libheimntlm.so.0 => /lib/x86_64-linux-gnu/libheimntlm.so.0 (0x00007fa0b94c1000)
        libkrb5.so.26 => /lib/x86_64-linux-gnu/libkrb5.so.26 (0x00007fa0b942c000)
        libasn1.so.8 => /lib/x86_64-linux-gnu/libasn1.so.8 (0x00007fa0b9385000)
        libhcrypto.so.4 => /lib/x86_64-linux-gnu/libhcrypto.so.4 (0x00007fa0b934d000)
        libroken.so.18 => /lib/x86_64-linux-gnu/libroken.so.18 (0x00007fa0b9334000)
        libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007fa0b9216000)
        libwind.so.0 => /lib/x86_64-linux-gnu/libwind.so.0 (0x00007fa0b91ea000)
        libheimbase.so.1 => /lib/x86_64-linux-gnu/libheimbase.so.1 (0x00007fa0b91d8000)
        libhx509.so.5 => /lib/x86_64-linux-gnu/libhx509.so.5 (0x00007fa0b918a000)
        libsqlite3.so.0 => /lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007fa0b9061000)
        libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007fa0b9026000)
        libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007fa0b9001000)

Also file /usr/local/lib/libjemalloc.so.2 seems okay:

vagrant@capev2-box:~$ file /usr/local/lib/libjemalloc.so.2
/usr/local/lib/libjemalloc.so.2: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=bc335c8b9585a6ccd7bc0e95ed72616b9718a474, stripped
nikAizuddin commented 3 years ago

Looks like I still have to apt install libjemalloc-dev after jemalloc installation via kvm-qemu.sh:

$ sudo apt install libjemalloc-dev

Now I can successfully run virt-install.

doomedraven commented 3 years ago

hello thank you, hm you second person that this happens, i was trying to reproduce it after first issue but i wasn't able, anyway adding this -dev lib to avoid any problem, thank oyu

nikAizuddin commented 3 years ago

hello thank you, hm you second person that this happens

ahh, sorry wasn't notice existing issue https://github.com/doomedraven/Tools/issues/76.

I can confirm commit 761e0817c78ab8e74fc7cb5b1102b3e7bece5fd8 have solved libjemalloc.so.2 problem. Thank you.