Jump to content

New FreeNAS Package for testing


Recommended Posts

We're pleased to announce a brand new FreeNAS package for Emby Server. Here are the highlights and advantages over the current package:

  • Fewer installation steps
  • New releases will be immediately available
  • Beta builds will now also be immediately available just like other platforms !
  • Currently based on mono, but we'll be switching to .NET Core as soon as it's available for FreeBSD. Keep an eye on: https://github.com/dotnet/corefx/issues/1626

Installation

  • Requires FreeNAS 11.1+, but 11.1 users will need to use the new web UI that FreeNAS occasionally prompts you about.
  • There's no one click button in the freenas web interface that we could find (hopefully that'll get added in the final release). But it's fairly easy to install anyway via the shell in the web interface:
wget https://raw.githubusercontent.com/MediaBrowser/iocage-amd64/master/emby-server.json
iocage fetch -P --name emby-server.json ip4_addr="vtnet0|192.168.122.3/24" defaultrouter="192.168.0.1" dhcp="on" vnet="on" bpf="yes" allow_raw_sockets="1" boot="on"
  • Replace vtnet0 with your primary network interface (ifconfig will print them). vtnet0 should be set to a real network interface, like eth0. vtnet0 is just the name of the virtualized network interface in our test VM. 
  • Replace 192.168.122.3 and 24 with the IP and netmast you desire (should be different from that of your freenas box).  You can edit this afterwards in the jail configuration interface, but since the plugin needs internet access to install, the initial configuration should be valid.
  • After installation you can add mount points using the jail interface to access your media files.

Update 

iocage console emby-server
service emby-server stop
pkg add -f https://github.com/MediaBrowser/Emby.Releases/releases/download/3.6.0.FUTURE/emby-server-freebsd_3.6.0.FUTURE_amd64.txz
service emby-server start

Optional

  • Change the User and Group of emby-server to have no file ownership issues (here e.g. needs to be UID=GID=1101)
iocage console emby-server-beta
service emby-server stop
pw groupmod emby -n emby -g 1101
pw usermod emby -n emby -u 1101 -g 1101
chown -R emby:emby /var/db/emby(hit tab)
sysrc 'emby_server_user=emby'
service emby-server start

Video

 

Known Issues:

When mounting a folder to the jail via the freenas UI  folder creation fails, you have to create manually the mounting folders

  • Like 7
Link to post
Share on other sites

This is excellent news... I was trying to decide about moving emby off of freenas and run it on a vm ubuntu server but this sounds excellent and makes my life easier.. thank you for the hard work

Link to post
Share on other sites
adrianwi

I don't think this will work on FreeNAS at the minute, as even the 11.2 Beta is based on FreeBSD 11.1 so 11.2 won't run in an iocage jail.

 

It might if you edit the .json file and change the release to 11.1.

Link to post
Share on other sites
adrianwi

Using 11.2-RELEASE in the .json file?

 

From this thread, I was under the impression you couldn't run a version of FreeBSD newer than the one FreeNAS was using in an iocage jail.

 

Running FreeNAS over the last 12 months has been a challenge at times!  I managed to avoid the disaster that was 10/Corral, but switching from VirtualBox to bhyve and Warden to iocage hasn't been straightforward, and we're still not quite there.  

Link to post
Share on other sites
makarai

Actually, i was trying to get this up and running, but ran into a problem.

 

When i initially created the jail and installed emby, it would run fine. However, once the jail is stopped in Freenas i cannot start it again, it stops with the error message below.

[root@[member="freenas"] ~]# iocage list
+-----+-------------+-------+--------------+---------------+
| JID |    NAME     | STATE |   RELEASE    |      IP4      |
+=====+=============+=======+==============+===============+
| 20  | emby        | up    | 11.1-RELEASE | DHCP          |
+-----+-------------+-------+--------------+---------------+
| -   | emby-server | down  | 11.2-RELEASE | 192.168.0.110 |
+-----+-------------+-------+--------------+---------------+
[root@[member="freenas"] ~]# iocage start emby-server

Host: 11.1 is not greater than jail: 11.2
This is unsupported.
Link to post
Share on other sites
makarai

So the solution to my problem was just changing the release to 11.1

wget https://raw.githubusercontent.com/MediaBrowser/iocage-amd64/master/emby-server.json

#change freenas release to 11.1 (texteditor)

#to get proper vnet going
iocage fetch -P --name emby-server.json ip4_addr="vnet0|192.168.0.110/24" vnet="on" allow_raw_sockets="1" boot="on" defaultrouter="192.168.0.1"

#typical change in UID and GID so no issues with storage 
iocage console emby-server
service emby-server onestop
pw groupmod emby -n emby -g 1000
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
Edited by makarai
Link to post
Share on other sites
makarai

@@Luke whats the benefit for running this jail with 11.2 instead of 11.1 ?

Also all the freenas plugins are now based on 11.2, i guess, the freenas team will release a fix quite soon otherwise all the jails will stop when people reboot. 

Link to post
Share on other sites

