Post Reply 
 
Thread Rating:
  • 3 Vote(s) - 4.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tutorial] Installing MinimServer on FreeNAS or FreeBSD
23-01-2016, 17:52 (This post was last modified: 23-03-2021 17:52 by airflow.)
Post: #1
Music [Tutorial] Installing MinimServer on FreeNAS or FreeBSD
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 Intel 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-intel.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@jail:/usr/local/share # minimserver/bin/startc
    MinimServer 2.0.16 update 185, Copyright (c) 2012-2021 Simon Nash. All rights reserved.
    starting MinimServer[jail]
    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!
Find all posts by this user
Quote this message in a reply
03-02-2016, 18:41 (This post was last modified: 03-02-2016 18:42 by simoncn.)
Post: #2
RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD
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!
Find all posts by this user
Quote this message in a reply
07-02-2016, 21:02
Post: #3
RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD
(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.
Find all posts by this user
Quote this message in a reply
07-02-2016, 22:01 (This post was last modified: 07-02-2016 23:24 by simoncn.)
Post: #4
RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD
(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.
Find all posts by this user
Quote this message in a reply
09-02-2016, 23:56
Post: #5
RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD
(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.
Find all posts by this user
Quote this message in a reply
24-12-2016, 13:00
Post: #6
RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD
I made the ohnet-libs available needed for the recent updates of MinimServer (ohnet(linux-x64)-1.10.2315.zip).
Find all posts by this user
Quote this message in a reply
18-07-2017, 21:17
Post: #7
RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD
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!
Find all posts by this user
Quote this message in a reply
18-07-2017, 21:58
Post: #8
RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD
(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.
Find all posts by this user
Quote this message in a reply
18-07-2017, 23:32
Post: #9
RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD
(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.
Find all posts by this user
Quote this message in a reply
19-07-2017, 07:49
Post: #10
RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD
The current version of the file is ohnet(linux-x64)-1.10.2315.zip (see this post).
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)