docs
  • README
  • John's Notes and Documentation
    • Linux
      • Distributions
        • Arch Linux
          • Common Applications
          • Setting up pacaur with the Arch User Repository
          • Bluetooth
          • Hibernate
          • Graphical Configuration
          • libvirt
          • Post Install Tasks
            • Time
            • Reflector
            • SMTP
            • ZFS Configuration
            • smart
            • nfs
            • Package Management
              • aurutils
            • Programming Languages
              • nodejs
              • ruby
            • Restore Installed Applications
            • User Configuration Management
            • User Namespaces
            • Gaming with Wine
            • ZFS Dataset Structure
            • Raspberry PI Secure VPN Torrentbox
        • NixOS
          • Remotely Accessing Install Media
          • root on ZFS Install
      • systemd
        • Network Bonding
      • Tuning
        • CPU Tuning
        • Limits
        • Sysctls
        • Network Reliability With iwlwifi
        • Surface Pro 4 Power Tuning
        • ZFS Arc Max on Linux
      • TrueNAS
        • Setup
  • BSD
    • FreeBSD
      • iocage
      • Poudriere in a bhyve VM
    • FreeNAS
      • Copy SSH Keys off FreeNAS
      • FreeNAS Service jails
      • iocage Service jails
        • Couchpotato jail
        • Deluge jail
        • Emby jail
        • Poudriere WebUI jail
        • Podcatcher jail
        • Sabnzbd jail
        • Sickrage jail
        • Syncthing jail
        • Duplicity jail
        • Lets Encrypt jail
      • Wrong Version jail
    • pfSense
      • Sending Specific Traffic Through OpenVPN
  • Desktop and Userspace
    • Gaming
      • Grim Dawn
      • Path of Exile
    • Internet
      • Re-authenticate IRC Nickname
      • Lightdm VNC Connection with Password
    • Media
      • Convert Audio to Video
      • Convert Text to Speech
  • System Administration
    • Security
      • GPG Subkeys
    • Shell Scripting
      • dd
      • find
      • rsync
      • vim
    • ZFS
      • Mirrors
  • Certifications
    • CKA
      • Core-Concepts
      • Scheduling
      • Logging
      • Application Lifecycle Management
      • Cluster Maintenance
      • Security
      • Storage
      • Networking
      • Install Kubernetes with kubeadm
      • JSON PATH
Powered by GitBook
On this page
  • On FreeNAS
  • Jail
  • Package Options
  • Emby Start Options
  1. BSD
  2. FreeNAS
  3. iocage Service jails

Emby jail

Setup for Emby service jail with iocage.

On FreeNAS

Create jail:

iocage create --release 11.2-RELEASE --name emby \
          boot=on vnet=on dhcp=on bpf=yes \
          allow_raw_sockets="1" \
          ip4_addr="vnet1|172.20.40.21/24" \
          interfaces="vnet1:bridge1" \
          defaultrouter="172.20.40.1" \
          resolver="search ramsden.network;nameserver 172.20.40.1;nameserver 8.8.8.8"

On Freenas create datasets:

  • Datasets

    • Emby Data

      • tank/data/database/emby/emby-server

      • tank/data/database/emby/media-metadata

    • Media

      • For all media tank/media/Series/...

Create media user/group using uid from freenas:

iocage exec emby 'pw useradd -n media -u 8675309'

Nullfs mount datasets in jail:

Emby data:

iocage exec emby 'mkdir -p /var/db/emby-server /mnt/emby/media-metadata'
iocage exec emby 'chown media:media /var/db/emby-server'
iocage exec emby 'chown media:media /mnt/emby/media-metadata'
iocage fstab --add emby '/mnt/tank/data/database/emby/emby-server /var/db/emby-server nullfs rw 0 0'
iocage fstab --add emby '/mnt/tank/data/database/emby/media-metadata /mnt/emby/media-metadata nullfs rw 0 0'

Setup directories:

iocage exec emby 'mkdir -p /media/Series/Series /media/Series/Lectures /media/Series/Documentary /media/Series/Anime /media/Series/Animated /media/Series/Podcasts/Audio /media/Series/Podcasts/Video /media/Naddy /media/Movie/Movies /media/Movie/Sports /mnt/backups'
iocage exec emby 'chown -R media:media /media && chown -R media:media /mnt/backups'

Repeat for media:

iocage fstab --add emby '/mnt/tank/media/Series/Series /media/Series/Series nullfs rw 0 0'
iocage fstab --add emby '/mnt/tank/media/Series/Podcasts/Audio /media/Series/Podcasts/Audio nullfs rw 0 0'
iocage fstab --add emby '/mnt/tank/media/Series/Podcasts/Video /media/Series/Podcasts/Video nullfs rw 0 0'
iocage fstab --add emby '/mnt/tank/media/Series/Lectures /media/Series/Lectures nullfs rw 0 0'
iocage fstab --add emby '/mnt/tank/media/Series/Documentary /media/Series/Documentary nullfs rw 0 0'
iocage fstab --add emby '/mnt/tank/media/Series/Anime /media/Series/Anime nullfs rw 0 0'
iocage fstab --add emby '/mnt/tank/media/Series/Animated /media/Series/Animated nullfs rw 0 0'
iocage fstab --add emby '/mnt/tank/media/Naddy /media/Naddy nullfs rw 0 0'
iocage fstab --add emby '/mnt/tank/backups/Lilan/Emby /mnt/backups nullfs rw 0 0'
iocage fstab --add emby '/mnt/tank/media/Movie/Movies /media/Movie/Movies nullfs rw 0 0'
iocage fstab --add emby '/mnt/tank/media/Movie/Sports /media/Movie/Sports nullfs rw 0 0'

Check fstab:

iocage fstab --list emby

Start jail and enter.

iocage start emby
iocage console emby

Jail

In the jail, update all packages and install emby-server.

pkg update && pkg upgrade && pkg install emby-server

Package Options

Its reccomended to change some package options. Either build a package with poudriere with these changes, or make these changes on the emby jails packages.

FFMpeg

It's recommended to install ffmpeg from ports so that certain compile time options can be enabled.

Update the FreeBSD ports tree

portsnap fetch extract update

Remove the default ffmpeg package

pkg delete -f ffmpeg

Reinstall FFMpeg from ports with lame option enabled

cd /usr/ports/multimedia/ffmpeg && make config
  • enable the lame option

  • enable the ass subtitles option

  • enable the opus subtitles option

  • enable the x265 subtitles option

Compile and install.

make install clean

ImageMagick

It is recommended to recompile the graphics/ImageMagick package from ports with the following options .

  • disable (unset) 16BIT_PIXEL (to increase thumbnail generation performance)

Delete the imagemagick pkg.

pkg delete -f imagemagick

Install from ports

cd /usr/ports/graphics/ImageMagick && make config
  • Disable the 16BIT_PIXEL option

make install clean

Emby Start Options

Set the rc script executable.

chmod 555 /usr/local/etc/rc.d/emby-server

Check the options.

less /usr/local/etc/rc.d/emby-server

Set emby to start on boot and change the options based on setup.

sysrc 'emby_server_enable=YES'
sysrc 'emby_server_user=media' && sysrc 'emby_server_group=media'
sysrc 'emby_server_data_dir=/var/db/emby-server'

Start the emby service.

service emby-server start
PreviousDeluge jailNextPoudriere WebUI jail

Last updated 5 months ago