Jump to content

How to actually use Emby with Linux?


Cortimi
Go to solution Solved by c0utta,

Recommended Posts

Cortimi

Ok, here we go, it doesn't work. I have looked around, and what I need to do according to the warning in Emby (grant the Emby system user at least read access to your storage locations) there is no tutorial for. How to grant permissions? What permissions? I need to know what exactly this software is wanting and how to fix it.

I have a 500GB ext4 partition on an external drive. It is mounted properly. It is not NTFS. No other program has any trouble with finding it or using it. Only Emby is failing.

Permission for partition are proper:

"ls -l /media/cortimi/Storage
total 56
drwxrwxr-x 2 cortimi cortimi  4096 Jul 23 22:39  Firefox
drwx------ 2 root    root    16384 Jul 23 13:46  lost+found
drwxrwxr-x 2 cortimi cortimi  4096 Jul 23 15:39 'Meme Locker'
drwxrwxr-x 2 cortimi cortimi  4096 Jul 23 15:38  Music
..."

Any ideas?
 

Edited by Cortimi
Link to comment
Share on other sites

c0utta

Hard to help if you don't tell us:

- what flavour of Linux?

- how did you do the install? 

- what doesn't work?

 

I'm using Ubuntu 16.04 (terminal only) and installed as per https://emby.media/linux-server.html.

 

I didn't need to grant any permissions because my media is also r-x for all users - same as yours. 

 

I assume the same permissions cascades down into Music?

Link to comment
Share on other sites

mastrmind11

Well, assuming Emby is running as user emby, does the emby user belong to the cortimi group?  If not, then your permissions are not "proper". The reason your other programs work is likely because they are running as user cortimi.  So, googling around for how to add a user to an existing group will likely solve your problem.

Link to comment
Share on other sites

icsy7867

Your permissions are currently 775, this should be enough for emby (And anyone else!) to read you files.

 

Can you:

ls -l /media/cortimi/Storage/Music

I want to make sure that the files here have the same permissions.

 

You can try:

chown -R cortimi:Emby /media/cortimi/Storage/Music

Alternatively you can add your "Emby" user to your cortimi group:

usermod -a -G cortimi Emby

This will give the group "Emby" permissions on the folder and sub-files.  However having the files world readable you should not have these issues.  Which is why I am curious as to the permissions on the files within the folder.

Link to comment
Share on other sites

Cortimi

Your permissions are currently 775, this should be enough for emby (And anyone else!) to read you files.

 

Can you:

ls -l /media/cortimi/Storage/Music

I want to make sure that the files here have the same permissions.

 

You can try:

chown -R cortimi:Emby /media/cortimi/Storage/Music

Alternatively you can add your "Emby" user to your cortimi group:

usermod -a -G cortimi Emby

This will give the group "Emby" permissions on the folder and sub-files.  However having the files world readable you should not have these issues.  Which is why I am curious as to the permissions on the files within the folder.

Will give that a try when I get back to the machine, thanks.

Link to comment
Share on other sites

Cortimi

Ok, cleaned everything out of the drive, this is what we have:

$ ls -l /media/cortimi/Storage
total 28
drwxrwxr-x 2 cortimi cortimi  4096 Jul 25 04:23 Emby
drwxrwxr-x 2 cortimi cortimi  4096 Jul 25 02:01 Firefox
drwx------ 2 root    root    16384 Jul 25 00:11 lost+found
drwxr-xr-x 9 root    root     4096 Jul 25 01:02 timeshift

 

The Emby folder is the one I want to use. It currently just has a test .wma file that I copied over from my Download folder on main drive.

$ ls -l /media/cortimi/Storage/Emby
total 96
-rw-rw-r-- 1 cortimi cortimi 94977 Apr  9  2011 Alarm-03.wma


$ chown -R cortimi:Emby /media/cortimi/Storage
chown: invalid group: ‘cortimi:Emby’


$ usermod -a -G cortimi Emby
usermod: user 'Emby' does not exist


Emby was installed using the Ubuntu X64 .Deb package found here: https://emby.media/linux-server.html

I am using Linux Mint 19 (Ubuntu 18.04 based) 64-bit.

I am accessing the program through Firefox using the address: http://localhost:8096

