HOWTO: Manually install Emby in a standard JAIL

Status
Not open for further replies.

DeaDSouL

Dabbler
Joined
Dec 21, 2015
Messages
34
Hi, I had an issue with the emby-plugin as mentioned here.
And since I couldn't solve it, and no FreeNAS developer/expert suggested where to look at in order to troubleshoot it :(..
I thought why not trying to manually install Emby in a standard jail? And it worked!! :D:D

Anyway, here are the steps:

1) Navigate to Jails, and click on "Add Jail":
Configure it as you like, then add allow.raw_sockets=true to the "Sysctls" field. (I don't know what it is, but it's always there in pluginjail. Could someone tell us what is it for?)

2) Select the created Jail and click on the "Shell" icon in bottom-bar.

3) SSH Daemon:
If you want to auto start the ssh-daemon in jail whenever it runs:
Code:
$ sysrc sshd_enable="YES"


Then, lets start ssh-daemon:
Code:
$ service sshd start


Otherwise, do:
Code:
$ service sshd onestart


4) Users:
First, create the home directory:
Code:
$ mkdir /home


Adding new user, in order to use it when we ssh-ing to our jail:
Code:
$ adduser

make sure when it says: "Login group is deadsoul. Invite deadsoul into other groups? []:" you type: wheel
so that the user has the ability to become root. (instead of "deadsoul" it will show the username you've chosen)

Now, close the shell window.

5) SSH to your jail.
Code:
$ ssh username@jail_host_or_ip


6) Become root:
Code:
$ su -


By default, you won't be able to compile any ports and that's because of the port collection support of the FreeBSD version that FreeNAS is using as its standard jail has been ended.

To get around that:
Code:
$ vi /etc/make.conf

hit: Shift+g <-- without '+' just Shift and g
hit: o
type: ALLOW_UNSUPPORTED_SYSTEM=yes
hit: Escape
hit: : <-- colon
type: wq
hit: Enter


7) Getting and updating ports tree:
Code:
$ portsnap fetch extract
$ portsnap fetch update



8) Installing Emby:
Code:
$ pkg install emby-server


9) Custom FFMPEG:
Delete the pre-compiled version of 'ffmpeg' that your jail has:
Code:
$ pkg delete -f ffmpeg


Install 'ffmpeg' build dependencies:
Code:
$ pkg install `make build-depends-list | tr '\n' ' ' | sed 's/\/usr\/ports\///g' | sed 's/audio\/lame //g'`


In case the previous command installed 'ffmpeg', let's delete it so that we can compile it later:
Code:
$ pkg delete -f ffmpeg


Head to the 'ffmpeg' port folder:
Code:
$ cd /usr/ports/multimedia/ffmpeg


Now, let's configure it:
Code:
$ make config

Make sure to check those options:
  • lame
  • SMB
  • ass
  • opus
  • x265


After that, compile 'ffmpeg':
Code:
$ make install clean


PS: If you want to accept all default options, try:
Code:
$ make -DBATCH install clean


Now, just sit back and wait till it finish its thing.

10) Emby server:
Enable the auto start of Emby server whenever the jail starts
Code:
$ sysrc emby_server_enable="YES"


Finally, run emby
Code:
$ service emby-server start


Otherwise, if you want to run it this time only, do:
Code:
$ service emby-server onestart 



That's it!!
Happy NASign :p
 
Last edited:

Jrod696

Explorer
Joined
Nov 20, 2017
Messages
52
I have not tried this yet but I may go down that path, currently I have the addon installed and it is working but the folks at Emby say I need to update the ffmpeg on the jail. I am curious if following just the ffmpeg portions of your post would update it to the current version or if I would just need to start over. Second question is going this route how do you update when the update is released?
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
When I switched over from Plex to emby I didn't even think about the plugin and created it manually in a standard jail. Fast forward a few months and I'm now actually running the plugin as Josh (who builds its) has also added in some stuff so emby automatically detects changes to the media folders and adds things to emby.

A manual install as above won't have this, and you're dependant on running scheduled scans to detect new media.

I guess if your having trouble though, a working manual jail is better than a broken plugin!
 

Jrod696

