Mount Network boot LXC Fstab

babou29

Member
Dec 29, 2019
8
0
6
43
France
Good morning,
I am looking to mount a network drive in an LXC container on my Promox.

I've tried lots of solutions from different sites, but I get nowhere.

Could you guide me to mount an anonymous network drive hosted on an internal NAS please?

Here is part of the FSTAB file: :
//192.168.XX.XX/VIDEOS/ /mnt/partages/ cifs anon=1,vers=3,udp 0 0

Here is the file of "/etc/pve/lxc/106.conf"
Code:
#################### docker section ####################
arch: amd64
cores: 2
features: mount=nfs;cifs,nesting=1
hostname: 106-Torrents
memory: 512
net0: name=eth0,bridge=vmbr1,firewall=1,gw=192.168.29.254,hwaddr=B6:64:4B:12:EE:5B,ip=192.168.29.247/24,type=veth
onboot: 1
ostype: debian
rootfs: local-zfs:subvol-106-disk-0,size=8G
searchdomain: 192.168.29.254
swap: 512
unprivileged: 1
lxc.cgroup.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net dev/net none bind,create=dir
lxc.apparmor.profile: unconfined
lxc.cap.drop:

Thank you very much for your help.

Good day.
Nicolas
 
Only the less secure privileged LXCs can do that after enabling the CIFS feature in the LXCs options tab.

With unprivileged LXC there is a workaround where you mount the SMB share on the PVE host and then bind-mount the shares mountpoint from the host into the unprivileges LXC. Also keep the user/group remapping in mind: https://pve.proxmox.com/wiki/Unprivileged_LXC_containers
 
Good morning,
Thank you for your answers.
When I put "unprivileged: 0" in the conf file, the VPN no longer mounts and the network drive does not mount either.
When I put "unprivileged: 1", the VPN goes up very well but not the network drive! ;)

Could you help me with the VPN and/or network player please?

Thank you.
Sincerely,
Nicolas
 
Good morning,
Thank you for your answers.
When I put "unprivileged: 0" in the conf file, the VPN no longer mounts and the network drive does not mount either.
When I put "unprivileged: 1", the VPN goes up very well but not the network drive! ;)

Could you help me with the VPN and/or network player please?

Thank you.
Sincerely,
Nicolas
Did you figure this out? I have a similar problem. Changed from a VM to an LXC container, gave it the same IP and used the same FSTAB config but the network folder doesn't mount. I'm using 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!