Bibi40k
Contributor
- Joined
- Jan 26, 2018
- Messages
- 136
Hi,
i decided to add a new tutorial to help us all create and maintain an Iocage Media Jail with Plex & Transmission.
I personally use VPN all the time, even to connect to my Plex server so i also recommend to you my first tutorial Step by step to install OpenVPN inside a Jail in FreeNAS 11.1-U1.
Please report inconsistency.
change-log: 0.3 - 2019.05.23 - make default transmission download dir configuration permanent (thanks to @itskando).
Note: I use ftp group because my media folder is also accessible via FTP.
Legend:
First, we become root
Then, we check UID and GID of media and ftp users (they are always the same, but i want to be as verbose as i can)
We're ready to create our new Iocage Media Jail and map our existing Media folder inside.
Now that the Jail is up and running, we go inside, update everything and install what we need.
We create the media user and add it to the ftp group.
We configure Plex.
...and Transmission.
Edit Transmission settings & make default download dir permanent.
We stop both Old and New Jails and sync Plex Database.
i decided to add a new tutorial to help us all create and maintain an Iocage Media Jail with Plex & Transmission.
I personally use VPN all the time, even to connect to my Plex server so i also recommend to you my first tutorial Step by step to install OpenVPN inside a Jail in FreeNAS 11.1-U1.
Please report inconsistency.
change-log: 0.3 - 2019.05.23 - make default transmission download dir configuration permanent (thanks to @itskando).
0.3 - 2019.05.23 - make default transmission download dir configuration permanent (thanks to @itskando).
0.2 - 2018.10.17 - adjusted
0.1 - 2018.10.16 - First release.
0.2 - 2018.10.17 - adjusted
fstab -a
command so it can accepts path with spaces.0.1 - 2018.10.16 - First release.
Legend:
- Green text - should remain like it is
- Blue text - you may change it if you like
- Red text - needs to be changed by you
- FreeNAS 11.2-BETA3 ( may work with other versions either )
- FreeNAS User with ssh access and sudo
- SSH Client ( Putty for Windows and Terminal for MAC )
- Admin access to the router where FreeNAS exists
- Please follow this step by step tutorial before ask for help
- Home Network: 192.168.1.0/24 ( LAN where is your FreeNAS )
- Warden Jail (old one): MediaJail
- Iocage Jail (new one): Media
First, we become root
Code:
% sudo -i
Password:
Warning: settings changed through the CLI are not written to
the configuration database and will be reset on reboot.
Then, we check UID and GID of media and ftp users (they are always the same, but i want to be as verbose as i can)
Code:
# getent passwd | cut -d':' -f1,3-4 | grep -E 'media|ftp'
ftp:14:14
media:8675309:8675309
We're ready to create our new Iocage Media Jail and map our existing Media folder inside.
Code:
# iocage create -n "Media" -r 11.2-RELEASE vnet="on" ip4_addr="vnet0|192.168.1.55/24" defaultrouter="192.168.1.1" boot="on"
Media successfully created! * Starting Media + Started OK + Configuring VNET OK + Starting services OK# iocage fstab -a Media "/mnt/Vol1-Z2/FTP" "/mnt/FTP" nullfs rw 0 0
Successfully added mount to Media's fstab
Now that the Jail is up and running, we go inside, update everything and install what we need.
Code:
# iocage console Media
... Show the version of FreeBSD installed: freebsd-version ; uname -a Please include that output and any error messages when posting questions. Introduction to manual pages: man man FreeBSD directory layout: man hier Edit /etc/motd to change this login announcement.# env ASSUME_ALWAYS_YES=YES pkg bootstrap
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly, please wait... Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done [Media] Installing pkg-1.10.5_3... [Media] Extracting pkg-1.10.5_3: 100%# pkg update
... Processing entries: 100% FreeBSD repository update completed. 32565 packages processed. All repositories are up to date.# pkg upgrade -y
... Checking integrity... done (0 conflicting) Your packages are up to date.# pkg install -y nano wget plexmediaserver transmission
... Once started, visit the following to configure: http://localhost:32400/web * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
We create the media user and add it to the ftp group.
Code:
# getent group | cut -d':' -f1,3-4 | grep -E 'media|ftp'
ftp:14# pw useradd -n media -w none -u 8675309 -G ftp -c "Media User"
# getent group | cut -d':' -f1,3-4 | grep -E 'media|ftp'
ftp:14:media media:8675309# id media
uid=8675309(media) gid=8675309(media) groups=8675309(media),14(ftp)
We configure Plex.
Code:
# cd /usr/local && mkdir plexdata
# chown -R media:ftp plexdata
# sysrc plexmediaserver_enable=YES
plexmediaserver_enable: -> YES# sysrc plexmediaserver_user=media
plexmediaserver_user: -> media# sysrc plexmediaserver_group=ftp
plexmediaserver_group: -> ftp# service plexmediaserver start
Starting plexmediaserver.# cd /usr/local/plexdata/Plex\ Media\ Server/Plug-ins
# wget https://github.com/ukdtom/WebTools.bundle/releases/download/3.0.0/WebTools.bundle.zip
... 2018-10-16 21:21:22 (401 KB/s) - 'WebTools.bundle.zip' saved [5899909/5899909]# unzip WebTools.bundle.zip
... creating: WebTools.bundle/http/static/logs/Directive/logFileDisplay/ extracting: WebTools.bundle/http/static/logs/Directive/logFileDisplay/logFileDisplay.js# rm WebTools.bundle.zip
# chown -R media:ftp WebTools.bundle
# service plexmediaserver restart
...and Transmission.
Code:
# cd /usr/local/etc
# chown -R media:ftp transmission
# sysrc transmission_enable=YES
transmission_enable: -> YES# sysrc transmission_user=media
transmission_user: -> media# sysrc transmission_group=ftp
transmission_group: -> ftp# service transmission start
Starting transmission.
Edit Transmission settings & make default download dir permanent.
Code:
# service transmission stop
# nano transmission/home/settings.json
"rpc-whitelist-enabled": false,
"umask": 7,
Code:
# sysrc transmission_download_dir="/mnt/FTP/zDOWNLOADSz"
# service transmission start
# exit
logout
We stop both Old and New Jails and sync Plex Database.
Code:
# warden stop MediaJail
Stoppingthejail....192.168.1.52 (192.168.1.52) deleted Unmounting user-supplied file-systems Stopping jail with: /etc/rc.shutdown# iocage stop Media
* Stopping Media + Running prestop OK + Stopping services OK + Tearing down VNET OK + Removing jail process OK + Running poststop OK# cp -av /mnt/Vol1-Z2/jails/MediaJail/usr/local/plexdata/Plex\ Media\ Server/ /mnt/iocage/jails/Media/root/usr/local/plexdata/Plex\ Media\ Server/
# iocage start Media
Last edited: