Mopidy can't play local music from Samba share

It really bugs me, that something this random workshop

I know this is really old, but I’ve just been fighting with it and have got it to work “properly” so thought I’d document it here as this is the first page that Google returns.
The problem is that the mount point is made using the “pi” user, while the service runs as “mopidy”. Although mopidy (the user) has access to see the files, it can’t play them. Changing the mopidy (service) to run as the user “pi” is a poor solution, because other bits of mopidy (the service) assume they’re running as “mopidy” (the user) and fail.
The correct solution is to mount the NAS folder as the “mopidy” (the user) by finding the “mopidy”'s UID and GID in /etc/passwd and then using those as options (in the -o parameter or in the options column of /etc/fstab) to the mount command - so on the command line:

sudo mount -t cifs -o username=YOUR-SMB-USER,password=YOUR-SMB-PASSWORD,uid=MOPIDY-UID,gid=MOPIDY-GID //URL-TO-SHARE /MOUNT-POINT

I also needed to add a vers=2.0 parameter to the options, as my NAS doesn’t support SMB3.

I hope this means the next person to come up against this and google the question finds a more appropriate solution. I suspect it will be me!

Thanks,
VoxD.

1 Like

I wonder if adding the noperm option would also have resolved this? Maybe worth a try if you are feeling adventurous/bored.

sudo mount -t cifs -o username=YOUR-SMB-USER,password=YOUR-SMB-PASSWORD,noperm //URL-TO-SHARE /MOUNT-POINT