MinimServer Forum
[Tutorial] Installing MinimServer on FreeNAS or FreeBSD - Printable Version

+- MinimServer Forum (https://forum.minimserver.com)
+-- Forum: MinimServer (/forumdisplay.php?fid=1)
+--- Forum: Digital Audio (/forumdisplay.php?fid=10)
+--- Thread: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD (/showthread.php?tid=2891)

Pages: 1 2 3 4 5 6 7


[Tutorial] Installing MinimServer on FreeNAS or FreeBSD - airflow - 23-01-2016 17:52

Introduction

FreeNAS is a free and open-source solution for building a NAS yourself on commodity hardware. It's based on FreeBSD as the OS and ZFS as the filesystem.
MinimServer is a new UPnP AV music server with a number of innovative features that make it easier to organize and explore your music collection.

MinimServer does not come readily packaged for FreeNAS, but with a few steps it can be achieved that it runs properly within a jail on the system.
Details of investigations about this can be read here and here, but I recommend you save your time and just follow the instructions below.

I sum up the steps needed for MinimServer on FreeBSD here:
  1. Prepare a jail within FreeNAS as usual. Ensure the jail can connect to the internet.
  2. Install dependencies within jail: multimedia/ffmpeg, java/openjdk8-jre, ftp/wget, lang/gcc
  3. Create storage-link between your folder with your music and /media within the jail.
  4. Download MinimServer for Linux 64bit and place it in /usr/local/share within the jail.
  5. Change to /usr/local/share and extract the software:
    Code:
    tar -xvzf MinimServer-<version-you-downloaded>-linux-x64.tar.gz
  6. Download the libs from here (it contains the ohnet-libraries MinimServer needs, specifically compiled for FreeBSD) and place it in /usr/local/share within the jail.
  7. Now search for zip-files within the path of minimserver in the jail:
    Code:
    find /usr/local/share/minimserver -name "*.zip"
    You should see a zip-file beginning with "ohnet".
  8. Replace that file with the previously downloaded file, using exactly the filename of the existing variant of the installation of MinimServer.
  9. Start Minimserver with "minimserver/bin/startc".
  10. Depending on the exact version installed, it might start normally like this:
    Code:
    root@minimserver_1:/usr/local/share # minimserver/bin/startc
    MinimServer 0.8.5.2 update 123, Copyright (c) 2012-2018 Simon Nash. All rights reserved.
    starting MinimServer[services_2]
    Enter command (? for help):
    >Enter content directory, or null to continue:
    #
  11. After entering the path "/media" and pressing enter, MinimServer should scan your media and start. You can check the status of the server via a Webbrowser pointing to the ip of the jail and port 9790, for example http://192.168.0.32:9790/ You can rescan the library there. For full functionality install MinimWatch on your PC and control MinimServer through that.
  12. Note: If the downloaded version is not the latest one, it will update itself and then crash (!). This might also happen at a later time, when new updates of the software are released.
  13. If this happens: Repeat steps 7 & 8. This is necessary because the update-procedure has yet added another updated but incompatible zip-file with a new, higher version-number. It has to be replaced another time.
Want to make MinimServer to start automatically when starting the jail (or starting FreeNAS, that is)? In this case also do the following steps:
  1. Execute this command:
    Code:
    /usr/bin/sed -i -- 's/-eo pid,user,vsz,stat,args/-exo pid,user,vsz,stat,args/g' /usr/local/share/minimserver/bin/stopall
  2. Create the file /etc/rc.d/minimserver with the following contents:
    Code:
    #!/bin/sh
    #
    # $FreeBSD: /usr/local/etc/rc.d/minimserver, 2020/02/03 05:55:56 isaac Exp $
    #
    # PROVIDE: minimserver
    # KEYWORD: FreeBSD
    #
    # minimserver startup
    #

    . /etc/rc.subr

    minimserver_enable=${minimserver_enable}
    minimserver_flags=${minimserver_flags}

    name=minimserver
    rcvar=minimserver_enable
    minimserver_path=/usr/local/share/minimserver
    start_cmd=minimserver_start
    stop_cmd=minimserver_stop

    minimserver_start() {
        PATH=${PATH}:/usr/local/sbin:/usr/local/bin
        export PATH
        LANG=en_US.UTF-8
        export LANG
        LC_CTYPE=en_US.UTF-8
        export LC_CTYPE
        LC_ALL=en_US.UTF-8
        export LC_ALL
        checkyesno minimserver_enable && echo "Starting minimserver." && \
            ${minimserver_path}/bin/startd ${minimserver_flags}
    }

    minimserver_stop() {
        checkyesno minimserver_enable && echo "Stopping minimserver." && \
            ${minimserver_path}/bin/stopall
    }

    load_rc_config ${name}
    run_rc_command "$1"
  3. Make the file executable with "chmod +x minimserver"
  4. Execute this command:
    Code:
    sysrc minimserver_enable="YES"
  5. You can now start the server in the background with "service minimserver start" or by just restarting the jail or FreeNAS itself.
Additional notes

In the future it might become necessary to repeat the replacement of the zip-file (steps 7 & 8) again because of future updates. Just remember that when MinimServer suddenly stops working that this might be the case. In these cases, you will find an error-message in the log similar like this:
Code:
>java.lang.UnsatisfiedLinkError: /usr/local/minimserver/data/native/libohNet.so: Shared object "libm.so.6" not found, required by "libohNet.so"

Note: At the moment, the libraries are provided for 64-bit architecture only. These files will not work if used on a 32-bit OS (you can check with "uname -a").

Good luck and have fun with MinimServer!


RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD - simoncn - 03-02-2016 18:41

Thanks very much for creating this tutorial!

MinimServer update 76 (released today) contains a new version of ohNet (1.6.1919) with an important fix. It would be great if you could download the 1.6.1919 version of the ohNet source from GitHub and rebuild it for FreeBSD. Many thanks!


RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD - airflow - 07-02-2016 21:02

(03-02-2016 18:41)simoncn Wrote:  MinimServer update 76 (released today) contains a new version of ohNet (1.6.1919) with an important fix. It would be great if you could download the 1.6.1919 version of the ohNet source from GitHub and rebuild it for FreeBSD. Many thanks!

I don't know how to download a specific release of ohnet via git. I hope it's OK if I just download the most actual one. I did that and provide it here. I tested it in my installation and everything works fine.


RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD - simoncn - 07-02-2016 22:01

(07-02-2016 21:02)airflow Wrote:  I don't know how to download a specific release of ohnet via git. I hope it's OK if I just download the most actual one. I did that and provide it here. I tested it in my installation and everything works fine.

It is very easy to download a specific release. On the Github page for ohNet, you need to click the link that says 1,996 releases (as of today; this number will vary). This takes you to a page where you can download a .tar.gz file for any specific release. Here is a direct link to this page.

It is very desirable to use the same ohNet release as the official MinimServer version because this has been tested by me and by a large number of other MinimServer users. If you use a different release, this might work but there are no guarantees and I cannot provide any help or support if there are problems.


RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD - airflow - 09-02-2016 23:56

(07-02-2016 22:01)simoncn Wrote:  It is very desirable to use the same ohNet release as the official MinimServer version because this has been tested by me and by a large number of other MinimServer users. If you use a different release, this might work but there are no guarantees and I cannot provide any help or support if there are problems.

OK, I implemented this in my building procedure. The file available at the link is now exactly version 1.6.1919.


RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD - airflow - 24-12-2016 13:00

I made the ohnet-libs available needed for the recent updates of MinimServer (ohnet(linux-x64)-1.10.2315.zip).


RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD - lostinsound - 18-07-2017 21:17

I haven't been able to get this to work following the steps given. It appears that when I do step 9 it crashes before it updates the ohnet file.

For step 2, can the dependencies be installed using pkg to install the packages or are you supposed to do a full 'make install clean' on all of them in the portsnap folder. I really hope that isn't the case because the ffmpeg clean install takes hours on my machine and the java install ran for hours and hours and never finished because I killed it after it looked like it was in an infinite loop. I love this server and would really like to have it on my NAS so any help would be appreciated. Thanks!


RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD - airflow - 18-07-2017 21:58

(18-07-2017 21:17)lostinsound Wrote:  I haven't been able to get this to work following the steps given. It appears that when I do step 9 it crashes before it updates the ohnet file.

In this case it seems you haven't properly copied the file over the original. Can you confirm you did that?

Quote:For step 2, can the dependencies be installed using pkg to install the packages or are you supposed to do a full 'make install clean' on all of them in the portsnap folder. I really hope that isn't the case because the ffmpeg clean install takes hours on my machine and the java install ran for hours and hours and never finished because I killed it after it looked like it was in an infinite loop. I love this server and would really like to have it on my NAS so any help would be appreciated. Thanks!

I guess it's also possible to install the dependencies via different means (pkg), but I haven't tested it that way.


RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD - lostinsound - 18-07-2017 23:32

(18-07-2017 21:58)airflow Wrote:  
(18-07-2017 21:17)lostinsound Wrote:  I haven't been able to get this to work following the steps given. It appears that when I do step 9 it crashes before it updates the ohnet file.

In this case it seems you haven't properly copied the file over the original. Can you confirm you did that?

Quote:For step 2, can the dependencies be installed using pkg to install the packages or are you supposed to do a full 'make install clean' on all of them in the portsnap folder. I really hope that isn't the case because the ffmpeg clean install takes hours on my machine and the java install ran for hours and hours and never finished because I killed it after it looked like it was in an infinite loop. I love this server and would really like to have it on my NAS so any help would be appreciated. Thanks!

I guess it's also possible to install the dependencies via different means (pkg), but I haven't tested it that way.

Yes I replaced the ohnet(linux-x64)-1.6.1919.zip file in the jail with the file of the same name from the link, then I start the server and it crashes. But step 10 says "This is necessary because the update-procedure has yet added another updated but incompatible zip-file with a new, higher version-number. " This doesn't seem to happen for me, because the ohnet file in the jail is still exactly the same as the one I copied to it in step 8.

So you installed the dependencies using 'make install clean' in portsnap and not using pkg? And you were able to install java? I couldn't get it to work.


RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD - simoncn - 19-07-2017 07:49

The current version of the file is ohnet(linux-x64)-1.10.2315.zip (see this post).