FreeNAS Jail with Serviio 1.1

Here are my instructions for creating a FreeNAS Jail with Serviio 1.1 running inside it. This uses no FreeNAS plugins whatsoever and takes full advantage of all the power that comes with having a FreeBSD core running at the heart of FreeNAS 8.3.

  1. Install a plugin Jail as per the instructions available on the FreeNAS wiki here and start the Jail running.
  2. Create a user on your FreeNAS for yourself, e.g. MYUSER
  3. Enable SSH on your FreeNAS and SSH into your FreeNAS install using your client of choice.
  4. Execute the following commands:
    1. SU root
    2. jexec 1 csh
    3. mkdir /home
    4. adduser
  5. When prompted by adduser follow the instructions on-screen to create a user that matches the user you created in Step 2. Make sure that the Uid matches the user you created in Step 2. If you are not sure what the Uid number is then look it up in the FreeNAS control panel. Here’s the example:
    1. Username: MYUSER
      Full name: MYUSER
      Uid (Leave empty for default): 1111
      Login group [MYUSER]:
      Login group is MYUSER. Invite MYUSER into other groups? []: wheel
      Login class [default]:
      Shell (sh csh tcsh nologin) [sh]: csh
      Home directory [/home/MYUSER]:
      Home directory permissions (Leave empty for default):
      Use password-based authentication? [yes]:
      Use an empty password? (yes/no) [no]:
      Use a random password? (yes/no) [no]:
      Enter password:
      Enter password again:
      Lock out the account after creation? [no]:Username : MYUSER
      Password : *****
      Full Name : MYUSER
      Uid : 1111
      Class :
      Groups : MYUSER wheel
      Home : /home/MYUSER
      Home Mode :
      Shell : /bin/csh
      Locked : no
      OK? (yes/no): yes
      adduser: INFO: Successfully added (MYUSER) to the user database.
      Add another user? (yes/no): no
      Goodbye!
  6. Now we need to leave the jail and create a bridge between the FreeNAS internals and the jail. So logout of your SSH client and then turn off the jail in FreeNAS control panel. Then navigate to Services -> Plugins -> Management -> Mount Points and add a new mount point. Map a directory you can access regularly through FreeNAS as the directory /home/MYUSER within the jail. Turn the jail back on and restart your FreeNAS.
  7. SSH into your FreeNAS install using your client of choice.
  8. Execute the following commands [NB: This section will take some time to complete so set aside a couple of hours]:
    1. SU root
    2. jexec 1 csh
    3. portsnap fetch extract update
      1. Update 02 February 2013
      2. To ensure that you have the new pkg program installed run: pkg -v
      3. If you don’t get a response of 1.0.7 or higher then run: cd /usr/ports/ports-mgmt/pkg/ && make install clean
    4. cd /usr/ports/ports-mgmt/portmaster/ && make install clean
      Be sure to use the appropriate options for your system. If you’re not sure, check all the boxes.
      Portmaster
    5. echo ‘WITH_PKGNG=yes’ >> /etc/make.conf
    6. rehash
    7. pkg2ng
    8. portmaster -G editors/nano
    9. rehash
    10. cd /usr/ports/multimedia/ffmpeg1
    11. make config
      1. Set the options so that they match the information shown in the Serviio wiki for building ffmpeg. This is complicated so follow the screenshots below:
      2. ffmpeg1-page1
      3. ffmpeg1-page2
      4. ffmpeg1-page3
      5. press ok
    12. cd /usr/ports/graphics/frei0r/
    13. make config
    14. check Enable MMX CPU instructions then press ok
    15. portmaster -G multimedia/ffmpeg1
    16. portmaster -G net/serviio
    17. nano /etc/hosts and add line [replacing Jailed with the name of your jail from the FreeNAS control panel]:
      127.0.0.1 Jailed
    18. nano /etc/rc.conf and add lines:
      serviio_enable=”YES”
      serviio_args=”-Dserviio.remoteHost=192.168.0.100″
    19. service serviio start
  9. You’re done. Serviio will now start-up on every boot. Login to it remotely and set up the directories you need as necessary! I heartily recommend using ServiiDroid for Android which is available here.