Explorer
Joined
Nov 20, 2017
Messages
52
When I switched over from Plex to emby I didn't even think about the plugin and created it manually in a standard jail. Fast forward a few months and I'm now actually running the plugin as Josh (who builds its) has also added in some stuff so emby automatically detects changes to the media folders and adds things to emby.

A manual install as above won't have this, and you're dependant on running scheduled scans to detect new media.

I guess if your having trouble though, a working manual jail is better than a broken plugin!


The plugin is working great, but ffmpeg is very outdated which isnt a big deal unless you use HEVC files which is pretty much my whole library. I just need a way to update ffmpeg and keep the plugin, im very happy with it.
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633

wywywywy

Dabbler
Joined
Jun 1, 2014
Messages
32
Hi.

I can't get this work. :( When I do ffmpeg make install clean, it shows this error -

Code:
===>   ffmpeg-3.4.1_6,1 depends on shared library: libxvidcore.so - found (/usr/local/lib/libxvidcore.so)
===>   ffmpeg-3.4.1_6,1 depends on shared library: libgmp.so - found (/usr/local/lib/libgmp.so)
===>   ffmpeg-3.4.1_6,1 depends on shared library: libgnutls.so - found (/usr/local/lib/libgnutls.so)
===>   ffmpeg-3.4.1_6,1 depends on shared library: libsmbclient.so - found (/usr/local/lib/samba4/libsmbclient.so)
===>  Configuring for ffmpeg-3.4.1_6,1
ERROR: smbclient not found

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
===>  Script "configure" failed unexpectedly.
Please report the problem to multimedia@FreeBSD.org [maintainer] and attach
the "/usr/ports/multimedia/ffmpeg/work/ffmpeg-3.4.1/config.log" including the
output of the failure of your make command. Also, it might be a good idea to
provide an overview of all packages installed on your system (e.g. a
/usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/multimedia/ffmpeg
*** Error code 1

Stop.
make: stopped in /usr/ports/multimedia/ffmpeg


Samba46 is definitely installed. But I noticed that the smb4.conf is missing? Is it supposed to be? When I run smbclient it complains about not being able to find smb4.conf, but still it shouldn't have anything to do with compiling ffmpeg right?

Any idea please?
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
It could. I'm not sure exactly what ffmpeg is doing, but it could be attempting to run smbclient to determine the version of the software installed, or something like that, and smbclient is erroring out because it can't find smb4.conf.
 

Jrod696

Explorer
Joined
Nov 20, 2017
Messages
52
I just went through the steps and it works beautifully but after all is said and done and the server is running when I go to any of the pages below I am getting a page cannot be displayed message, I think I missed a step.

I have a feeling its something simple that needs to be edited in the jail, I do know its working because I can ping it and ssh into the jail and server themselves and look around.

http://192.168.x.x:8096/web/wizardstart.html
http://192.168.x.x:8096
http://192.168.x.x:8096/web/dashboard.html
 
Last edited:

Zwck

Patron
Joined
Oct 27, 2016
Messages
371
Hello, I wanted to add my 2 cents as well:

Code:

#iocage plugin super easy

iocage fetch --plugins ip4_addr="igb0|192.168.0.110/24"
#type 6 enter

iocage console emby
service emby-server onestop
pw groupmod emby -n emby -g 1000 #1000 is my UID and GID
pw usermod emby -n emby -u 1000 -g 1000
chown -R emby:emby /var/db/emby-server
sysrc 'emby_server_user=emby'
service emby-server onestart

#add mounts...
iocage fstab -a emby /mnt/volume01/multimedia /multimedia01 nullfs rw 0 0
iocage fstab -a emby /mnt/volume02/multimedia /multimedia02 nullfs rw 0 0
iocage fstab -a emby /mnt/volume01/db/ssl/user-certs /certs nullfs rw 0 0


 

Zwck

Patron
Joined
Oct 27, 2016
Messages
371
IMHO the easiest way to create a emby jail, also to get the latest betas and stuff:

1st: Add to tunetables so jail gets inet and is available for multicasting

upload_2018-6-3_7-49-11.png


2nd: walk throught this
Code:
#create jail
iocage create -n "emby_foo" -r 11.1-RELEASE ip4_addr="vnet0|192.168.0.107/24" defaultrouter="192.168.0.1" vnet="on" allow_raw_sockets="1" boot="on"

#login to iocage
iocage console emby_foo
pkg update
pkg upgrade

pkg install emby-server
service emby-server onestart
sysrc 'emby_server_enable=YES'
sysrc 'emby_server_user=emby'
service emby-server onestop

# choose the uid for emby server so it can read your data
pw groupmod emby -n emby -g 1000 #1000 is my UID and GID
pw usermod emby -n emby -u 1000 -g 1000
chown -R emby:emby /var/db/emby-server

#skip this if you are interested in just the latest stable //skip from here
#or keep going for the latest stable
cd /tmp
fetch https://github.com/MediaBrowser/Emby/releases/download/3.4.1.10/Emby.Mono.zip
#(swap with address of latest file found here: https://github.com/MediaBrowser/Emby/releases)
unzip -d /tmp/emby Emby.Mono.zip
cp -Rfp /tmp/emby/ /usr/local/lib/emby-server
rm -r /tmp/emby
rm /tmp/Emby.Mono.zip
service emby-server onestart

#skip to here

#exit iocage
exit

#add storage
iocage fstab -a emby_foo /mnt/volume01/multimedia /multimedia01 nullfs rw 0 0
iocage fstab -a emby_foo /mnt/volume02/multimedia /multimedia02 nullfs rw 0 0
iocage fstab -a emby_foo /mnt/volume01/db/ssl/user-certs /certs nullfs rw 0 0


 

Usura

Cadet
Joined
Nov 22, 2018
Messages
3
Hello. I state that I am a beginner, someone would give me a hand to install emby on FreeNas 11.1-u6?

I have done various tests to try and update the 3.3 but nothing.

Now I have done a clean new installation.

I have just configured the storage.

What do I do now?

Thank you very much to those who will help me!
 

Zwck

Patron
Joined
Oct 27, 2016
Messages
371
Hello. I state that I am a beginner, someone would give me a hand to install emby on FreeNas 11.1-u6?

I have done various tests to try and update the 3.3 but nothing.

Now I have done a clean new installation.

I have just configured the storage.

What do I do now?

Thank you very much to those who will help me!

Sure, First update to Freenas RC2 (latest version)
then perform the following steps: Open Shell form sidebar:
type: thats all you need to do to get a very stable emby jail up and running.

Code:
cd /tmp
wget https://raw.githubusercontent.com/bott0r/iocage-plugin-emby-beta/master/emby-server-beta.json
iocage fetch -P dhcp=on vnet=on bpf=yes allow_raw_sockets=1 -n emby-server-beta.json --branch 'master'
 

Usura

Cadet
Joined
Nov 22, 2018
Messages
3
Sure, First update to Freenas RC2 (latest version)
then perform the following steps: Open Shell form sidebar:
type: thats all you need to do to get a very stable emby jail up and running.

Code:
cd /tmp
wget https://raw.githubusercontent.com/bott0r/iocage-plugin-emby-beta/master/emby-server-beta.json
iocage fetch -P dhcp=on vnet=on bpf=yes allow_raw_sockets=1 -n emby-server-beta.json --branch 'master'
I try but i have this errore:

Fetching artifact...
Exception: URLError:<urlopen error [Errno 8] hostname nor servname provided, or not known> occured, destroyed emby-server-beta73.

what do I do?
 

Zwck

Patron
Joined
Oct 27, 2016
Messages
371
Hi did you update to freenas rc2?
Can you install irrsr from the plugin section first
After that can you send the output of ifconfig
 

Usura

Cadet
Joined
Nov 22, 2018
Messages
3
Hi did you update to freenas rc2?
Can you install irrsr from the plugin section first
After that can you send the output of ifconfig
Yes, fresh install of rc2.
Now I succeeded!!
I had to set the dhcp in the freenas interface! as well as in the jail installation string. other details my jails work only on vnet0. if I configure the jail on the main interface, it does not go online! I'm going back to premise that I'm a beginner! but even when I was doing the tests on version 11.1, like on version 9.10, to make everything work I have to set, at the beginning, both interface and jail with the dhcp. once the plugins are installed, I can make changes and set static IP addresses. Maybe I'm wrong and I do not realize!
 
Status
Not open for further replies.
Top