First, I click "Add Media Library", it takes me to a screen with "Content Type", "Display Name" and a Folder with + sign. I click the plus sign. Next screen has an input area for "Folder" and a selection menu of different paths on the drive. /media is not an available option. If I manually enter "/media/cortimi/Storage", I get an error that path is not found. If I enter "/media/cortimi/Storage/Emby", I get the same error that path is not found.

 

Edited by Cortimi
Link to comment
Share on other sites

it's "emby" not "Emby", usernames as most everything in Linux is case sensitive.

 

Adding emby to your group should solve most if not all your permissions problems.

Link to comment
Share on other sites

Cortimi

it's "emby" not "Emby", usernames as most everything in Linux is case sensitive.

 

Adding emby to your group should solve most if not all your permissions problems.

 

 

Ok, was copying and pasting what someone else had wrote. This doesn't give an error in terminal but it changes nothing in Emby.

 

Screenshot_from_2018-07-25_16-30-30.png

 

Screenshot_from_2018-07-25_16-30-38.png

Screenshot_from_2018-07-25_16-41-13.png

 

Screenshot_from_2018-07-25_16-43-34.png

 

Still not working.

Edited by Cortimi
Link to comment
Share on other sites

c0utta

Please show the results of:

 

ls -al /media

ls -al /media/cortimi

ls -al /media/cortimi/Storage

ls -al /media/cortimi/Storage/Emby

 

 

We can then see the full tree to see permissions and ownership all the way down.

 

My guess is that a higher level folder is denying access to the emby user.

Link to comment
Share on other sites

Cortimi

cortimi@Dopminter:~$ ls -al /media
total 16
drwxr-xr-x   4 root root 4096 Jul 26 00:00 .
drwxr-xr-x  25 root root 4096 Jul 25 22:51 ..
drwxr-x---+  3 root root 4096 Jul 27 11:04 cortimi
drwxr-x---+  2 root root 4096 Jul 27 11:04 root
cortimi@Dopminter:~$ ls -al /media/cortimi
total 12
drwxr-x---+  3 root    root    4096 Jul 27 11:04 .
drwxr-xr-x   4 root    root    4096 Jul 26 00:00 ..
drwxrwxrwx  10 cortimi cortimi 4096 Jul 27 01:54 Storage
cortimi@Dopminter:~$ ls -al /media/cortimi/Storage
total 52
drwxrwxrwx  10 cortimi cortimi  4096 Jul 27 01:54 .
drwxr-x---+  3 root    root     4096 Jul 27 11:04 ..
drwxrwxr-x   2 cortimi cortimi  4096 Jul 25 22:41 Downloads
drwxrwxr-x   2 cortimi emby     4096 Jul 25 04:23 Emby
drwx------   2 root    root    16384 Jul 25 00:11 lost+found
drwxrwxr-x   3 cortimi cortimi  4096 Jul 27 02:02 Steam
drwxr-xr-x   9 root    root     4096 Jul 27 01:01 timeshift
drwxrwxr-x   4 cortimi cortimi  4096 Jul 27 02:13 Torrents
drwx------   4 cortimi cortimi  4096 Jul 25 04:20 .Trash-1000
drwxrwxr-x   2 cortimi cortimi  4096 Jul 25 22:45 Zeta
cortimi@Dopminter:~$ ls -al /media/cortimi/Storage/Emby
total 104
drwxrwxr-x  2 cortimi emby     4096 Jul 25 04:23 .
drwxrwxrwx 10 cortimi cortimi  4096 Jul 27 01:54 ..
-rw-rw-r--  1 cortimi emby    94977 Apr  9  2011 Alarm-03.wma


I do appreciate the efforts from everyone so far.

Link to comment
Share on other sites

mastrmind11

why are you root on 90% of your mount?  If you want to set premissions, you have to start at the top level and work down.  I'm not sure how this could have ever worked, with anything, unless half your apps run as root?? :huh:   

 

Bottom line, your permissions are jacked in general.  Pick a permission policy and stick to it.  Nothing at this level should be owned by root, it's extremely dangerous.  However, based on the output from above, the /Emby share should be accessible by emby, and I assume you can play that .wma file?  Those permissions are correct (kind of). 