64 Replies to “FreeNAS Jail with Serviio 1.1”

  1. MYstIC G,

    Thanks for the awesome post. I have been looking for exactly this information. I am wondering what version of FreeNas you are running? Is it 8.3.0 or 8.3.1? I am running 8.3.0, and when I attempt to run the following lines:

    echo ‘WITH_PKGNG=yes’ >> /etc/make.conf
    rehash
    pkg2ng

    I get the error – pkg2ng: Command not found.

    Do you think I screwed up on an earlier step… or do I need 8.3.1 to use this command?

    Thanks again,
    E

  2. Hi E, thanks for the feedback.

    I’m afraid to say that I did not come across that error. I’m running FreeNAS 8.3.0 with the most current plugin repository to match and ran all this through on a clean install without any issues (after much time spent figuring it out first).

    My list of things to try would be:

    1. Redo step 8.4 and double check that you’ve definitely got “Enable PKGNG support” checked. Then try going forward again.
    2. If that doesn’t work do open up your /etc/make.conf and check that it says WITH_PKGNG=yes and nothing else. You can open this by doing nano /etc/make.conf whilst inside your jail
    3. If that doesn’t work I’d try and install PKGNG for certainty (though I’m sure when I started out this was included and I didn’t have to install it manually. You should be able to achieve this with: portmaster -G ports-mgmt/pkg but as this will reinstall the package manager in the jail, if it goes wrong it will be super bad.

    Trying any of the above could break things and I’ve not tested any of it, everything in this comment is pure theory. If you have anything important running in your jail then please don’t break it based on my untested ideas because at the moment the worst you’ve done is install portmaster (which just makes installing ports easier).

  3. Thanks for the quick reply.

    Fortunately I don’t have anything in my jail, so it gives me leeway to play around. If it all goes bad, I’ll just delete everything and start over. Two more questions… are you by chance running the 64 bit version and are you running off of a USB Flash drive? I’m just trying to find some differentiation.

    I’m going to try installing PKGNG directly and see what happens… seems like I have a package issue because nano won’t even install.

    I’ll report back with my findings.

    E

  4. It’s good that there’s nothing to lose if you break something, that always makes the experimenting more fun 🙂

    I’m running the 64 bit version, though that should make no difference. It does indeed boot off of USB.

    I’m curious to know how you get on, in case I need to tweak the instructions!

  5. Sorry to be MIA…

    Currently I’m using PUTTY to connect from a Windows 8 box. The only difference that I have noticed is that the ‘SU” command has to be lowercase. An I’m guessing that all of the jails that I am creating and destroying are incrementing their ID. I’m on jail ID 3 as of right now.

    When you create your jail… do you explicitly assign a value to the amount of space available to the Dataset? I have not, but it is because I was under the impression it would grow as space is needed. I wonder if I have a space issue.

    Otherwise, do you know what version of portmaster you have installed on your machine? When I run portsnap fetch, portsnap extract, and portsnap update… I end up with portmaster-3.14_9. I think that is correct… but again I get the pkg2ng Command Not Found error.

    I’ll keep digging. Thanks again for your help on this.

    E

  6. Yeah the jail ID will increment when its either turned off and on again in the FreeNAS control panel or if you delete it and recreate it. It will reset to 1 if you do a full reboot of your FreeNAS box.

    My portmaster –version gives: Version 3.14 (pkgng patch 1.6).

    When you install portmaster are you enabling the option for pkgng?

  7. So I hate it when people do screen dumps in comments… so please forgive me for breaking one of my own rules.

    Here is the response that I get after configuring ‘PKGNG’ in the blue gui window….

    ===> License BSD accepted by the user
    ===> Found saved configuration for portmaster-3.14_9
    => portmaster-portmaster-3.14-31009f6.tar.gz doesn’t seem to exist in /usr/ports/distfiles/.
    => Attempting to fetch https://nodeload.github.com/portmaster/portmaster/legacy.tar.gz/31009f6?dummy=/portmaster-portmaster-3.14-31009f6.tar.gz
    portmaster-portmaster-3.14-31009f6.tar.gz 100% of 41 kB 345 kBps
    => patch-portmaster-pkgng.gz doesn’t seem to exist in /usr/ports/distfiles/.
    => Attempting to fetch http://mirror.shatow.net/freebsd/portmaster/patch-portmaster-pkgng.gz
    patch-portmaster-pkgng.gz 100% of 9937 B 97 kBps
    ===> Extracting for portmaster-3.14_9
    => SHA256 Checksum OK for portmaster-portmaster-3.14-31009f6.tar.gz.
    => SHA256 Checksum OK for patch-portmaster-pkgng.gz.
    ===> Patching for portmaster-3.14_9
    ===> Applying distribution patches for portmaster-3.14_9
    ===> Applying extra patch /usr/ports/ports-mgmt/portmaster/files/extra-patch-files::with_pkgng_current
    ===> Applying extra patch /usr/ports/ports-mgmt/portmaster/files/extra-patch-files::pkg_install-pkgng-ss
    ===> Applying extra patch /usr/ports/ports-mgmt/portmaster/files/extra-patch-files::zsh-completions
    ===> Applying FreeBSD patches for portmaster-3.14_9
    ===> Configuring for portmaster-3.14_9
    ===> Building for portmaster-3.14_9
    /usr/bin/sed -e ‘s#/usr/local#/usr/local#g’ /usr/ports/ports-mgmt/portmaster/work/portmaster-portmaster-31009f6/portmaster > /usr/ports/ports-mgmt/portmaster/work/portmaster
    /usr/bin/sed -e ‘s#/usr/local#/usr/local#g’ /usr/ports/ports-mgmt/portmaster/work/portmaster-portmaster-31009f6/files/portmaster.rc.sample > /usr/ports/ports-mgmt/portmaster/work/portmaster.rc.sample
    ===> Deinstalling for ports-mgmt/portmaster
    ===> portmaster not installed, skipping
    ===> Installing for portmaster-3.14_9
    ===> Generating temporary packing list
    ===> Checking if ports-mgmt/portmaster already installed
    install -o root -g wheel -m 555 /usr/ports/ports-mgmt/portmaster/work/portmaster /usr/local/sbin/portmaster
    install -o root -g wheel -m 444 /usr/ports/ports-mgmt/portmaster/work/portmaster.rc.sample /usr/local/etc
    install -o root -g wheel -m 444 /usr/ports/ports-mgmt/portmaster/work/portmaster-portmaster-31009f6/files/portmaster.8 /usr/local/man/man8
    /bin/mkdir -p /usr/local/etc/bash_completion.d
    install -o root -g wheel -m 444 /usr/ports/ports-mgmt/portmaster/work/portmaster-portmaster-31009f6/files/bash-completions /usr/local/etc/bash_completion.d/portmaster.sh
    /bin/mkdir -p /usr/local/share/zsh/site-functions
    install -o root -g wheel -m 444 /usr/ports/ports-mgmt/portmaster/work/portmaster-portmaster-31009f6/files/zsh-completions /usr/local/share/zsh/site-functions/_portmaster
    /bin/cat /usr/ports/ports-mgmt/portmaster/pkg-message
    If you are upgrading from the old package format, there are 2
    extra steps required.

    Enable PKGNG as your package format:

    # echo ‘WITH_PKGNG=yes’ >> /etc/make.conf

    Then convert your /var/db/pkg database to the new pkg format:

    # pkg2ng
    ===> Compressing manual pages for portmaster-3.14_9
    ===> Registering installation for portmaster-3.14_9
    plugins# echo ‘WITH_PKGNG=yes’ >> /etc/make.conf
    plugins# pkg2ng
    pkg2ng: Command not found.
    plugins#

    I’m not 100% sure what I should be looking for… but this line does not look good…

    => patch-portmaster-pkgng.gz doesn’t seem to exist in /usr/ports/distfiles/.

    but it does look like it downloads the package after that. And then I am not 100% sure what to make of these line either…

    ===> Deinstalling for ports-mgmt/portmaster
    ===> portmaster not installed, skipping
    ===> Installing for portmaster-3.14_9

    I’m guessing it is re-installing Portmaster?

    Sorry for all of the Noob questions… I haven’t used any flavor of ‘Nix for over ten years and to say that I am rusty is an understatement.

    Again, I appreciate all of the help, and I just hope this will help someone else out there too!

    E

  8. Hi,

    Thanks for going to the effort to document this process.

    Whilst following it, I have stumbled across the exact issue that Everett is experiencing.

    When getting to 8.7 (gkg2ng), I get the same error he got (pkg2ng: Command not found).

    I definitely had “Enable PKGNG support” checked.

    I checked /etc/make.conf. All it has in it is:
    WITH_PKGNG=yes

    I am running FreeNAS-8.3.0-RELEASE-p1-x64 (r12825). This is running from a USB Flash drive.

    Any ideas how I might be able to get beyond this?

  9. Right, I’m starting to wonder now if it might be worth introducing an extra step into the instructions as the block is clearly centred around the New Generation Package Manager. Perhaps its worth forcing the issue as to installing the New Generation Package Manager.

    If I do a pkg -v I get: 1.0.7

    It might be worth doing: cd /usr/ports/ports-mgmt/pkg/ && make install clean

    As always don’t do any of this if you’ve got anything on your FreeNAS box that you don’t want to lose!

    If you do give it a go then I’d love to know how you get on.

  10. Update: It appears that my problem was that I was using PuTTY instead of the Shell provided by the web interface. Using the Shell from the web interface solved my issue.

    I hope that helps anybody else experiencing the same issue that Everett and I was.

  11. MYstIC G,

    I cannot thank you enough for this wonderful post. Without it, I would definitely not be running Serviio off my FreeNAS box.

    I have it all up and running now, with my Windows machine as my remote host (for the Console).

    Other than the sticking point of using PuTTY instead of the Shell console from the web UI, I had little difficulty in following your clear steps.

    Thanks once again for putting the effort in for working out how to do this, and then documenting it so well.

  12. Sorry for the late reply Everett, for some reason your latest one got caught in the Akismet filters (probably the package links).

    Could you try Adpd’s solution and see if that helps. At this point you might want to start with a fresh jail, just to make things easier.

  13. This is great!!!
    I’ve been struggling with installing serviio on FreeNAS 8.3 for the last 3 days 🙂
    Your tutorial worked perfectly.
    I also got a (pkg2ng command not found.)
    the fix was “make -C /usr/ports/ports-mgmt/pkg install clean”.

    You should definitely add the extra step and maybe make it optional. 🙂
    Thanks!!!

  14. Awesome tutorial! Lacking a decent media server was the greatest flaw of FreeNAS for me, and I already planned using OpenMediaVault when I found your tutorial. Thanks a lot!
    BTW I had a similar problem as Everett when I found I skipped the step you added recently – installing PKG. What I found very helpful was a thread on the FreeBSD forum. It shows how to clean a messed up Portmaster installation before installing PKG: http://forums.freebsd.org/showthread.php?t=35291

  15. I’m glad it has helped you getting Serviio up and running jah_liar 🙂

    Thanks for the link as well, the FreeBSD forums are full of useful information but can be really difficult to navigate sometimes.

  16. I have been thinking… what do you exactly create the user for, and how is the home directory used? I am not familiar with FreeBSD, and I don’t see any reference to the user later on. I’m asking because was planning to create one generic “services” user for Serviio, Transmission and so forth. Will that be a problem? Or is creating a user for each service the better option?

  17. The user is so you have a user account both within the core FreeNAS install and within the jail running Serviio that are identical and therefore cross over between them.

    The logic for this with my system was that the windows file sharing is in the main FreeNAS core and the file permissions are dealt with there. Using the same user within the jail lets Serviio access the files without all the permissions becoming a massive headache.

    Doubtless it is probably possible to use nobody:nobody as the user:group combination but I went down a route that provided certainty.

  18. I got all of this running thanks heaps .. I had to make a home dir for dlna user..
    However the ffmpeg1 does not work with..
    FFmpeg is not compiled with librtmp support, RTMP streaming will not work.
    if I run ffmpeg on the cmd line in jail it has no mention of rtmp either enable or disable.. I can see no error in building it .. output is
    ffmpeg version 1.0.1 Copyright (c) 2000-2012 the FFmpeg developers
    built on Feb 7 2013 23:50:01 with gcc 4.2.2 (GCC) 20070831 prerelease [FreeBSD]
    configuration: –enable-x11grab –prefix=/usr/local –mandir=/usr/local/man –incdir=/usr/local/include/ffmpeg1 –libdir=/usr/local/lib/ffmpeg1 –shlibdir=/usr/local/lib/ffmpeg1 –datadir=/usr/local/share/ffmpeg1 –build-suffix=1 –progs-suffix=1 –enable-shared –enable-gpl –enable-postproc –enable-avfilter –enable-pthreads –enable-memalign-hack –disable-libstagefright-h264 –disable-libutvideo –cc=cc –extra-cflags=’-msse -I/usr/local/include/vorbis -I/usr/local/include’ –extra-ldflags=’-L/usr/local/lib ‘ –extra-libs=-pthread –disable-debug –disable-libaacplus –disable-indev=alsa –disable-outdev=alsa –enable-libopencore-amrnb –enable-libopencore-amrwb –disable-libass –disable-libcdio –disable-libcelt –enable-libfaac –disable-libfdk-aac –enable-fontconfig –enable-libfreetype –enable-frei0r –enable-gnutls –disable-libgsm –enable-libmp3lame –disable-libbluray –disable-libv4l2 –disable-libmodplug –disable-openal –enable-libopencv –disable-libopenjpeg –disable-libpulse –enable libavutil 51. 73.101 / 51. 73.101
    libavcodec 54. 59.100 / 54. 59.100
    libavformat 54. 29.104 / 54. 29.104
    libavdevice 54. 2.101 / 54. 2.101
    libavfilter 3. 17.100 / 3. 17.100
    libswscale 2. 1.101 / 2. 1.101
    libswresample 0. 15.100 / 0. 15.100
    libpostproc 52. 0.100 / 52. 0.100
    Hyper fast Audio and Video encoder

  19. Hi harald. Sorry you’re not having much luck. If you picked RTMP in the options as it’s shown in the picture in 11.4 then it should work fine. If it didn’t work I’d give it another go.

  20. I ended up using the older version and it seems to work OK.. However I might just go through the excercise again..

  21. Hi MysticG. Thank you so much for the only working guide I’ve found so far. I was looking more for working packages / dependencies rather than the whole setup so I may have caused my own issues. Having said that, this info might be of use to someone.

    I had the same problems as harald (on freenas 8.3.0)

    1. portsnap fetch extract update – did not allow me to make install in /usr/ports/ports-mgmt/pkg.

    I kept getting “pkg-1.0.7.tar.xz doesn’t seem to exist in /usr/ports/distfiles/” – then it seems to try to auto aquire, spams a lot, then fails.

    Instead I ran portsnap fetch update and that worked instead. I imagine this used quite a bit more disk but it’s what finally worked for me.

    2. My user needed a homedir because /var/log/serviio/serviio.log was filling with [prefs] Couldn’t flush user prefs: java.util.prefs.BackingStoreException: Couldn’t get file lock.
    The user is in the start of the log: [MediaServer] User: dlna [MediaServer] User home dir: /usr/pbi/minidlna-amd64/ [MediaServer] Temp dir: /var/tmp/
    Not sure where this account came from, probably part of the package itself, the account you use is configured here: /usr/local/etc/rc.d/serviio
    On the off chance they used the username somewhere else, I stuck with it, checked it’s homedir via “chpass dlna” – it’s home directory /usr/pbi/minidlna-amd64/ – didn’t exist so I just created it and chowned it to dlna. This shut java up.

    3. Editing /etc/rc.conf I used the IP of my freenas box for: Dserviio.remoteHost= – this must be the IP of your JAIL instead.

    4. Services -> Plugins -> Management -> Mount Points – the name you use for your mount point is going to be visible via “folder” view in serviio” so if you’re mounting your media folder don’t call it “mount-point-for-media-folder” or something silly 🙂

    5. FFmpeg is not compiled with librtmp support, RTMP streaming will not work.
    I don’t know why I didn’t get RTMP support. I ticked RTMP as per the screenshot.

    I received ===>>> Installation of multimedia/rtmpdump (rtmpdump-2.4_1) succeeded

    and under: ===> Configuring for ffmpeg1-1.0.1_1

    librtmp enabled yes

    But later when starting Serviio:

    2013-02-14 17:48:37,508 WARN [FFMPEGWrapper] FFmpeg is not compiled with librtmp support, RTMP streaming will not work.

  22. I’m glad it gave you some helpful pointers in getting running Iceman 🙂

    The RTMP stuff being hit and miss is a mystery to me, I’ve checked my Serviio logs and I don’t have those error messages in respect of RTMP.

    The home directory stuff I didn’t bother with but this is because by default the DLNA user created by the Serviio install has a home directory set to /nonexistant

  23. Hey MYstIC G!

    I gave this a go after upgrading my FreeNAS installation to FreeNAS-8.3.0-RELEASE-p1-x64 (r12825). After the upgrade everything worked great (had to install pkg as noted in your FEB update).

    Serviio is running and I can connect to it using the Serviio Console on my Win8 box. I believe I may have my Mount Point incorrectly configured though. I am not sure if I need to update something on the server config, or if I just need to put in the correct path in my Serviio console. Can offer some insight as to how you configured your Mount Point / Console Media directories? For instance.. my Mount Point Source is a Volume called /mnt/Media and the destination is /home/Everett. If I have a folder on the Media volume called Audio, in the Serviio Console, do I need to add “Audio” to the Library, or is there some kind of “auto” discovery going on?

    Thanks again for all of you help with this!
    E

  24. Hi Everett.

    Really glad you were able to get Serviio up and running and brilliant news that the extra step has made the difference.

    With Serviio you have to use the console to tell it which directories you want indexed and what they contain.

    So for your example if within the jail your music is at “/home/Everett/Audio” then you need to tell Serviio to index “/home/Everett/Audio” and that it contains music files.

    Hope that makes sense, if not then give me a shout 🙂

  25. Hey MYstIC G,

    Yes… your advice makes perfect sense. I think my issue may be permissions related. Serviio aside, when I have created a Mount Point in FreeNas… if I navigate to my users home folder in the Shell, should I then see the folders defined in the Mount Point location? Per your previous example, if I were in the shell and I were in the /home/Everett directory, if I used the “ls” command, should I see the “Audio” folder? If not, is there a way that I can verify that the Mount Point is correctly configured either in the Shell or something other that the GUI?

    Thanks,
    Everett

  26. Hi again Everett.

    If you’ve got your mount points set up correctly then you should be able to do something similar to the following:

    1. SSH into your FreeNAS install and change to your directory (e.g. /mnt/EverettsFreeNAS/Media) and then do ls to get a list which in your case should show “Audio”
    2. su to root and then enter your jail with the jexec command
    3. whilst still in the jail change to your directory (e.g. /home/EverettJailUser/Media) and then do ls to get a list. This list should be identical to the first.

    If the lists don’t match up then you’d need to try setting them again in the control panel. The the FreeNAS documentation on this is probably going to be more helpful than me because I don’t have an in depth understanding. I just know that for Serviio two users with the same UID, name, etc works (one on the main FreeNAS install and the other in the Jail).

  27. MYstIC G!

    Great news… I finally got Serviio up and running and I am streaming content throughout the house! It turns out that I had my permissions on my Mount Point folders all out of whack. Using your advice I was able to go though all of my folders and get the permissions in line.

    Thanks again for all of your help. This post has been a great help to all.

    E

  28. Hey MysticG,

    Another happy guy over here. I had a couple issues but they were mostly path and UID related and were solved by re-reading, or scrolling through the comments.

    I also had the RTMP errors. Didn’t try to remedy them, but everything seems to be working fine. Created a home directory for DLNA ( /home/dlna ) and updated it with chpass dlna, which got rid of the annoying java errors (was /nonexistant).

    Serviio 1.2 is out, so I’ll be watching for your upgrade tutorial when the FreeBSD port is available!

  29. Really glad you got Serviio working joe_r 😀

    Updates should be really simple (I’m testing this as I type)

    1. Login to your Jail (see item 4. in the main article)
    2. Run: portsnap fetch extract update
    3. Run: portmaster -a -G

    All things being equal, this downloads and updates the ports tree on your system and then updates all of your ports, i.e. not just Serviio but everything.

  30. Hi all,

    I’m tring to install serviio but i have a problem during the portmaster installation.
    Afther the follwing command “cd /usr/ports/ports-mgmt/portmaster/ && make install clean” i have no portmastger option menu but i only have the following output:


    # pkg2ng
    ===> Compressing manual pages for portmaster-3.14_9
    ===> Registering installation for portmaster-3.14_9
    Installing portmaster-3.14_9… done
    ===> Cleaning for portmaster-3.14_9
    software# ”

    nothing else.

    How can I start the portmaster option menu?

    Tancks
    Marco

  31. Hi MYstIC G,

    Thanks for the quick reply!
    Unfortunately your command doesn’t works….
    I get the following output:
    software# cd /usr/ports/ports-mgmt/portmaster/ && make config
    ===> Options unchanged

    What can I try?

    Thanks a lot
    Marco

  32. Really not sure what to suggest Marco, when I execute that command it presents me with the dialogue allowing me to choose the options. Sorry 🙁

  33. Hi MYstIC G,
    thanks for these awesome instructions! Works great with Serviio 1.2
    The installation really took some time. 🙂

    Thanks,
    r15ch13

  34. Hi MYstiC, thnx for your great tutorial.
    I have some proposals for you and your readers.

    1) su root may not be needed, if u log like me with ssh ip -l root.
    2) Instead of the user creation, I created a usergroup wich all my machines/users have. used the same GID and thus file access is simplified.
    **3) I installed on FreeNAS 8.3.1 and on step 8.viii
    I got error:
    Registering installation for libiconv-1.14_1 Installing libiconv-1.14_1…pkg: libiconv-1.14_1 conflicts with gettext-0.18.1.1 (installs files into the same place). Problematic file: /usr/local/lib/charset.alias *** Error code 70

    which I fixed with the following:
    # pkg delete -f devel/gettext
    # portmaster converters/libiconv devel/gettext
    then resumed the build as per the error instructions. However is much faster if

    However its much faster if u perform the above steps before step 8.viii
    **4) after the installation is finished Servioo service threw errors about Config DB beeing read only that was fixed by chmod -r 775 /var/db/serviio.

    5) I used ZFS snapsots extensively which allowed me a lot of freedom to experiment and be safe. However this eats a lot of space and my small 2GB Jail volume was not enough so I had to expand it. As I run FreeNAS under VBox that was relatively easy.
    Have at least 4GB free if u r to snapshot every major step.

    Thanx to u I have now Serviio 1.2 installed and running on my FreeNAS 8.3.1 VM.

    Thanx Marios

  35. Hi MYstiC, need help about serviio installation.
    I am a newbie about FreeBSD and so got some problem with installation process.
    I wish try serviio with freenas8 before installing it oun may NAS,
    so i made a Vmware VM with Freenas 8.3.1, VM IP address is 192.168.160.133.
    According to your guide i have:
    1. installed and started plugin jail.
    Plugins jail path=”/mnt/volume1/jail
    Jail name=”software”
    Jail IP address=”192.168.2.3″
    Jail IP Netmask=”/24(255.255.255.0)”
    Plugin archive path= ” /mnt/volume1/software”
    2. Crate a user:
    User ID=1111,
    Primary GRoup ID=MYUSER,
    Home directory=”/mnt/volume1/jail/software/home”
    Shell=csh
    Full name=Roberto
    3. Enabled SSH and SSH into my freenas 192.168.160.133:22 with Putty.
    4. try to type “SU root” but got a error message “SU: Command not found”,
    retype “su root” but got “su: Sorry”, on VM console windows got the message “su: BAD SU MYUSER to root on /dev/pts/0”

    Can you help me
    thank you

  36. Hi Mystic,

    Thanks for an awesome guide. Had same problems as Marios at **3) His steps solved the problem.

    I now have a kick ass Freenas with Serviio 1.2 running on N40L server. So much better than MiniDLNA.

    Thanks again!
    Brendan

  37. Hi Roberto, I’m afraid I can’t help as I’ve never come across that error before. If you SSH into FreeNAS then su to become root should just work.

  38. Really glad Serviio on FreeNAS is working for you Brendan! Thanks also to Mario for finding that issue on his installation and also the fix!

  39. Hi every one
    I’m glade that this guide is working for some people.
    I just followed it after long time i finale got it work as i can see serviio start on boot, unfortunately i don’t know how to access the serviio console in browser, I try the ip addres that in write on (nano /etc/hosts)but doesn’t open the console.
    ANY HELPPP PLEASEEE……..

  40. Serviio console is a java applet. If you install it on your PC it should be easy to set up (modify one config file). If that’s too difficult there’s a good application for Android called Servidrioid which is awesome.

  41. Hi MYstIC G
    How I can open serviio on webgui after finish the configuration, i can see it start on the boot, but doesn’t list service also can’t open it with ip writed on the config file.
    some idea…..
    tks

  42. Hi Fr33Sens4, I’ve not really used the webgui for Serviio myself. I’ll try and dig out how I configured the Serviio console in the next few days and maybe do a post on how to configure that.

  43. Hi Mystic,

    I had a lot of problems installing psmediaserver on FreeNAS-8.3.1-RELEASE-p2-x64. But I did get it started with help of ur FreeNAS Jail with Serviio 1.1. Thank you for that.

    Just send you the link if you are interested, I am a newbie at FreeNAS and Linux but somehow I did get it to work,

    Thanks for helping me out.

    Greets,

    Ids

  44. Hi Mystic,
    GReat site thanks for the tutorial. I’m pretty new to freenas, but I’ve found the minidlna plugin to just be lacking. So I’ve been trying to follow your guide on a new freenas distro 8.3.1 p2, And I keep running into the same issue, when I go to do the “cd /usr/ports/ports-mgmt/portmaster/ && make install clean”

    I always get an error “pkg-static: /var/db/pkg wrong user or group ownership (expected 0/0 versus actual 1001/0)”

    Any thoughts on what I’m doing wrong? I’ve done quite a few google searches without finding any solutions.

  45. Hi Mystic,

    Thanks for all the instructions. I followed your instructions and everything works until 8.4 The option for enable pkgng support does not show up in the selections. Any ideas?

  46. Instructions worked fairly well for FreeNAS 9.1
    I used a standard Jail and switched off “Vanilla” and VNET settings to allow the pkg2ng option to work.
    I had a ZFS media volume with freenas installation on USB. One stumbling block – do not install the Jail on the USB, as the freespace is locked (perhaps works on a reboot) but I had lots of trouble until I realised this. I use serviidroid to configure it and still finding my way through.
    Thank you for the guide!

  47. seems to be working for me but i cannot find the plugins folder for adding “serviio plugins”. has anyone used this with any .groovy files? where do i place them? Thanks!

  48. install seems to have worked for me but can anyone tell me where the serviio plugins folder is located so I can add some .groovy files?

  49. I have a question after running serviio on 9.1.1 for a month or so.
    If I copy videos to a folder then move them at any point after the initial location – serviio shows the original folder of the video in the first location, however the filename doesn’t exist in the folder as well as the new location with the folder and file inside it. It does not get cleared out/updated and I’ve read about it takes an hour or so. I have updates and auto refresh switched on… and tried them off … and a forced refresh. nothing seems to get rid of the ‘ghost’ of the original folder in the first location – so it’s cluttering up my library. Any help would be great.

  50. I’ve never come across an issue like that I’m afraid. Have you tried removing the folder from Serviio’s list of folders to scan and then adding it back?

  51. Hi,
    Well, I only have the one folder for videos being indexed in the Library – the /home/username/Media directory. Then it goes Videos/TV or Videos/Movies/New etc under that directory. I removed the folder from the index and it removed the entire library index for it – readded it and it’s generating the Library from scratch.. which doesn’t really bother me and I know it’ll clean itself up after that exercise – perhaps it’ll fix it. i’ll let you know.

  52. MYstIC G,

    Thanks for your instructions. I used this instractions in August on test mashine and all was OK. But now in September when I can do the same on new mashine i have got an error in portmaster update and because i am new in freebsd i dont know what to do with “Registering installation for dialog4ports-0.1.5_2
    *** [fake-pkg] Error code 74. ”

    Thanks Woody
    log:
    root@serviio:/ # cd /usr/ports/ports-mgmt/portmaster/ && make install clean
    ===> Building/installing dialog4ports as it is required for the config dialog
    ===> Cleaning for dialog4ports-0.1.5_2
    ===> License BSD2CLAUSE accepted by the user
    ===> dialog4ports-0.1.5_2 depends on file: /usr/local/sbin/pkg – found
    => dialog4ports-0.1.5.tar.gz doesn’t seem to exist in /usr/ports/distfiles/.
    => Attempting to fetch http://m1cro.me/dialog4ports/dialog4ports-0.1.5.tar.gz
    dialog4ports-0.1.5.tar.gz 100% of 10 kB 60 kBps 00m01s
    ===> Fetching all distfiles required by dialog4ports-0.1.5_2 for building
    ===> Extracting for dialog4ports-0.1.5_2
    => SHA256 Checksum OK for dialog4ports-0.1.5.tar.gz.
    ===> Patching for dialog4ports-0.1.5_2
    ===> Configuring for dialog4ports-0.1.5_2
    ===> Building for dialog4ports-0.1.5_2
    Warning: Object directory not changed from original /usr/ports/ports-mgmt/dialog4ports/work/dialog4ports-0.1.5
    cc -O2 -pipe -fno-strict-aliasing -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c dialog4ports.c
    cc -O2 -pipe -fno-strict-aliasing -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c mixedlist.c
    gzip -cn dialog4ports.1 > dialog4ports.1.gz
    cc -O2 -pipe -fno-strict-aliasing -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -o dialog4ports dialog4ports.o mixedlist.o -lncursesw -lm -ldialog
    ===> Staging for dialog4ports-0.1.5_2
    ===> Generating temporary packing list
    install -s -o root -g wheel -m 555 dialog4ports /usr/ports/ports-mgmt/dialog4ports/work/stage/usr/local/bin/dialog4ports
    install -o root -g wheel -m 444 dialog4ports.1.gz /usr/ports/ports-mgmt/dialog4ports/work/stage/usr/local/man/man1
    ====> Compressing man pages (compress-man)
    ===> Installing for dialog4ports-0.1.5_2
    ===> Checking if dialog4ports already installed
    ===> Registering installation for dialog4ports-0.1.5_2
    *** [fake-pkg] Error code 74

    Stop in /usr/ports/ports-mgmt/dialog4ports.
    *** [install] Error code 1

    Stop in /usr/ports/ports-mgmt/dialog4ports.
    ===> Options unchanged
    ===> License BSD2CLAUSE accepted by the user
    ===> portmaster-3.17.7 depends on file: /usr/local/sbin/pkg – found
    => portmaster-3.17.7.tar.gz doesn’t seem to exist in /usr/ports/distfiles/.
    => Attempting to fetch http://distcache.FreeBSD.org/local-distfiles/bdrewery/portmaster/portmaster-3.17.7.tar.gz
    portmaster-3.17.7.tar.gz 100% of 43 kB 569 kBps 00m00s
    ===> Fetching all distfiles required by portmaster-3.17.7 for building
    ===> Extracting for portmaster-3.17.7
    => SHA256 Checksum OK for portmaster-3.17.7.tar.gz.
    ===> Patching for portmaster-3.17.7
    ===> Configuring for portmaster-3.17.7
    ===> Building for portmaster-3.17.7
    /usr/bin/sed -e ‘s#/usr/local#/usr/local#g’ /usr/ports/ports-mgmt/portmaster/work/freebsd-portmaster-94ed670/portmaster > /usr/ports/ports-mgmt/portmaster/work/portmaster
    /usr/bin/sed -e ‘s#/usr/local#/usr/local#g’ /usr/ports/ports-mgmt/portmaster/work/freebsd-portmaster-94ed670/files/portmaster.rc.sample > /usr/ports/ports-mgmt/portmaster/work/portmaster.rc.sample
    /usr/bin/sed -e ‘s#/usr/local#/usr/local#g’ /usr/ports/ports-mgmt/portmaster/work/freebsd-portmaster-94ed670/files/portmaster.8 > /usr/ports/ports-mgmt/portmaster/work/portmaster.8
    ===> Staging for portmaster-3.17.7
    ===> Generating temporary packing list
    install -o root -g wheel -m 555 /usr/ports/ports-mgmt/portmaster/work/portmaster /usr/ports/ports-mgmt/portmaster/work/stage/usr/local/sbin/portmaster
    install -o root -g wheel -m 0644 /usr/ports/ports-mgmt/portmaster/work/portmaster.rc.sample /usr/ports/ports-mgmt/portmaster/work/stage/usr/local/etc
    install -o root -g wheel -m 444 /usr/ports/ports-mgmt/portmaster/work/freebsd-portmaster-94ed670/files/portmaster.8 /usr/ports/ports-mgmt/portmaster/work/stage/usr/local/man/man8
    ====> Compressing man pages (compress-man)
    ===> Installing for portmaster-3.17.7
    ===> Checking if portmaster already installed
    ===> Registering installation for portmaster-3.17.7
    *** [fake-pkg] Error code 74

    Stop in /usr/ports/ports-mgmt/portmaster.
    *** [install] Error code 1

    Stop in /usr/ports/ports-mgmt/portmaster.
    root@serviio:/usr/ports/ports-mgmt/portmaster #

  53. Hi Woody,

    FreeNAS has moved on a bit now. Try and use: pkg install portmaster

    Hopefully that will install it for you as its pre-compiled.

Leave a Reply