jmcguire525
Explorer
- Joined
- Oct 10, 2017
- Messages
- 94
I've been reading freenas and iocage documentation along with a few guides and resources in an attempt to create my jails through the cli. I have a few questions and just want to make sure I'm understanding the process rather than just blindly following a guide... I'll use Plex as an example here.
I have 2 volumes, a RaidZ2 named "storage" and an ssd named "jails". I created a new user and group that I'll refer to as "user" and "admin". The main storage dataset and jails dataset retain the default permissions, as do the datasets within "jails" (iocage and the jails within are still set to "root" and "wheel"). I have 3 datasets within the main storage dataset named "media", "dvr", and "apps"... all of these have permissions changed to user=user group=admin. the "apps" dataset has datasets within it corresponding to each jail name (plex, sonarr, radarr, ect) with their permissions changed as well.
I fetched iocage into the main "jails" dataset and let it do its thing and left permissions alone. I set a few tunables to make vnet function properly with bridge0 addm em0, and then began installing plex. Here are my steps with comments of what I understand to be taking place, please correct me if I'm misunderstanding anything as that should help me understand more going forward and creating the rest of my jails.
I assume this just fetches the resources needed for plex installion
Creates a jail named "plex" with a virtual interface at the given ip address and enables the jail to start on boot
Removes temporary install files
Stores the jail configuration in the specified "plex" dataset. Is this the best practice to have it in a dataset within the main RiadZ2 volume or should I have it placed in a new dataset in the ssd "jails" volume?
Gives the plex jail permission to access my files stored in the "media" dataset by mounting it within the jail. If I want to add Movies to a plex library that are stored in /mnt/storage/media/movies I would do so by going into plex and adding /mnt/media/movies.
Lost on this one, I'm changing ownership of the plex jail from user=plex to user=plex??
Telling iocage to start the plex media server on boot
Telling iocage to load the Plex configuration that is located at "/mnt/storage/apps/plex" and was previously mounted to the jail at "/config"
Starting plex media server for the first time with the given configuration
I have 2 volumes, a RaidZ2 named "storage" and an ssd named "jails". I created a new user and group that I'll refer to as "user" and "admin". The main storage dataset and jails dataset retain the default permissions, as do the datasets within "jails" (iocage and the jails within are still set to "root" and "wheel"). I have 3 datasets within the main storage dataset named "media", "dvr", and "apps"... all of these have permissions changed to user=user group=admin. the "apps" dataset has datasets within it corresponding to each jail name (plex, sonarr, radarr, ect) with their permissions changed as well.
I fetched iocage into the main "jails" dataset and let it do its thing and left permissions alone. I set a few tunables to make vnet function properly with bridge0 addm em0, and then began installing plex. Here are my steps with comments of what I understand to be taking place, please correct me if I'm misunderstanding anything as that should help me understand more going forward and creating the rest of my jails.
Code:
echo '{"pkgs":["plexmediaserver-plexpass","ca_root_nss"]}' > /tmp/pkg.json
I assume this just fetches the resources needed for plex installion
Code:
iocage create -n "plex" -p /tmp/pkg.json -r 11.1-RELEASE ip4_addr="vnet0|<IP>/<MASK>" defaultrouter="<GATEWAY>" vnet="on" allow_raw_sockets="1" boot="on"
Creates a jail named "plex" with a virtual interface at the given ip address and enables the jail to start on boot
Code:
rm /tmp/pkg.json
Removes temporary install files
Code:
iocage fstab -a plex /mnt/storage/apps/plex /config nullfs rw 0 0
Stores the jail configuration in the specified "plex" dataset. Is this the best practice to have it in a dataset within the main RiadZ2 volume or should I have it placed in a new dataset in the ssd "jails" volume?
Code:
iocage fstab -a plex /mnt/storage/media /mnt/media nullfs ro 0 0
Gives the plex jail permission to access my files stored in the "media" dataset by mounting it within the jail. If I want to add Movies to a plex library that are stored in /mnt/storage/media/movies I would do so by going into plex and adding /mnt/media/movies.
Code:
iocage exec plex chown -R plex:plex /config
Lost on this one, I'm changing ownership of the plex jail from user=plex to user=plex??
Code:
iocage exec plex sysrc "plexmediaserver_enable=YES"
Telling iocage to start the plex media server on boot
Code:
iocage exec plex sysrc plexmediaserver_support_path="/config"
Telling iocage to load the Plex configuration that is located at "/mnt/storage/apps/plex" and was previously mounted to the jail at "/config"
Code:
iocage exec plex service plexmediaserver start
Starting plex media server for the first time with the given configuration