Cannot mount a SMB share

Dec 26, 2021
2
0
1
60
I have an SMB host sharing some folder on the same LAN where mycontainer is set up.
After having regularly installed cifs support:


admin@mycontainer:~$ sudo apt install cifs-utils

I'm not able to mount a share; issuing:

admin@mycontainer:~$ sudo mount -t cifs -o vers=1.0,username=myusername //smbhost/sharename /mnt/mountpoint

I receive:

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 gives this:

dmesg: read kernel buffer failed: Operation not permitted

Issuing the command without vers=1.0 changes nothing.
The same share is regularly used on Windows machine on the LAN

Any suggestion?

Mirco
 
You can't mount any SMB/NFS share inside a unprivileged LXC. Thats only possible with the unsecure privileged LXCs after enabling the CIFS or NFS features under yourLXC -> Options -> Features. If you want to use shares with a unprivileged LXC you need to mount the shares on your host and then use bind-mounts to bring the mounted share from your host into your LXC.
 
Never did such a thing.
Just found some references to bind-mounting in a chroot-ed environment, I'll dig deeper.
Thanks a lot for the immediate response.

Mirco
 
  1. use the datacenter - storage section
choose smb/cifs

for id pick a name

use the ip address of your smb server (in my case my nas)

once you enter the user and password fields hit the dropdown for share and you will be able to choose from directories/shares that user has access to

once you accept this you should end up with a path target like /mnt/pve/<share>

2) go to the shell/terminal of the pve host

nano /etc/pve/lxc/<lxc id>.conf

scroll to the bottom and add
mp0: /mnt/pve/<share>,mp=/mnt/<local share>

save and close

start container and you will have a directory in /mnt/<local share> and any directories/files will be available

while i did this awhile ago for my plex lxc i forgot how and spent longer than i should searching so i felt compelled to add the comment even though im still a newbie

this time i found a video that was helpful - https://www.youtube.com/watch?v=_cCeKd-49WM

the nfs options are probable better for some network shares but my nas has reliability issues with nfs
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!