Specifically I changed my train from 11.1-U6.3 to 11.2-RELEASE-U1, and although my plex and transmission jails were still working in the old no longer supported warden jails, i decided to try to get them working in the new iocage jails. I was able to get all this working the way I used to have it, grabbing from 10 or so different posts and bugcheck tickets, so i figured as a service i'd share my notes if anyone else finds value out of it. I built a plex pass server using the default 11.2 plugin , and same for the transmission plugin. The goal for my transmission jail was to also have openvpn (i use private internet access, so this is for PIA specifically) and have the firewall stop transmission in case the vpn dies or stops for some reason, and to later rename and move files to where I want them for plex. If you don't know how to use vi, substitute ee or nano for your editor in any of the commands below.
Plex migration
FreeNAS 11.2 GUI, click to install plex plugin
once installed, stop the new plex plugin and also stop the old one (you will need to go into the legacy web interface to turn it off if not using CLI)
Then I copied the old plex's jail contents to the new iocage plex jail structure, run this from the freenas OS main shell, in the left column of the new gui:
After that, make sure to add the storage mounts the same as you had setup in the old system or it won't find the media when you try to click on the movies/music (storage add for the jail is under the 3 dots under the new jail page).
I actually started the new plex plugin and went back into the web interface for plex and edited the media locations to double check how i had named the folders for them, then just stop the plex plugin and add those storage mounts, start it up again, and it should work normal with all your cached thumbnails/view or unviewed/ downloaded posters etc. Haven't notice any bugs with it yet, just made sure to use the same IP in dhcp on the router so that i could pass through the DMZ for remote sharing.
Transmission jail
FreeNAS 11.2 GUI, click to install the transmission plugin
FreeNAS OS shell:
reboot the freenas, after reboot open the Transmission Jail shell, which is under the 3 dots in the jail page
modify repo so that we can install normal freebsd packages:
replace the no with yes, save and quit.
change settings and add startups:
Add into the file:
Also you may want to change your transmissions default download directory, it also seems to be hardcoded in this file at the top.
Save and quit.
Run these to install and setup openvpn, i'm using private internet access so it uses their config, i'm also in texas so i'm using the "US Texas" file, use what you like.
Create the password file, the first line is your username, the second line is your password, save the file
change the line so that it uses your pass.txt, should look like below:
(should show your IP)
(should show your VPN IP)
(should show a tun0 interface, which is the vpn tunnel)
Type the below into the file and save it, change the 192.168.1.0/24 to whatever your personal network is setup as:
Then start the firewall:
test the firewall by running a large torrent file (I used ubuntu torrent), and stopping the openvpn service mid download.
If the firewall is working, the download should stop downloading. Once it does, start openvpn again and it should resume download.
For the video renaming/moving i'm using the tvnamer project inside the transmission jail:
https://github.com/dbr/tvnamer
I installed with
then just run it with
I personally use recursive batch mode and give it a destination folder to move them, then i run it from crontab every 5 minutes to just pickup whatever comes along.
There's tons of different options, so look through their documentation.
That's all folks!
Plex migration
FreeNAS 11.2 GUI, click to install plex plugin
once installed, stop the new plex plugin and also stop the old one (you will need to go into the legacy web interface to turn it off if not using CLI)
Then I copied the old plex's jail contents to the new iocage plex jail structure, run this from the freenas OS main shell, in the left column of the new gui:
cp -Ripv -f /mnt/pool_1/jails/plexmediaserver_1/var/db/plexdata/Plex\ Media\ Server/ /mnt/pool_1/iocage/jails/plex/root/Plex\ Media\ Server/
After that, make sure to add the storage mounts the same as you had setup in the old system or it won't find the media when you try to click on the movies/music (storage add for the jail is under the 3 dots under the new jail page).
I actually started the new plex plugin and went back into the web interface for plex and edited the media locations to double check how i had named the folders for them, then just stop the plex plugin and add those storage mounts, start it up again, and it should work normal with all your cached thumbnails/view or unviewed/ downloaded posters etc. Haven't notice any bugs with it yet, just made sure to use the same IP in dhcp on the router so that i could pass through the DMZ for remote sharing.
Transmission jail
FreeNAS 11.2 GUI, click to install the transmission plugin
FreeNAS OS shell:
iocage stop transmission
iocage set allow_tun=1 transmission
reboot the freenas, after reboot open the Transmission Jail shell, which is under the 3 dots in the jail page
modify repo so that we can install normal freebsd packages:
vi /usr/local/etc/pkg/repos/FreeBSD.conf
replace the no with yes, save and quit.
pkg update
pkg upgrade
pkg install bash openvpn unzip curl wget
change settings and add startups:
vi /etc/rc.conf
Add into the file:
openvpn_enable="YES"
openvpn_configfile="/usr/local/etc/openvpn/openvpn.conf"
firewall_enable="YES"
firewall_script="/etc/ipfw.rules"
Also you may want to change your transmissions default download directory, it also seems to be hardcoded in this file at the top.
Save and quit.
Run these to install and setup openvpn, i'm using private internet access so it uses their config, i'm also in texas so i'm using the "US Texas" file, use what you like.
mkdir /usr/local/etc/openvpn
cd /usr/local/etc/openvpn/
wget https://www.privateinternetaccess.com/openvpn/openvpn.zip --no-check-certificate
mkdir PIA
unzip openvpn.zip -d PIA/
cd PIA/
cp US\ Texas.ovpn ..
cd ..
mv US\ Texas.ovpn openvpn.conf
Create the password file, the first line is your username, the second line is your password, save the file
vi pass.txt
vi openvpn.conf
change the line so that it uses your pass.txt, should look like below:
auth-user-pass /usr/local/etc/openvpn/pass.txt
wget http://ipinfo.io/ip -qO -
(should show your IP)
service openvpn start
wget http://ipinfo.io/ip -qO -
(should show your VPN IP)
ifconfig
(should show a tun0 interface, which is the vpn tunnel)
vi /etc/ipfw.rules
Type the below into the file and save it, change the 192.168.1.0/24 to whatever your personal network is setup as:
#!/bin/bash
ipfw -q -f flush
cmd="ipfw -q add"
vpn="tun0"
$cmd 00001 allow all from any to any via lo0
$cmd 00010 allow all from any to any via $vpn
$cmd 00101 allow all from me to 192.168.1.0/24 uid transmission
$cmd 00102 allow all from 192.168.1.0/24 to me uid transmission
$cmd 00103 deny all from any to any uid transmission
Then start the firewall:
service ipfw start
ipfw list
(make sure its listing the rules typed above)test the firewall by running a large torrent file (I used ubuntu torrent), and stopping the openvpn service mid download.
If the firewall is working, the download should stop downloading. Once it does, start openvpn again and it should resume download.
service openvpn stop
service openvpn start
For the video renaming/moving i'm using the tvnamer project inside the transmission jail:
https://github.com/dbr/tvnamer
I installed with
pkg install py27-tvnamer databases/py-sqlite3
then just run it with
tvnamer /path/to/file/whatever/name_of_file.mp4
I personally use recursive batch mode and give it a destination folder to move them, then i run it from crontab every 5 minutes to just pickup whatever comes along.
tvnamer -r -b /mnt/downloads/data -m --movedestination "/mnt/downloads/done"
There's tons of different options, so look through their documentation.
That's all folks!
Last edited: