Need help trying to set shared folders for jellyfin lxc

First of all, I’d like to confess that my knowledge about command line in linux is 1 (it was 0 some months ago), but I’m trying to learn as fast as I can.

I’m trying since some weeks to set Jellyfin, with hardware transcoding (I got it in 99%) and I try to get the media from a WD mycloud nas (smb because I only can use that). I follow guides without understanding 100% what I do, but it’s something. I finally got my shared folder in nas passthrough to the lxc and I’m able to mount the folder using this command in lxc:
sudo mount -t cifs -o rw,vers=3.0,credentials=/root/.examplecredentials //192.168.1.110/public/Multimedia /media/share

but if I restart the lxc I must do it again. I would like to make it persistant, and I think fstab doesn’t work if I’m using privileged lxc. I edited the conf file from the container adding this line:
mp0: /mnt/pve/wdmycloud,mp=/media/share and since then I can find the folders in jellyfin after I restart, but movies can’t play. Heres’s the log: /videos/ba70ac9e-7e1d-9ee2-dc3a-ce973a700c56/hls1/main/0.ts{"Protocol":0,"Id - Pastebin.com
Then I try tyiping the first command I posted and I can play movies again.

Can it be related to credentials for the nas?
thank for your time and remember I’m a bit noob in this.

OK, here’s the part that I think is causing the confusion: that entry in the config file is taking whatever is located at /mnt/pve/wdmycloud and bind-mounting it to /media/share inside your container. The permissions on the host get passed through to the container, so if you’re using an unprivileged container (that’s the default) the user IDs are offset by 100000 (meaning the host would have to set the owner of that directory to 100000 instead of 0 for root inside the container to have access.

So, forget all that and let’s just use SMB, which sounds like it’s working. Comment out the line in config file and inside the container, edit /etc/fstab and we’ll put in a version of that mount command that will run when the container starts. Add a line like this:

//192.168.1.110/public/Multimedia /media/share cifs rw,vers=3.0,credentials=/root/.examplecredentials 0 0

Save and close the file and then run mount -a or reboot the container.

This is just one of many ways to handle this, but I think it’s the most direct based on the situation.

1 Like

Thank you very much for taking your time. But I mentioned my lxc is privileged (I used tteck’s scripts) and, when I edit fstab I get this message in the editor: UNCONFIGURED FSTAB FOR BASE SYSTEM

Yup, that’s just a line of text in that file; the # in front of it means that it’s a comment that’s not parsed by the program that reads the file. Add the line I gave you below that comment and run mount -a. That should be the same as mounting via the command line and run automatically each time you boot the container.

EDIT: This is a pretty standard Unix way of mounting filesystems, so it works regardless whether the container is privileged or unprivileged.

1 Like

I think we got it!. I already had the line you told me (from a guide I followed before) but it didn’t include the last 2 “0”. Maybe that made the trick or I just meesed with a second jellyfin lxc (for testing) that it was booted without I noticed.

I’ll keep testing but you helped me a lot, and explained the way a noob like me needed. Thank you much :slight_smile:

That’s awesome! Yeah, those numbers at the end are important—they’re settings for health checks on the mountpoint, so I’m not surprised it didn’t work without that last 0. Way to go getting it sorted out!

1 Like