LXC Container Mount CIFS - Sporadically Hangs

Jim J

New Member
Oct 26, 2016
17
1
1
54
I've pieced together a few instructions from here and there to allow my Prox Containers to mount CIFS shares but I have the sporadic problem where accessing the shares hangs with no response for a few minutes. It clears...eventually.

In my case, multiple containers attempt to access the same Samba machine. Those containers are on the same host machine and tellingly, they both experience the hang problem at the same time. I think the problem lies with the host machine but can't be sure.

My setup involves the following apparmour.d changes
Code:
root@prox:/var/log# cat /etc/apparmor.d/lxc/lxc-default
.....
  # allow containers to mount CIFS connections
  allow mount fstype=cifs,
}

Code:
root@prox2:/var/log# cat /etc/apparmor.d/lxc/lxc-default-cgns
......
  # allow lxc to mount cifs
  allow mount fstype=cifs,
.....
}

My containers occasionally throw up these errors:
Code:
root@container1:~/scripts# cat /var/log/kern.log | grep cifs
Dec 19 19:15:41 container1 kernel: [  275.442318] CIFS VFS: cifs_mount failed w/return code = -101
Dec 20 14:41:32 container1 kernel: [70229.986146] CIFS VFS: cifs_mount failed w/return code = -101
Dec 20 14:41:32 container1 kernel: [70230.043271] CIFS VFS: cifs_mount failed w/return code = -101

Container /etc/fstab is...
Code:
//HOST/SHARE /mnt/DIRECTORY cifs credentials=/CRED-FILE,noexec,rw,uid=33,gid=33 0 0
 
I've been wondering if this is related the Samba server itself, so I'm going to try touching a file on the other end of the CIFS mount every 5 minutes to see if that makes a difference.
 
Thanks for providing the steps you used to allow CIFS mounts in LXC containers, it's much appreciated! :)
 

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!