Step by step to install Plex & Transmission inside iocage Jail in FreeNAS 11.2-BETA3

TheOneWithin

Cadet
Joined
Sep 18, 2019
Messages
6
THANK YOU.

Your list of commands had the one i need to fix where transmission kept overwriting where it was downloading to.

CHEERS
Yes i created an account purely for this single post and you will never see me again.
 

plsharevme

Cadet
Joined
Aug 17, 2017
Messages
2
sorry newbie here only successful install transmission on freenas 9.2.................now is 11.2 very confuse

when i run this

# iocage fstab -a Media ”/mnt/tank/FTP” “/mnt/FTP” nullfs rw 0 0

Destination: /mnt/tank/iocage/jails/Media/root“/mnt/FTP” does not exist or is not a directory.

i have make a dataset under storage - pool - tank - FTP

sorry noobs question.
 
Joined
Oct 18, 2018
Messages
969
Just writing to thank you for this post. I wanted to install transmission only on 11.2-U7 and followed your guide. It worked amazingly well.
 

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
Glad to hear this.
I'm working on a script that automates installing all these.

I hope i'll finish by the end of the week.
 
Joined
Oct 18, 2018
Messages
969
Ah, very cool. I haven't done plex yet, but plan to get to that shortly. I always appreciate when folks take the time to distill their hard-earned knowledge for others' benefit. Excited to see the script.
 

Marcelofs1

Dabbler
Joined
Jul 17, 2015
Messages
24
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).
0.3 - 2019.05.23 - make default transmission download dir configuration permanent (thanks to @itskando).
0.2 - 2018.10.17 - adjusted fstab -a command so it can accepts path with spaces.
0.1 - 2018.10.16 - First release.
Note: I use ftp group because my media folder is also accessible via FTP.
Legend:
  1. Green text - should remain like it is
  2. Blue text - you may change it if you like
  3. Red text - needs to be changed by you
Requirements:
  1. FreeNAS 11.2-BETA3 ( may work with other versions either )
  2. FreeNAS User with ssh access and sudo
  3. SSH Client ( Putty for Windows and Terminal for MAC )
  4. Admin access to the router where FreeNAS exists
  5. Please follow this step by step tutorial before ask for help
Relevant data to use later in this tutorial ( use your own, this is just for reference )
  1. Home Network: 192.168.1.0/24 ( LAN where is your FreeNAS )
  2. Warden Jail (old one): MediaJail
  3. iocage Jail (new one): Media
3,2,1.. START
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

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

Saying THANK YOU is not enough. I really appreciate your kindness on sharing such information. I got some hicups on the process and all of them were caused due my lack of attention :). Great guide.
Once again, thank you
Marcelo
 

Paolo177

Dabbler
Joined
Apr 15, 2020
Messages
15
Hi!
I'm new here and also to linux systems but despite trying my best I can't understand why I'm not able to do this command:

Code:
# iocage fstab -a Media ”/mnt/Vol1-Z2/FTP” “/mnt/FTP” nullfs rw 0 0


It returns this error:

Code:
Destination: /mnt/main/iocage/jails/Media/root“/mnt/FTP” does not exist or is not a directory.
Source: ”/mnt/Vol1-Z2/FTP” does not exist!
Source: ”/mnt/Vol1-Z2/FTP” must use an absolute path!


I used personal path, the first path exist and is absolute, I mean I can do "# cd my_path"

I don't know if I can give you more information.

Thank you all in advance!
 

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
”/mnt/Vol1-Z2/FTP”
Vol1-Z2 - is my pool name, use yours
FTP - is also a folder created by my on my server ...
 

Paolo177

Dabbler
Joined
Apr 15, 2020
Messages
15
Maybe I wasn't clear, I used a path of my own

/mnt/my_pool/my_folder

it exists and I can do:

cd /mnt/my_pool/my_folder

I can't do it for the second path but for what I understood the second one is the new mapped route inside the Media iocage, isn't it?

So for what I understood it doesn't have to exist on the server.

And if I am wrong what is the meaning of putting there 2 folder path?
 

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
yes, the folder should exist inside jail so you can link them... the outside and the inside location.

