Plex with networked media

Status
Not open for further replies.

FlamingPooh

Dabbler
Joined
May 14, 2015
Messages
10
hi, i'm setting up new freenas server, and i'm trying to use plex

I have it setup but i'm trying to point plex to use the media files on a different server, but i'm not 100% sure that that gets done.

I think that i need to mount the already networked storage (SMB share on a different device) into...either the jail or FreeNas itself and then point to it in the plex web.

I'm not 100% sure how that is done. if anyone can point me to the right direction, which commands i may want to try using, i would appreciate it.

edit.. TLDR thread:

Best practice seems to be mount Samba share in freenas shell, create a pre-init task with the mounting command, then load the mounted share into the jail with plex in it.

1. Figure out the mount_smbfs command that works in your networked case. (assuming you have a samba share you want to use for plex on another machine)

Code:
 mount_smbfs -I 192.168.1.1 //myUser@serverName/mySharedFolder /mnt/mySharedFolder 


http://blog.up-link.ro/freebsd-how-to-mount-smb-cifs-shares-under-freebsd/

2. Create pre-init Task
After you have a working mount_smbfs command in shell, copy command into pre-init task , as mount_smbfs dosn't retain after a reboot. so it'll un-mount samba share if you lose power, creating the task make sure on boot, to redo the task
https://doc.freenas.org/11/tasks.html#init-shutdown-scripts
- side note, there also appears to be a way to use /etc/fstab to do it as well, i never got it working. and the above is easier to manage from FreeNas GUI

3. Add storage to jail
https://doc.freenas.org/11/jails.html#add-storage
Source is where you mounted the samba share in FreeNas
Destination is where you want the samba share in the Jail , due to a bug at the moment, you prob want to mount it in root of where plexmediaserver is installed i think its /usr/local/plexdata/plexmediaserver as for some reason plex can't the jail's root.

4. load shares in plex-web; ....hopefully self-explainable


Super thanks to everyone below, very helpful peoples
 
Last edited:

Spunky12

Dabbler
Joined
Sep 7, 2015
Messages
15
Are your Plex server and Freenas Server on the same box? By that I mean are you running the Plex plugin or Plex as a jail on the FreeNAS server?
 

FlamingPooh

Dabbler
Joined
May 14, 2015
Messages
10
I'm running plex in a jail
Plex server and the FreeNas server are on the same box, but the media is on a different box, with eventually adding more media to the freenas server

So I will need to split the media into two or something and add them to plex but I don't know how to do either, add plex media from the same box and add plex media from a different box.

For now i'm trying to add the media i already have, which is in the different box.
 

Spunky12

Dabbler
Joined
Sep 7, 2015
Messages
15
Okay, since the media is on a different box your going to need to mount the drives somehow for Plex to have access to it. The best way is to have your media on your FreeNAS and pass in the filesystem to the jail using the storage option under the jails section.

What type of system is the other box? Windows, Linux?
 
Joined
Apr 9, 2015
Messages
1,258
You are going to have to do a ton of work to make this happen. You have to setup a Samba client in the jail and then get it to connect to the box with the data. Then after doing that you have to mount the share at some point in the jail. I would not recommend doing this on the FreeNAS system as it has a good chance of not surviving an upgrade and possibly even a restart, just do it in a jail.

Did I mention this will all be done with the command line? I would suggest googling how to mount samba on freebsd.
 

FlamingPooh

Dabbler
Joined
May 14, 2015
Messages
10
Thanks i wasnt sure if i was going to do it in the main freanass shell or thr plex shell. I will look into adding smb to the plex jail work on that..im used to windows so leaning as we go...

The other box is...a linux i guess. Its a standalone nas system. I was just planning an upgrade and sadly its at capacity...data hording problems and all.
 

Spunky12

Dabbler
Joined
Sep 7, 2015
Messages
15
FlamingPooh, I have to side with nightshade00013. You would be much better off moving your data from the other server to a new SMB share on your FreeNAS server and then passing that filesystem into the Plex jail so that it can access the media.
 

FlamingPooh

Dabbler
Joined
May 14, 2015
Messages
10
haha i can't i haven't committed enough drives/space to freenas (new system, smaller drives) vs the current active system (bigger drives) . and active system has bigger drives.

so.....i thought i was making progress..start with google samba and freebsd

https://www.freebsd.org/doc/handbook/network-samba.html

okay. totally didn't understand what it meant.

apprently it means navigate to the folder with the port

Code:
cd /usr/ports/net/samba-smbclient

and then
Code:
make install clean


unfortunately...

error codes. okay port dosn't work. i don't know why. what else is there...samba36, 42, 43, 44, 45, 46.

trial and error indicate that samba36-43 the ports are broken and 44-46 say the freebsd version i'm using is at end of life support and not supported.

Check freebsd version
11.0-RELEASE-p1

seems like that should be supported....but its not very clear from freebsd website. so now i'm trying to figure out to force install the SMB port or wait on freenas to upgrade their version as i can't force an upgrade in the jail.....at least thats what i think.

if anyone knows how to bypass
Code:
!\ ERROR: /!\