Well the package is built based on the new procedures for 11.2, so take that into consideration. Other than that I'm not sure of any benefits.

Link to post
Share on other sites

Binaries and libraries in the package are built on freebsd 11.2, as long as there are no ABI differences between 11.1 and 11.2 it should be fine, but using 11.2 is the safer option.

Link to post
Share on other sites
makarai

Binaries and libraries in the package are built on freebsd 11.2, as long as there are no ABI differences between 11.1 and 11.2 it should be fine, but using 11.2 is the safer option.

 

 

I guess that's the way to go then.

Link to post
Share on other sites

Hi Luke!

 

Great job to porting this to iocage! I installed it (3.5.0.0) yestarday and all working great with Freenas 11.2. I follow the simple steps above.

 

Now, when I log to my dashboard, it say that there is a newer version available (3.5.1.0). What is the steps to update the emby server in iocage?

 

Thanks

Link to post
Share on other sites

Ah yes i hadn't updated the script yet for 3.5.1. I just did that.

 

So to update you'll basically just go through the install steps again. Thanks.

Link to post
Share on other sites
makarai

Ah yes i hadn't updated the script yet for 3.5.1. I just did that.

 

So to update you'll basically just go through the install steps again. Thanks.

 

you sure about that? 

 

i have tried it here are my findings

new emby-server.json will be downloaded, since its already on your drive it will be named emby-server.json.1

- when you run the fetch command it will take the emby-server.json (old) file and this will fail as emby-server iocage already exists.

- if you delete the old json, it will still fail with the same result.

- if you jump into the jail, and update you'll overwrite your existent installation. so that's no good either. 

Edited by makarai
Link to post
Share on other sites

Don't you mean stop and start instead of onestop and onestart? The service is enabled and started in post_install.sh when the jail is created. Other than that I don't know how iocage reacts when you try to install a jail with the same name but it's likely to fail as you said.

 

Upgrading should be done via a shell indeed, and pkg upgrade should also be called once in a while. I'll try to keep our freebsd updated and always build against the latest packages.

Link to post
Share on other sites

Hi Luke,

 

I have the same result than Makarai.

 

Not talking about the rename (1) of the json file but the error when doing the fetch. Also, I compared the content of my previous json file with the newer and they are exactly the same. Is it normal?

 

Here here what I got during the fetch command:

 

[root@freenas][~]# iocage fetch -P --name emby-server.json ip4_addr="re0|192.168.11.55"
Plugin: emby-server
  Official Plugin: False
  Using RELEASE: 11.1-RELEASE
  These pkgs will be installed:
    - lang/mono
    - multimedia/libass
    - x11-fonts/fontconfig
    - print/freetype2
    - converters/fribidi
    - security/gnutls
    - converters/iconv
    - audio/opus
    - net/samba48
    - databases/sqlite3
    - multimedia/libtheora
    - multimedia/libva
    - audio/libvorbis
    - graphics/webp
    - multimedia/libx264
    - devel/libzvbi
Traceback (most recent call last):
  File "/usr/local/bin/iocage", line 10, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/iocage/cli/fetch.py", line 136, in cli
    ioc.IOCage(exit_on_error=True).fetch(**kwargs)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/iocage.py", line 917, in fetch
    ).fetch_plugin(name, props, 0, accept)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_plugin.py", line 122, in fetch_plugin
    props, jail_name)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_plugin.py", line 303, in __fetch_plugin_create__
    exit_on_error=self.exit_on_error).create_jail()
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_create.py", line 87, in create_jail
    return self._create_jail(jail_uuid, location)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_create.py", line 103, in _create_jail
    raise RuntimeError(f"Jail: {jail_uuid} already exists!")
RuntimeError: Jail: emby-server already exists!
 
Thanks
Link to post
Share on other sites

@@eraser8 As makarai said, you need to open a shell in the jail and use the regular freebsd upgrade instructions.

pkg add -f https://github.com/MediaBrowser/Emby.Releases/releases/download/3.5.1.0/emby-server-freebsd_3.5.1.0_amd64.txz
service emby-server restart
Link to post
Share on other sites

@@alucryd

 

Thanks for your answer. Are you sure about that? Did you already try it? I tried it, it works, but I loose all my emby config/libraries..... Just like a brand new emby install.

Hopefully, I just did a iocage extract before trying your solution......

Link to post
Share on other sites

doing this

 

"iocage fetch -P --name emby-server.json ip4_addr="vtnet0|192.168.122.3""

 

gave me subnet mask of 255.255.255.255 and i couldnt access the emby server

 

according to this 

 

https://www.freebsd.org/cgi/man.cgi?query=iocage&sektion=8

 

the format should be 

 

ip4_addr="interface|ip-address/netmask"

 

i went ahead and used this

 

"iocage fetch ---name emby-server.json ip4_addr="vtnet0|192.168.122.3/24""

 

and everything worked.

 

obviously i changed th vtnet0 and the ip to my own stuff but just thought you should know

  • Like 1
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...