Help with LXC access to host SMB mount

Taomyn

Active Member
Aug 30, 2023
123
30
33
Luxembourg
I know there are other threads on this, but most are quite old and I didn't want just insert into them.

I'm struggling to get my Debian 12 unprivileged LXC to mount an SMB share that is mounted on the host. I've used the "storage" feature to keep things simple and not mess too much with the main OS, so this is what I have just tried:

pvesm add cifs tdarr_temp --server marge.<redacted> --share Tdarr --username tdarr --password <redacted> --domain <redacted> --create-subdirs no

This works and I can see and access (read/write) the share. I also tried using --options uid=100000,gid=100000 to set the IDs but that doesn't seem to work, they stay as 0 in the mount:

Code:
//marge.<redacted>/Tdarr on /mnt/pve/tdarr_temp type cifs (rw,relatime,vers=3.1.1,cache=strict,upcall_target=app,username=tdarr,domain=<redacted>,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.20,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,reparse=nfs,nativesocket,symlink=native,rsize=4194304,wsize=4194304,bsize=1048576,retrans=1,echo_interval=60,actimeo=1,closetimeo=1)

Then on the LXC (105) I have configured:

pct set 105 -mp0 /mnt/pve/tdarr_temp,mp=/root/Tdarr/temp,mountoptions=uid=0,gid=0

I have tried various combinations of uid/gid on both parts, and the closest was when the mount on the LXC was shown as owner "nobody" but I could not make changes. I can't remember now which combination that was, but everything else so far just gives me an empty directory.

The config of the LXC is:
Code:
arch: amd64
cores: 1
dev0: /dev/dri/card1
dev1: /dev/dri/renderD128
features: nesting=1
hostname: TODD
memory: 1024
mp0: /mnt/pve/tdarr_temp,mp=/root/Tdarr/temp,mountoptions=uid=0,gid=0
net0: name=eth0,bridge=vmbr0,gw=192.168.1.1,hwaddr=BC:24:11:97:3E:09,ip=192.168.1.77/24,type=veth
onboot: 1
ostype: debian
rootfs: cpool-01:subvol-105-disk-0,mountoptions=discard,size=50G
swap: 512
tags: container;linux
unprivileged: 1

Can someone help me out?

CPU(s) 16 x AMD Ryzen 7 5700G with Radeon Graphics (1 Socket)
Kernel Version Linux 6.14.5-1-bpo12-pve (2025-05-21T15:55Z)
Boot Mode EFI (Secure Boot)
Manager Version pve-manager/8.4.1/2a5fa54a8503f96d