Ports Collection support for your FreeBSD version has ended, and no ports are
guaranteed to build on this system. Please upgrade to a supported release.

No support will be provided if you silence this message by defining
ALLOW_UNSUPPORTED_SYSTEM.

*** Error code 1



Feel free to let me know. seems like i need to trip the allow_unsupported_system somehow...not sure what that is..

edit;

so moving on. you can force install stuff/ports if you add
"ALLOW_UNSUPPORTED_SYSTEM=yes" to your make.conf config file in what i think its /etc/make.conf ; but i'm in the middle of trying to add smb to the jail and it needs so many dependencies.........so maybe update in 700 hours later
 
Last edited:
Joined
Apr 9, 2015
Messages
1,258
Try using the pkg system instead.

pkg install samba46
 

FlamingPooh

Dabbler
Joined
May 14, 2015
Messages
10
thank you so much.. (saved me what i assume would have been 1000 hours of watching the thing try)

what is the difference between
pkg install
vs
make install clean

the documentation isn't very clear.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
The differnce is one installs the package version and one builds the install from the port. It is very well documented in the FreeBSD handbook.
 

FlamingPooh

Dabbler
Joined
May 14, 2015
Messages
10
haha.....cool good to know;

I've hit a wall

Code:
 
root@JAILS:/mnt # mount_smbfs -I 192.*.*.* //USER@NAME/data /mnt/test
mount_smbfs: can not setup kernel iconv table (ISO8859-1:tolower): syserr = Operation not permitted


As far as i can tell, it seems to be privilege error, tho i'm root, so i'm not sure how much more privilege i can get.

I have instead gone a round-about and was able to mount the smb share from the outside (Freenas shell) and load it into the jail. tho. If anyone has ideas abouve the above, i'd be happy to attempt the load the smb in the jail.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
I don’t know if you’ve abandoned this idea or not, but there seems to be some confusion is this thread.

1. To mount a network share in your FreeBSD jail, you didn’t need to install samba46. You are not turning your jail into another samba server.

2. The smbclient pkg ( surprisingly only in ports in FreeBSD 11) might have been useful for other reasons, but isn’t necessary.

3. AFAIK the mount_smbfs command is part of the FreeBSD base, but it fails because you have the wrong syntax. The “I” flag should be followed by a recognisable IP address of a computer that is reachable from the “jail” network. In your case, this is the IP address of the server with all your data. There are other possible errors in the command you used.

The actual syntax is of this form:

mount_smbfs -I 192.168.1.1 //myUser@serverName/mySharedFolder /mnt/mySharedFolder

where in this example :

192.168.1.1 is the IP address of the remote computer (replace this with your server’s IP).
myUser is your user name. (valid user on your server with access to shares)
serverName is NETBIOS Server Name.
mySharedFolder is CIFS share name. (replace as necessary)
/mnt/mySharedFolder is the local mount point directory. (replace as necessary)

(see: http://blog.up-link.ro/freebsd-how-to-mount-smb-cifs-shares-under-freebsd/ )

So, your first task is to find the IP address of your server holding the data and check with the ping command that is reachable from within your FreeBSD jail.

Second task is to determine the correct values to use in the other terms within the mount_smbfs command. The “smbclient” command would be useful here to list the network shares available to your FreeBSD jail.

To make progress, you need know the share names and user credentials set up on the server holding all your data. If you have shell access via ssh to that “different server” you mentioned, and it is running linux, then you might be able to use the smbclient command there, e.g:

smbclient -L localhost

For a linux host running a samba service, the output would look something like this:

Code:
root@debian8vm:/# smbclient -L localhost
WARNING: The "syslog" option is deprecated
Enter root's password:
Domain=[DEB8VMGROUP] OS=[Windows 6.1] Server=[Samba 4.5.12-Debian]

		Sharename	   Type	  Comment
		---------	   ----	  -------
		adata		   Disk	 
		idata		   Disk	 
		mdata		   Disk	 
		vdata		   Disk	 
		IPC$			IPC	   IPC Service (debian8vm server)
Domain=[DEB8VMGROUP] OS=[Windows 6.1] Server=[Samba 4.5.12-Debian]

		Server			   Comment
		---------			-------
		DEB8VM-SAMBA		 debian8vm server

		Workgroup			Master
		---------			-------
		DEB8VMGROUP		  DEB8VM-SAMBA



When you get the mount_smbfs command correct, you should be prompted for the password of the user on that “different server”.

Third task is to ensure you have the read/write access you need ... the wonderous world of unix permissions. Once it works as you want, the fourth task to is to workout how to get a persistent mount of the network share in your jail.
 
Last edited:

FlamingPooh

Dabbler
Joined
May 14, 2015
Messages
10
oh cool so i eventually did it the right thing by mounting it outside and loading mount into the jail after.

i was originally under the impression that it should be done within the jail so that it would better survive updates...given based on how freebsd just depreciated the current version of freenas's freebsd base( and beta looking active), i'd imagine something soon.

i went the route of using mount_sambfs -I etc..etc...etc.. and then creating it as a pre-init script in freenas. and then loaded the mounted samba share in the jail.

works well....we'll see how i survive the next update
 
Status
Not open for further replies.
Top