[Plex Media Server in Docker] How to access /storage ?

  • Hello all,

    New to LE here and impressed ! I am running on a Sunvell T95Z Plus without too many issues but I am looking to use Plex Media Server and I m running into some issues.

    I managed to install it from the LE docker repo, and it's working fine, I can access the web interface etc, however given that it's running in a container it doesn't seem to be able to access my samba share that I mapped in /storage/data. When I go to add libraries in PMS, the root is the root of the container not the root of the machine. How can I access the right path from the docker container ?

    Thanks in advance

  • In the addon settings, you can change the mapping for movie and tv show folders

    Then inside the container (ie. Plex) they will be accessed at the mapped locations (ie. /data/movies)

  • Thanks I just did that, but even after restarting inside plex when I go and select movies it shows it as empty, is that because it's a smb mapping ?
    I double checked in kodi I can see the content of the smb mapping

  • Or is there another way to install Plex Media Server ? I saw there was an addon by hugepants but it looks like it's been discontinued or at least the page goes to 404 .. might be easier than going through Docker

  • Seems so close though, just the mapping from docker doesn't seem to work

    I also tried Armbian which works fantastic (here native plex version), but the video driver is quite poor

    Any help on setting up the mapping to work on samba drive would be greatly appreciated

  • Thanks I just did that, but even after restarting inside plex when I go and select movies it shows it as empty, is that because it's a smb mapping ?
    I double checked in kodi I can see the content of the smb mapping

    What do you mean by "restarting inside plex"?

    As long as plex starts "after" smb mounts, it should work. I have my shares nfs mounted a similar way.

    But if the shares are dismounted or remounted while docker is running, plex won't see the files anymore. The shares have to be mounted first and remain mounted

  • Hey there,

    I just installed Plex via the LE docker repo. I have access to the server and it looks like its running so far.

    But I can't add any share media folders from my NAS. I tried to Map the NSF Share in the settings, as you described, but when I do this I can't access Plex anymore (it just wont't start). I disabled and enabled the Addon, restarted Kodi (using Libreelec 8.2.5. with RP2), but nothing helps. If i chance the mapping back to the standard "/storage/tvshows" (for example) Plex is starting again.

    The NSF share is working fine, since I am using it for my Kodi library. I also tried SMB share but with the same issue.

    May I miss something!?

    edit:

    Some more information. When I edit the settings file to map to my shared network folder, it looks like the whole image isn't even recognized by Docker.

    I tried to use the commnd "docker ps -a" to to see all images, but its completley blank. When I reset the settings to default the image show perfectly and Plex is starting.

    I don't think I did anything wrong with the mapping since I am using the tree folder structure inside Kodi to point to the right direction. So I can't see why Docker can't recognize the image after I changed the settings?

    Here is my changed setting file:

    Code
    <settings>
        <setting id="E_VERSION" value="public" />
        <setting id="V_config" value="/storage/.kodi/userdata/addon_data/docker.linuxserver.plex" />
        <setting id="V_data_movies" value="nfs://192.168.178.100/Media/Movies/" />
        <setting id="V_data_tvshows" value="/storage/tvshows" />
        <setting id="V_transcode" value="/storage/downloads/plextemp" />
    </settings>

    Edited 2 times, last by sonic00 (October 12, 2018 at 5:41 PM).

  • You can't use an nfs:// address as a location map, docker does not recognize that. You need to mount the nfs share in libreelec to a local path, and use that local path in addon settings

  • You can't use an nfs:// address as a location map, docker does not recognize that. You need to mount the nfs share in libreelec to a local path, and use that local path in addon settings

    Thank you for the hint. That did the trick - had to google a bit, how to mount a nsf shared folder, but I got it to worked now. Great Addon :)

  • Thank you for the hint. That did the trick - had to google a bit, how to mount a nsf shared folder, but I got it to worked now. Great Addon :)

    Another quick hint, all the apps in our docker addons run as the user nobody (id 65534) and group user (99) because running as root is not recommended for many of them. So make sure that the mount points have permissions that allow access to that user

  • Hi!

    It seems the plex addon requires writable access as it tries to take ownership of all files at startup for some reason.

    CGroup: /system.slice/docker.linuxserver.plex.service

    ├─1409 /bin/sh /storage/.kodi/addons/http://docker.linuxserver.plex/bin/docker.linuxserver.plex

    └─1476 chown -R nobody:users /storage/tvshows /storage/videos /storage/downloads/plextemp /storage/pictures

    Jan 03 00:30:10 LibreELEC sh[1409]: chown: /storage/videos/hd-series/*************.S03E09.720p.BluRay.X264-*******: Permission denied

    ...

    ..

    This is a big problem for me as it's a remote RO mounted location where RW is not an option. Especially not if there are applications doing recursive chown's on everything.

    I found an option in this file:

    /storage/.kodi/addons/http://docker.linuxserver.plex/resources/settings.xml

    <setting label="30007" type="folder" id="V_data_movies" default="/storage/videos" option="writeable" />

    Have tried to change this to "readonly, ro, read, notwriteable" etc but it doesn't change the startup behaviour of plex.

    Any ideas?

  • 2 things...

    What you did will work until the addon is updated for any reason, then it will be overwritten

    Whatever the ownership is, plex needs to be able to read the files on there. Unlike libreelec, plex in this container runs as user nobody, not root

  • Thanks for your reply and pointing this out.

    Automatic updates is and should be disabled after this and whenever you want it updated it's actually not a big thing to fix manually.

    It is mounted with proper UID but as RO indeed.

    In my opinion though, doing chown -R here without a warning is both risky and pointless. And with a large archive mounted over a network it delays the startup with minutes and possibly hours. Finally, any existing ownership and group-access structure will be completely destroyed.

    However, now everything is working properly and I'm very pleased with it. Kodi still as the main player and Plex for streaming services.

    Maybe one thing, It would be nice and perhaps more "clean" to have a custom folder in addition to videos/tvshows/pictures. This as a mounted target may contain a mix of all those plus more.

  • Risky, perhaps, but pointless it is not. Chown on media files is a necessary evil here. This is a plugin that people expect to just work.

    The default folders are the local folders on LE that are normally owned by root. But docker containers run as user nobody. We need to make them readable. I suspect most people using this plugin are hosting their media on a usb drive attached to LE. That's why we're not getting complaints about the chown.

    The concern about the time it takes is valid. We can perhaps stat the top folder and chown only when necessary.

    An alternative is doing a chmod -R go+r which would still cause issues with remote mounts.