Edited by mastrmind11
Link to comment
Share on other sites

Cortimi

why are you root on 90% of your mount?  If you want to set premissions, you have to start at the top level and work down.  I'm not sure how this could have ever worked, with anything, unless half your apps run as root?? :huh:   

 

Bottom line, your permissions are jacked in general.  Pick a permission policy and stick to it.  

This is how the permissions are set when I partition the drive using the default "Disks" tool in Linux Mint. This is a fresh install of Linux Mint. I didn't "pick a policy", it came this way. I have changed nothing concerning root or anything else. If you look closer, it's not "%90 of the mount", it is only two folders, the lost+found and Timeshift folders; both of which are system folders and require root, as they are run by the OS. Those two folders are for OS backup/system restore utilities. Which only further proves that the drive is working and is usable. So I really don't see how it is "jacked" when the two folders that should be root are root, and everything else that is supposed to user, is user.

 

The only changes I have made were:

 

 

chown -R cortimi:emby /media/cortimi/Storage/Emby

 

 

and

 

usermod -a -G cortimi emby

 

 

However, based on the output from above, the /Emby share should be accessible by emby, and I assume you can play that .wma file? 

I know it should, but it isn't, that's the entire problem. And yes I can play the .WMA file, it was downloaded to home folder on internal drive and copied over.

 

For what it's worth, Steam and other programs see the drive just fine.

Edited by Cortimi
Link to comment
Share on other sites

c0utta

Hi Cortimi,

 

Your problem is that Steam and other programs are being run under your ID, but Emby needs to see things as the emby user, and needs to be able to see all the way down the tree from the root.

 

Your problem is that emby can't access /media/cortini which would need to be drwxd-xd-x, not drwxd-x---

 

Could you also output 'ls -Al /' too please? I forgot that one, sorry.

 

Personally, changing the owner and group of the structure is not the right approach in this case. Better to adjust the permissions.

  • Like 1
Link to comment
Share on other sites

Cortimi

$ ls -al /
total 2097268
drwxr-xr-x  25 root    root          4096 Jul 25 22:51 .
drwxr-xr-x  25 root    root          4096 Jul 25 22:51 ..
drwxr-xr-x   2 root    root          4096 Jul 25 00:20 bin
drwxr-xr-x   4 root    root          4096 Jul 25 00:23 boot
drwxr-xr-x   2 root    root          4096 Jul 24 19:01 cdrom
drwxr-xr-x  22 root    root          4520 Jul 27 18:06 dev
drwxr-xr-x 160 root    root         12288 Jul 27 17:47 etc
drwxr-xr-x   4 root    root          4096 Jul 24 19:02 home
lrwxrwxrwx   1 root    root            33 Jul 25 00:21 initrd.img -> boot/initrd.img-4.15.0-29-generic
lrwxrwxrwx   1 root    root            33 Jul 24 18:58 initrd.img.old -> boot/initrd.img-4.15.0-20-generic
drwxr-xr-x  24 root    root          4096 Jul 25 00:08 lib
drwxr-xr-x   2 root    root          4096 Jun 26 10:01 lib64
drwx------   2 root    root         16384 Jul 24 18:57 lost+found
drwxr-xr-x   4 root    root          4096 Jul 26 00:00 media
drwxr-xr-x   2 root    root          4096 Jun 26 10:00 mnt
drwxr-xr-x   5 root    root          4096 Jul 25 13:06 opt
dr-xr-xr-x 260 root    root             0 Jul 27 16:42 proc
drwx------   6 root    root          4096 Jul 25 22:58 root
drwxr-xr-x  36 root    root          1140 Jul 27 17:30 run
drwxr-xr-x   2 root    root         12288 Jul 25 02:01 sbin
drwxr-xr-x  13 root    root          4096 Jul 27 17:44 snap
drwxr-xr-x   2 root    root          4096 Jun 26 10:00 srv
drwxr-xr-x   2 cortimi cortimi       4096 Jul 25 22:51 storage
-rw-------   1 root    root    2147483648 Jul 24 18:58 swapfile
dr-xr-xr-x  13 root    root             0 Jul 27 16:42 sys
drwxrwxrwt  26 root    root          4096 Jul 27 19:21 tmp
drwxr-xr-x  10 root    root          4096 Jun 26 10:00 usr
drwxr-xr-x  13 root    root          4096 Jul 25 01:26 var
lrwxrwxrwx   1 root    root            30 Jul 25 00:21 vmlinuz -> boot/vmlinuz-4.15.0-29-generic
lrwxrwxrwx   1 root    root            30 Jul 25 00:21 vmlinuz.old -> boot/vmlinuz-4.15.0-20-generic