i personally linked my FTP folder with transmission download folder and Plex folder so i can share with my family what i have on Plex and if they send me a clip via FTP from vacation or some event, i can play it with Plex without the need of moving them :)

You don;t need to do that, it's just my personal preference
 

Paolo177

Dabbler
Joined
Apr 15, 2020
Messages
15
Great, at least I understood what should happen but why doesn't this work then?

iocage fstab -a Media ”/mnt/my_pool/my_folder” “/mnt/my_fantasy_folder” nullfs rw 0 0

returns:

Destination: ”/mnt/main/iocage/jails/Media/root“/mnt/my_fantasy_folder” does not exist or is not a directory.
Source: ”/mnt/my_pool/my_folder” does not exist!
Source: ”/mnt/my_pool/my_folder” must use an absolute path!

is it beacuse my_fantasy_folder doesn't exist? If yes how am I supposed to create it inside a jail from outside?
 

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
well, it doesn't matter from where you create it as long as you link them (you can use web interface if you like) and most important if you want to share it between those apps you should asign proper permissions so all of them can read/write. You should group and give permission to group. I remember i wrote all details.
 

Paolo177

Dabbler
Joined
Apr 15, 2020
Messages
15
You remember correctly, you wrote everything about group/user permissions, but the command I'm telling yopu right now is just the fourth one, many commands before you talk about group permissions. An I'm in root user while executing the command that doesn't work.

Maybe I should run your commands in a different order?
 

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
Try this:

mkdir /mnt/my_pool/iocage/jails/Media/root/mnt/my_folder
iocage fstab -a Media ”/mnt/my_pool/my_folder” “/mnt/my_pool/iocage/jails/Media/root/mnt/my_folder” nullfs rw 0 0
 

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
Or you can use MOUNT POINTS fro interface (i think you can also create folder on the same step)
Is the same thing.

Screenshot 2020-04-16 at 17.06.38.png
 

Paolo177

Dabbler
Joined
Apr 15, 2020
Messages
15
Done, doesn't work :(

iocage fstab -a Media ”/mnt/my_FIRST_pool/my_FIRST_folder” “/mnt/my_SECOND_pool/iocage/jails/Media/root/mnt/my_SECOND_folder” nullfs rw 0 0

returns again:

Destination: /mnt/main/iocage/jails/Media/root“/mnt/my_SECOND_pool/iocage/jails/Media/root/mnt/my_SECOND_folder” does not exist or is not a directory. Source: ”/mnt/my_FIRST_pool/my_FIRST_folder” does not exist! Source: ”/mnt/my_FIRST_pool/my_FIRST_folder” must use an absolute path!

does it matter that they are in 2 different pools?
does it matter that both my_FIRST_folder and my_SECOND_folder are named "media"?

To be clear:

cd /mnt/my_FIRST_pool/my_FIRST_folder cd /mnt/my_SECOND_pool/iocage/jails/Media/root/mnt/my_SECOND_folder

ARE WORKING...

I'm really sorry to bother you, thank you for you time though, much appreciated :).
 

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
hmm, seems like it doubles the prefix of the path if you carefully read the error so adjust it

iocage fstab -a Media ”/mnt/my_FIRST_pool/my_FIRST_folder” “/mnt/my_SECOND_folder” nullfs rw 0 0

this looks like in the tutorial :)
# iocage fstab -a Media ”/mnt/Vol1-Z2/FTP” “/mnt/FTP” nullfs rw 0 0
 

Paolo177

Dabbler
Joined
Apr 15, 2020
Messages
15
Nope, I repeated it again but doesn't work.
now I start thinking that maybe some of my name substitution is causing you to understand less maybe?
so what I called:

my_FIRST_folder is "media"
my_SECOND_folder is "media"
my_FIRST_pool is "Secondario"
my_SECOND_pool is "main"

1587048126690.png
 

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
your quote sign are strange, italics. Try to replace them or even not to use them as they are usefull in case of white spacing in path

iocage fstab -a Media /mnt/Secondario/media /mnt/media nullfs rw 0 0
 
Top