Mount cifs share in Proxmox LXC

Is it possible to mount a cifs share in an unprivileged lxc in proxmox?

When I run

mount -t cifs //IPAddress/Share/ /mnt/media -o username=myusername

I am prompted for the pw

Password for myusername@//IPAddress/Share/:

Then I get this…

mount error(1): Operation not permitted
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

dmesg results

dmesg: read kernel buffer failed: Operation not permitted

This is a TrueNAS share that I’m able to mount in Windows so I believe the permissions are configured correctly on the share.

do you have cifs-utils installed ?

Yes it is installed on the LXC. Not sure if my previous reply went to you or general so retrying

I was able to mount a truenas share to a CT (tnas).
the only difference is my truenas share is open (no pw).

root@tnas:~# mount -t cifs //truenas/share /root/here
Password for root@//truenas/share: 
root@tnas:~# df
Filesystem                     1K-blocks     Used   Available Use% Mounted on
...
//truenas/share              22561792536 94626227 22467166309   1% /root/here

Are you referring to the ‘Select a preset ACL’ : OPEN ? That’s how I have my share as well

No, in truenas … Sharing > SMB > Edit > Advanced > Allow guest access

ah ok I did try this earlier (I’ve recreated the share multiple times in trying to get this to work). I enabled guest and still get mount error(1): Operation not permitted

my container is privileged … I would have to create another ct and test …

1 Like

I believe this might be my problem. I’ll create another Plex container that is privileged and see what happens. From what I can tell, you can’t convert from unprivileged to privileged after creation.

I created a privileged container, installed cifs-utils, and ran the mount command. it worked immediately. no changes to the TrueNAS share at all. I guess this means it’s not possible with an unprivileged container… or if it is possible, I haven’t figured it out

According to Proxmox, unprivileged containers cannot mount cifs shares. Here’s a post:

1 Like

well I feel like an idiot lol. wasted a lot of time.

none the less, I appreciate your responses and help!

no worries, glad I could help.

one more question for you if you don’t mind… once mounted, are you able to write to the share? meaning, in plex if you select the mounted share as a library and you attempt to record a show to the library, does it work?

Plex keeps telling me ‘no write access to destination’ which I’m sure is a permissions thing but I’ve chmod 777 for that directory and have the ACL’s in truenas open.

yes, I can write into the share. I don’t use Plex.

it is just //truenas/share with guest allowed, then from the CT mount it and r/w.

I finally figured it out…

Privileged container is required for mounting…

Once mounted, I could smb to the share and write but I still couldn’t record from plex. I created a user and group in truenas called ‘plex’ with uid:gid 998 (which matched the user running the service on the plex server. I gave that user/group permissions the share in truenas. Then I created a new user in plex web called ‘plex’. Once I did all of that, I can now record :slight_smile:

1 Like

glad you figured it out.