$ ls -al /media
total 16
drwxr-xr-x   4 root root 4096 Jul 26 00:00 .
drwxr-xr-x  25 root root 4096 Jul 25 22:51 ..
drwxr-x---+  3 root root 4096 Jul 27 16:43 cortimi
drwxr-x---+  2 root root 4096 Jul 27 11:04 root

$ ls -al /media/cortimi
total 12
drwxr-x---+  3 root    root    4096 Jul 27 16:43 .
drwxr-xr-x   4 root    root    4096 Jul 26 00:00 ..
drwxrwxrwx  10 cortimi cortimi 4096 Jul 27 01:54 Storage

$ ls -al /media/cortimi/Storage
total 52
drwxrwxrwx  10 cortimi cortimi  4096 Jul 27 01:54 .
drwxr-x---+  3 root    root     4096 Jul 27 16:43 ..
drwxrwxr-x   2 cortimi cortimi  4096 Jul 25 22:41 Downloads
drwxrwxr-x   2 cortimi emby     4096 Jul 25 04:23 Emby
drwx------   2 root    root    16384 Jul 25 00:11 lost+found
drwxrwxr-x   3 cortimi cortimi  4096 Jul 27 02:02 Steam
drwxr-xr-x   9 root    root     4096 Jul 27 01:01 timeshift
drwxrwxr-x   4 cortimi cortimi  4096 Jul 27 02:13 Torrents
drwx------   4 cortimi cortimi  4096 Jul 25 04:20 .Trash-1000
drwxrwxr-x   2 cortimi cortimi  4096 Jul 25 22:45 Zeta


 

Edited by Cortimi
Link to comment
Share on other sites

  • Solution
c0utta

I'd do:

 

chmod -R a+rx /media/cortimi

 

This adds read and execute for all users from /media/cortini downwards.

 

Then use the flashlight in Emby's library folder to navigate. If you can't see the folders then report back.

  • Like 1
Link to comment
Share on other sites

Cortimi

I'd do:

 

chmod -R a+rx /media/cortimi

 

This adds read and execute for all users from /media/cortini downwards.

 

Then use the flashlight in Emby's library folder to navigate. If you can't see the folders then report back.

 

Holy shit, that worked! Why? What exactly did I just copy and paste?

Link to comment
Share on other sites

c0utta

I now have full access to your system.  Ha!  Joking.

 

Have a read about basic Linux permissions and ownership (there are plenty of guides that give a better explanation than I will), but the trick is being able to think about how other users see the file structure.  Also, to understand the difference between ownership and permissions and how they interact.

 

Essentially - "although cortimi can see the file, can emby see all the way down through each folder to the file?".  I use the "sudo -u <user> ls -al /mnt/folder" command sometimes to see what <user> can see in /mnt/folder.

 

Finally, the commands you ran (not to show disrespect to others) should really be undone:

 

Give ownership back to the cortimi group using:

chown -R cortimi:cortimi /media/cortimi/Storage/Emby

this will reverse: chown -R cortimi:emby /media/cortimi/Storage/Emby

because emby shouldn't have group ownership to any of these media files - they're yours, not emby's

 

Remove the emby user from the cortimi group:

gpasswd -d emby cortimi

this will reverse: usermod -a -G cortimi emby
because adding the emby user to the group serves no purpose in this case
Edited by c0utta
  • Like 1
Link to comment
Share on other sites

  • 1 year later...
Stlk filmes

Good night, I have the same problem, create virtual disk with Rclone, mount the disk ok, just emby does not see the folder in the library, if you can help. thanks

 

5dc8ab49b4269_pastas.jpg

5dc8ab7f5b80b_pasta2.jpg

5dc8aba966f34_permissao.jpg

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...