1. When making a thread, please tag your thread accordingly using the menu to the left of the textfield where you name your thread where applicable. Server Advertisements and Mod Releases should be contained to their respective subforums.

Tutorial How-to install/fix missing libraries for starbound_server (32/64bit)

Discussion in 'Public Servers & Server Help' started by Jansen, Dec 6, 2013.

Tutorial How-to install/fix missing libraries for starbound_server (32/64bit)

Discussion in 'Public Servers & Server Help' started by Jansen, Dec 6, 2013.

  1. Jansen

    Jansen Aquatic Astronaut

    Hello Starbounders!
    Important: This thread is about installing missing libraries. If you don't know how to install the server read this howto.

    If you use a recent distribution, try to install the missing libraries with your packet-manager first:

    Debian/Ubuntu
    Code:
     sudo apt-get install libssl1.0.0 libfreetype6 libogg0 libgcc1 libpng12-0 libvorbis0a libvorbisfile3
    Arch
    Code:
    pacman -S libpng12
    Fedora
    Code:
     I don't know yet. Please tell me
    OpenSuse
    Code:
     I don't know yet. Please tell me
    Gentoo
    Code:
     emerge libpng:1.2 freetype openssl 
    CentOS/Red Hat
    Code:
     You should read on
    If this does not help, read on!

    These information are condensed version of this thread, some PMs and this stackoverflow post.
    Disclaimer: I've no idea what I'm talking about. If anything goes wrong and your server ignites, I'm not responsible ;)

    You want to run starbound-server on your favorite distribution, but cannot because of some missing libraries? You cannot install them? Or your distribution is too old? There is a solution.

    Works for (reported): CentOS 6.5, Ubuntu 11.x

    The first package is a tar.gz file with the needed libraries. They are taken from my desktop system, a Kubuntu 13.10 installation. Save the file next to your linux64/starbound_server or linux 32/starbound_server executable and extract it. It will probably overwrite some already existing .so files.

    For 64bit:
    Code:
    # Change to your starbound-server directory
    $ cd /path/to/your/starbound/linux64 installation
    
    # Download the libraries for 64bit
    $ wget http://www.fabrik17.de/files/starbound-server-x64-libdeps.tar.gz
    
    # Extract the 64bit libraries
    $ tar xvfz starbound-server-x64-libdeps.tar.gz
    
    For 32bit:
    Code:
    # Change to your starbound-server directory
    $ cd /path/to/your/starbound/linux32 installation
    
    # Download the libraries for 32bit
    $ wget http://www.fabrik17.de/files/starbound-server-x32-libdeps.tar.gz
    
    # Extract the 32bit libraries
    $ tar xvfz starbound-server-x64-libdeps.tar.gz
    

    Ok, now you are using libraries which should work fine. Try and start the server with ./launch_starbound_server.sh. Does it work? Yes? You are lucky. If you get errors like
    Code:
    ./starbound_server: error while loading shared libraries: __vdso_time: invalid mode for dlopen(): Invalid argument
    or
    ./starbound_server: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./libgcc_s.so.1)
    
    you will have to do some more work.

    But why? What's wrong?

    There is a piece of software called "the loader". It loads the other .so files into the program's memory so that it can use their functions. The path to this loader is hardcoded in all (dynamically linked) binaries. The default path is /lib64/ld-linux-x86-64.so.2. The problem is, that your loader needs to be compatible with the libc.so.6 I've provided in my tar.gz archive, but it obviously isn't. So we have to change the hardcoded path in starbound_server to a path where a compatible loader is saved.

    I've created a patch with bsdiff for this. It changes the path from /lib64/ld-linux-x86-64.so.2 to /tmp/ld-linux-x86-64.so.2. The following commands should do the work. You need to install bspatch for this.

    Important: There is an easier solution, which does not depend on patching the server! See this post of arcanemagick!


    For 64bit:
    Code:
    # Change to your starbound-server directory
    $ cd /path/to/my/starbound/installation/linux64
    
    # Download the patch next to your starbound_server 64bit binary
    $ wget http://www.fabrik17.de/files/starbound-loader-64bit.bspatch
    
    # Apply the patch for 64bit
    $ bspatch starbound_server starbound_server_patched starbound-loader-64bit.bspatch
    
    # Make the new server executable
    $ chmod a+x starbound_server_patched
    
    # Rename the original one
    $ mv starbound_server starbound_server_org
    
    # Rename the patched server
    $ mv starbound_server_patched starbound_server
    
    # Copy the new loader from my tar.gz (the file in linux_loader-dont-know-if-you-need-this/) to /tmp/ and set the right permissions
    $ cp linux_loader-dont-know-if-you-need-this/ld-linux-x86-64.so.2 /tmp/
    $ chmod 755 /tmp/ld-linux-x86-64.so.2
    
    # Run the server
    $ ./launch_starbound_server.sh
    
    For 32bit:
    Code:
    # Change to your starbound-server directory
    $ cd /path/to/my/starbound/installation/linux32
    
    # Download the patch next to your starbound_server 32bit binary
    $ wget http://www.fabrik17.de/files/starbound-loader-32bit.bspatch
    
    # Apply the patch for 32bit
    $ bspatch starbound_server starbound_server_patched starbound-loader-32bit.bspatch
    
    # Make the new server executable
    $ chmod a+x starbound_server_patched
    
    # Rename the original one
    $ mv starbound_server starbound_server_org
    
    # Rename the patched server
    $ mv starbound_server_patched starbound_server
    
    # Copy the new loader from my tar.gz (the file in linux_loader-dont-know-if-you-need-this/) to /tmp/ and set the right permissions
    $ cp linux_loader-dont-know-if-you-need-this/ld-linux.so.2 /tmp/
    $ chmod 755 /tmp/ld-linux.so.2
    
    # Run the server
    $ ./launch_starbound_server.sh
    
    That's it. Your starbound_server should start.

    FAQ
    • Why does this have to be so difficult? :(
    I'm sure it will change during the beta. The starbound_server binary seems to be build against very recent libraries. Valve uses Ubuntu 12.04 as their reference regarding libraries. They also provide their own package of runtime libraries. Starbound could use them too.

    • I don't trust your libraries!:mad:
    You can get them on your own. Install a recent Debian or Ubuntu, run "ldd starbound_server". This will show you the needed libraries. Gather and copy them to your incompatible distribution.

    • I also don't trust your patch!:fireball:
    Oh you, again! You can do it on your own. Get a hexeditor, open starbound_server and go to byte 0x200. There you will see the hardcoded path to the loader. Your new path to the working loader cannot be longer than the already existing path. If you chose a shorter path, replace the remaining character with nullbytes.

    Remarks
    • You have to patch your server on every update.
    • The patch should work for all coming updates.
    • /tmp is normally wiped on a restart. If you restart your machine, copy it back there. Remember to set the right permissions.

    If you have any additions, a better workaround, or anything else, please let me know!
      Last edited: Jan 19, 2014
    • Syntax42

      Syntax42 Zero Gravity Genie

      SteamCMD makes installing the game on linux a breeze, and it helps with updating the game without having to transfer every file from scratch.

      For those having trouble with dependencies like libstdc++, consider using Ubuntu. It isn't that much different from CentOS or other distros and Ubuntu includes the needed libraries to work out of the box.
      • Halaster

        Halaster Space Spelunker

        I am running a fresh Ubuntu 12.10 install, and it did not include the needed libraries at all for the 64-bit server to run. The 32-bit version ran fine. The only thing at all I am using the server for is Starbound.
        I had to grab Jansen's libraries as well as his patch to get things working.
        • Jansen

          Jansen Aquatic Astronaut

          Often people have already working services on their systems and don't want to migrate them to a whole new installation.

          Hmm, i thought that Ubuntu 12.10 would work. Do you know which libs were missing?
          • Halaster

            Halaster Space Spelunker

            Vorbis specifically was missing. I manually grabbed a version of it and did a local build to try to address the issue, but even then it still could not find it. It was saying the file was missing, even though it was present exactly where it said it was not. Possibly others, but I did not move past Vorbis.

            Your libraries instantly addressed the problem.
            • Jansen

              Jansen Aquatic Astronaut

              Strange... Checked the corresponding Ubuntu package and found out that it should work.

              Nevertheless I've added the Debian/Ubuntu package names to my original post.
              It would be nice if someone could tell me the package names for the other distributions!
              • kamJnr

                kamJnr Space Hobo

                Hi,

                I have tried installing your patch but im stilling having a problem with glib (i think). I have glibc-2.12-1.132.el6.x86_64 installed, and not sure how to get to 2.17 without breaking stuff.

                Im on CentOS 6.5 64bit

                Code:
                ./starbound_server: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./libvorbisfile.so.3)
                ./starbound_server: /lib64/libm.so.6: version `GLIBC_2.15' not found (required by ./libvorbis.so.0)
                ./starbound_server: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./libvorbis.so.0)
                ./starbound_server: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./libogg.so.0)
                ./starbound_server: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./libssl.so.1.0.0)
                ./starbound_server: /lib64/libc.so.6: version `GLIBC_2.17' not found (required by ./libssl.so.1.0.0)
                ./starbound_server: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./libcrypto.so.1.0.0)
                ./starbound_server: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./libfreetype.so.6)
                ./starbound_server: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./libpng12.so.0)
                ./starbound_server: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./libz.so.1)
                ./starbound_server: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./libstdc++.so.6)
                ./starbound_server: /lib64/libc.so.6: version `GLIBC_2.17' not found (required by ./libstdc++.so.6)
                ./starbound_server: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./libgcc_s.so.1)
                
                • Jansen

                  Jansen Aquatic Astronaut

                  Hi, you have to put all libs from my tar.gz file next to the starbound_server.

                  Atm it looks like the server is using your systems libc.
                  • gummby8

                    gummby8 Seal Broken

                    CentOS Linux 6.5
                    getting the "kernel is too old" error :(
                    • Jansen

                      Jansen Aquatic Astronaut

                      Which kernel version do you use?
                      I'm running an up2date CentOS 6.5 with "2.6.32-431.el6.x86_64". It's working fine.
                      • wondergod

                        wondergod Space Hobo

                        Thank you for this. I changed it a bit for my server on CentOS

                        Instead I created a directory called /lib65
                        and then ran
                        $ cp linux_loader-dont-know-if-you-need-this/ld-linux-x86-64.so.2 /lib65/
                        $ chmod 755 /lib65/ld-linux-x86-64.so.2

                        Then I used a hex editor to edit the starbound_server to point to /lib65 instead of /lib64

                        This way I don't have to redo it on reset.

                        Thanks again!
                        • gummby8

                          gummby8 Seal Broken

                          Forgot to come back here. I deleted the entire starbound folder on my Centos server and redid the whole process and it worked. No idea where it went wrong the first time.
                          • Jansen

                            Jansen Aquatic Astronaut

                            Hehe, lib65 :D My idea behind /tmp was that everyone can write there, so users without root privileges could use the patch.
                            Ah, nice!


                            BTW: I've updated the OP with links to 32bit libraries and a 32bit patch. I've seen some 32bit people, who have problems since the latest update.
                              Last edited: Dec 11, 2013
                            • Biidi

                              Biidi Subatomic Cosmonaut

                              Well, thanks to your 32-bit instructions I have progress! However, I think it may be backwards progress. :( I downloaded the file, extracted it and ran the server. Now I get this error:

                              sb-server.sh: line 5: 27142 Segmentation fault LD_LIBRARY_PATH=./ ./starbound_server

                              Is this the point where I should run the loader patch or am I SOL?
                              • Jansen

                                Jansen Aquatic Astronaut

                                Yes, try the loader patch.
                                • Biidi

                                  Biidi Subatomic Cosmonaut

                                  Awesome, looks like it works! Thanks so much for setting up the 32-bit instructions.

                                  Oh also, will the patch need to be redone each time the game/server has an update?
                                  I'm an idiot, just noticed the Remarks section.
                                    Last edited: Dec 11, 2013
                                  • Martijnie

                                    Martijnie Intergalactic Tourist

                                    Hi. Thanks for this thread, I'm having alot of trouble using the server on CentOS. I'm at the part where I have to use bspatch, however I don't have it installed by default. 'yum install bsdiff' or 'yum install bspatch' returns this:

                                    Code:
                                    root@vps[~]# yum install bspatch
                                    Loaded plugins: fastestmirror
                                    Loading mirror speeds from cached hostfile
                                    * base: centos.mirrors.tds.net
                                    * extras: centos.mirrors.tds.net
                                    * updates: mirrors.rit.edu
                                    base                                                    | 3.7 kB    00:00
                                    extras                                                  | 3.4 kB    00:00
                                    updates                                                  | 3.4 kB    00:00
                                    Setting up Install Process
                                    No package bspatch available.
                                    Error: Nothing to do
                                    Any clue how I do properly install it?
                                    • Jansen

                                      Jansen Aquatic Astronaut

                                      Martijnie likes this.
                                    • Martijnie

                                      Martijnie Intergalactic Tourist

                                      Thanks alot, installed using that command and then patched. Now Starbound is running on our vps :D I really hope they will make it easier/fix the problems with CentOS.
                                      • Pfilson

                                        Pfilson Space Spelunker

                                        For Gentoo the only issue I had was getting the older libpng version,

                                        To get that I ran:
                                        emerge libpng:1.2

                                        This should be repeatable for any additional libraries people may be missing.
                                        General syntax being "emerge <Library>:<Version>" as a user that has access to install packages (or sudo)

                                        After some digging it doesn't look like I needed some of the libraries you listed. I only had the following installed and it works:

                                        emerge libpng:1.2 freetype openssl

                                        Note: freetype and openssl were already installed before I even tried to run the server.
                                          Jansen likes this.

                                        Share This Page