Plex/Emby - DHCP Not Assigning Anything

Joined
Jul 9, 2021
Messages
2
Hey Folks. I have been scouring the web for the last 2 weeks or so trying to find a solution to my DHCP issue and i see stuff close to my issue, some is older info and I am not sure how applicable it is now. I just built my new server with the most recent TrueNAS build TrueNAS-12.0-U4, I have my pools setup, all my media and files are transferred over, things are working peachy and pretty seamless given that I've never used this OS before.

NAS Build:
Ryzen 5 5600x cpu
Asus Prime b550-Plus mobo
32 gig Crucial Ballistix 3200mhz ram
512 gig Crucial P2 NVME for the OS drive
6 WD Red Plus 8TB drives
Asus GeForce GT 710 CSM video card
(i think it's a pretty stout server for plex)

I have Ubiquiti networking hardware: USG security gateway for the router, cloud key controller, netgear unmanaged switch and 2 AP's,all my towers and server are hardwired so i can weed out wireless funk.

Long of the short, I can see my NAS in the router DHCP leases and ARP, all of my other network equipment, towers, laptops, watches, tablets, alexas, everything is being dealt IP's from the DHCP without issue, the NAS is setup to receive IP from DHCP yet something is stonewalling it. I tried to install the Plex plugin and i get the partial install and then the jail auto install when the package cannot complete installation and it fails due to the lack of "DHCP not running". I can however get it to install if i do the NAT install of the plugin but when the server plugin and jail both fail to boot up successfully once changed back to DHCP settings.

Today, I said to myself that i'd try to install the Emby plugin and again, same issue that I had with Plex which tells me that there is some funk with the plugins or that there is some setting lurking somewhere that is not configured correctly or missing.

I am happy to post screenshots for settings etc, I just don't know what is meaningful to you all at this point. Please be aware, my command line code skills are very weak with this albeit if you direct to me to do something, i can learn and do it, just be patient and explain it well because i've not done it before (thank you in advance).

I was also reading about virtual machines, never done it before but would this maybe be a more suitable or easier route to go to load plex up onto say a Linux distro and managed it that way?

NAS Build:
Ryzen 5 5600x cpu
Asus Prime b550-Plus mobo
32 gig Crucial Ballistix 3200mhz ram
Crucial P2 NVME for the OS drive
6 WD Red Plus 8TB drives
Asus GeForce GT 710 CSM video card
 
Joined
Jan 7, 2015
Messages
1,155
I will help you if you abandon the plugins altogether and just install these manually in a jail. I dont use the plugins ever, and am no help otherwise. Id also recommend setting your NAS and jails a static IP.

This will require you to be able to ssh to the server or otherwise know how to open a terminal session as the root user. The easiest to use and most widely available and free is "putty" seek it out and install it. It WILL come in handy in the future too so keep it installed. I will add that you can open terminals from the GUI you can do this at your own peril. Choose shell from the main GUI menu.

In the Web GUI and visit the System-->General section and at the bottom click "Save Config" keep it somewhere safer.

Next go to Storage-->Snapshots and create a RECURSIVE snapshot of each of your pools. Name it or them to PLEX something or another.

Next use the Web GUI and remove the not working plugins and jails.

In putty, type in the NAS' IP address and click open, a black screen opens and asks for your username (root) and password. Skip this if you are just opening a session from the GUI.

You should now be at a root command prompt. This is whats meant by "host CLI (command line interface)", "shell" and or "terminal".

All of these are commands that should be done one at a time and pressing enter after. If something returns an error message stop and post it here.

Ill explain a bit what each command is doing so you can learn a bit as you go.

We create a jail to work in, I have example IPs listed, you will most likely need to change something here--you need to specify an IP address outside of your DHCP range. For most routers these are the addresses up to .99 it doesnt really matter what it is but you want to know what it is so you can forward ports later on and know the right IP to visit for plex configuration etc..

You also need to specify the defaultrouter option which is just your router IP (usually) this is AKA "gateway" and is usually the .1 address on your network. You may also change the name and hostname but this will require you edit the below commands as you go. This command also assumes your subnet mask is 255.255.255.0 or /24, sets it to boot automatically, and sets the hostname to PLEX.
iocage create -n "plex" -r 12.2-RELEASE ip4_addr="vnet0|192.168.1.19/24" defaultrouter="192.168.1.1" boot="on" host_hostname="PLEX" vnet="on"

Now we enter our new jail.
iocage exec plex

Get the pkg system updated and ready to go, also checks for updated software. If it finds any (it wont) choose yes to upgrade.
pkg update && pkg upgrade

Now this is an optional step, but if you skip it, you will almost certainly run into permissions issues like the hundreds of other posts I see. You should create the "media" user in the jail and use it to run these softwares. This user is a built-in user in the TrueNAS host. It can be changed to a different user but each command will be different.
pw useradd -n media -u 8675309 -d /nonexistent -s /usr/sbin/nologin && pw groupmod -g 8675309 media && pw groupmod media -m media,plex,video

Then we install plex. There are two different packages for plex, one with plexpass and one without. So do the one that makes sense for you.
pkg install plexmediaserver
or
pkg install plexmediaserver-plexpass

Now lets configure plex to run as our newly created media user. If you installed the non_plexpass version simply leave out the "_plexpass"
sysrc plexmediaserver_plexpass_enable="YES"
sysrc plexmediaserver_plexpass_user="media"
sysrc plexmediaserver_plexpass_group="media"

We will do the exact same for emby installing the package first. I did all this as a test and for me over 100 additional packages were installed as dependencies for emby.
pkg install emby-server

We set emby to run as our media user
sysrc emby_server_enable="YES"
sysrc emby_server_user="media"
sysrc emby_server_group="media"

Now we start Plex and Emby
service plexmediaserver_plexpass start && service emby-server start

If all is good this far, Plex and Emby should now be running as user media, to verify this type
top and press enter, youll see each running process in the jail and what user is running said process there are about 4 that plex should be running as the media user. Emby runs as "mono-sgen". To exit top use the "Q" key.

Lastly you will create directories to mount your media to. Create one for each type of media you have (edit command).
cd /media
mkdir video audio pictures documents && chown -R media:media /media
##Everytime you see a command with the two && in it its essentially running two or more separate commands.

Now exit the jail CLI by typing exit and pressing enter.

You are back at the HOST CLI.

Now we want to stop the plex jail so we can set up your mounted media directories.
iocage stop plex

Now we can also further deal with any permissions issues that arise before they start! And also get your storages mounted to your jail.

In the GUI go to Storage-->Pools
Find your datasets that contain media and or other directories that plex/emby will need access. and click the three dots on the right...
Edit permissions (either standard or ACLs) and the end game here is to either allow the MEDIA user (8675309) and or MEDIA group (8675309) read/write/modify access or to outright own all of these pertinent datasets (root=you can always access). MAKE ABSOLUTELY SURE THESE ARE ONLY ACTUALLY MEDIA DATASETS YOU ARE CHANGING THE PERMISSIONS TO. If you change system datasets to be owned by media will cause breakage. Do this for each dataset containing your media.

Now thats fixed up we can mount these datasets to the jail.
In the Web GUI go to JAILS-->plex then click the little arrow on right and select MOUNT POINTS-->Action-->ADD
Select your source dataset, for instance /mnt/tank/video.
Select your destination, for instance /mnt/tank/iocage/jails/plex/root/media/video (one of the directories we created earlier as the HOST sees it).
Then Submit.
Repeat for each dataset you would like to mount so plex/emby can use it.

When done select ACTION-->.Back to jails Then start the plex jail. Once its started you can reach the GUI for plex at your chosen IP address, I used 19 in this example.

And emby

Do your configurations for these softwares at this time. Your media will be located in the /media directory according to the jail and chosen directories.

Lastly for remote access youll want to forward both port 32400 and 8096 to the chosen IP for your jail in your UniFi router.

It seems like alot, but in the long run youll be much better off. The plugins dont seem well maintained.
 
Joined
Jan 7, 2015
Messages
1,155
I forgot to add that if you have any other users you have created, simply join them to the "media" group.
 

todd821

Cadet
Joined
Jul 15, 2021
Messages
1
Hey Ian…I had the same problem and discovered that it was easily fixed. Just go into TrueNAS network setting and add manual DNS entries for your internal DNS server (if you have one) and external DNS servers like 8.8.8.8 for Google or 1.1.1.1 Cloudlfare and you local Gateway address. After that, my identical issue was resolved. Hope that helps!!
 
Top