SMB Share in LXC

ams123

Active Member
Jan 19, 2017
15
0
41
51
Currently having trouble accessing a SMB share from my Ubuntu 18.04 LXC. For my Ubuntu VM's I do this with FSTAB but that does not work for a Ubuntu LXC. I read that I should use a bind mount but I am not sure how to do that with a SMB share, I think I understand how to add a line to my LXC .conf file for a Host directory but not a SMB share.

Can some do a little hand holding here and help me translate my FSTAB entry into a bind mount for my LXC.

//192.168.x.x/ChannelsDVR/ /home/dvr/RecordedTV cifs user=usr,password=pw,uid=usr,gid=usr,rw,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

My SMB share is coming from Open Media Vault which manages all my data disk as a VM in Proxomox. Because I want to maintian flexibility as my storage needs change and to share ourside of my proxmox host I would like to keep OMV managing all my data disks.
 
hi,

I read that I should use a bind mount but I am not sure how to do that with a SMB share, I think I understand how to add a line to my LXC .conf file for a Host directory but not a SMB share.

Can some do a little hand holding here and help me translate my FSTAB entry into a bind mount for my LXC.

you can simply mount the share on your host (via fstab for example), and then use a bind mount to pass it to the container.

add the bind mount entry in /etc/pve/lxc/CTID.conf

Code:
mp0: /path/to/share_on_your_host,mp=/path/to/mount

so for example if i have a share mounted on my host at /mnt/share and i want to bind mount that in my container to /home/user/files

Code:
mp0: /mnt/share,mp=/home/user/files

if you are using an unprivileged container (it's the default when creating on GUI), you might also have to adapt the file permissions/owners in the share, so the user in the container can access them.
 
OK that option makes sense to me but I have run into trouble if the SMB share is not available when linux boots. In this case it won't be since it's from one of the VMs.
 

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!