EDIT: [solved] see end of this post for the solution
Hello,
I'm installing Proxmox 6.1-5 to replace several servers, and enjoy the possibility of using LXC and virtualization.
Scénario :
One VM to offer fileserver services SMB/CIFS : OpenMediavault or Linux.
LXC Turnkey Centos 8 : to use docker.
Mint Cinnamo VM : to work
Other VM for services.
The scenario exclude the use of smb/cifs share mounted on Proxmox host that will link to LXC as cifs/smb share are provided by a VM hosted on proxmox.
The cifs/smb shares won't be available before OpenMediavault VM is up and running, making Proxmox mounts fail.
Mint VM
To test the mount, I tried to mount SMB/CIFS share from Mint VM terminal to an existing Linux file server and it worked flawlessly.
To make the mount reboot proof I used it in fstab :
Works with ReadWrite for everyone !!
LXCs:
I tried to mount the same share with fstab on Privilegied and UnPrivilegied LXC Turnkey Centos8.
I'm looged as root.
Privilegied Centos8 LXC
I tried x2 different mounts so I created x2 directories :
Coresponding mounts in fstab:
Results:
None of the mounts works.
UnPrivilegied Centos8 LXC
I tried x2 different mounts so I created x2 directories :
Corresponding mounts in fstab:
Results:
None of the mountsworks.
I tried to integrate the gid uid in the fstab :
Results
But no mounts either.
Thanks in advance for your help.
EDIT : THE SOLUTION thanks to Wolfgang :
First you can mount CIFS shares in a LXC ONLY if it's Privilegied.
You MUST untick "Unprivilegied Container" when creating the LXC
After creation you start the LXC, you have to modify Feature in Proxmox/Your LXC Option/Feature: adding CIFS capability:
you log in as root/sudo and install cifs-util :
Once done edit the LXC's fstab :
Mount the share on your LXC :
And voilà !
You got a fully Read-Write share mounted on your LXC.
Once again a huge thanks for this product, and for the support team !
Hello,
I'm installing Proxmox 6.1-5 to replace several servers, and enjoy the possibility of using LXC and virtualization.
Scénario :
One VM to offer fileserver services SMB/CIFS : OpenMediavault or Linux.
LXC Turnkey Centos 8 : to use docker.
Mint Cinnamo VM : to work
Other VM for services.
The scenario exclude the use of smb/cifs share mounted on Proxmox host that will link to LXC as cifs/smb share are provided by a VM hosted on proxmox.
The cifs/smb shares won't be available before OpenMediavault VM is up and running, making Proxmox mounts fail.
- Mounting shares to Mint VM works successfully.
- I try to connect LXC Turnkey Centos 8 to shares but I ain't achieve it.
Mint VM
To test the mount, I tried to mount SMB/CIFS share from Mint VM terminal to an existing Linux file server and it worked flawlessly.
To make the mount reboot proof I used it in fstab :
Code:
monsignore@monsignore-Standard-PC-i440FX-PIIX-1996:~/mnt$ sudo cat /etc/fstab
# /etc/fstab: static file system information.
......
//192.168.222/shared /home/monsignore/mnt cifs username=xxxxxxxxxxxxxx,password=xxxxxxxxxxxxx,rw,users,dir_mode=0777,file_mode=0777 0 0
Works with ReadWrite for everyone !!
LXCs:
I tried to mount the same share with fstab on Privilegied and UnPrivilegied LXC Turnkey Centos8.
I'm looged as root.
Privilegied Centos8 LXC
I tried x2 different mounts so I created x2 directories :
Code:
[root@CentosPrivilegied media]# ls -lan /media
total 16
drwxr-xr-x 4 0 0 4096 Jan 27 13:03 .
drwxr-xr-x 19 0 0 4096 Jan 27 06:53 ..
drwxr-xr-x 2 0 0 4096 Jan 26 11:46 shared1
drwxr-xr-x 2 0 0 4096 Jan 27 13:03 shared2
[root@CentosPrivilegied media]# ls -la /media
total 16
drwxr-xr-x 4 root root 4096 Jan 27 13:03 .
drwxr-xr-x 19 root root 4096 Jan 27 06:53 ..
drwxr-xr-x 2 root root 4096 Jan 26 11:46 shared1
drwxr-xr-x 2 root root 4096 Jan 27 13:03 shared2
Coresponding mounts in fstab:
Code:
[root@CentosPrivilegied media]# cat /etc/fstab
//192.168.1.222/shared /media/shared1 cifs username=xxxxxx,password=xxxxxx,rw,users,dir_mode=0777,file_mode=0777 0 0
//192.168.1.222/shared /media/shared2 cifs username=xxxxxx,password=xxxxxx,uid=0,gid=0,iocharset=utf8,noperm 0 0
Results:
Code:
[root@CentosPrivilegied media]# mount -a
mount: /media/shared1: permission denied.
mount: /media/shared2: permission denied.
None of the mounts works.
UnPrivilegied Centos8 LXC
I tried x2 different mounts so I created x2 directories :
Code:
[root@Docker-Centos media]# ls -lan /media
total 16
drwxr-xr-x 4 100000 100000 4096 Jan 27 13:09 .
drwxr-xr-x 19 100000 100000 4096 Jan 27 06:51 ..
drwxr-xr-x 2 0 0 4096 Jan 27 13:09 shared1
drwxr-xr-x 2 0 0 4096 Jan 27 13:09 shared2
[root@Docker-Centos media]# ls -la /media
total 16
drwxr-xr-x 4 100000 100000 4096 Jan 27 13:09 .
drwxr-xr-x 19 100000 100000 4096 Jan 27 06:51 ..
drwxr-xr-x 2 root root 4096 Jan 27 13:09 shared1
drwxr-xr-x 2 root root 4096 Jan 27 13:09 shared2
Corresponding mounts in fstab:
Code:
[root@CentosPrivilegied media]# cat /etc/fstab
//192.168.1.222/shared /media/shared1 cifs username=xxxxxxxxxxx,password=xxxxxxxxxxx,rw,users,dir_mode=0777,file_mode=0777 0 0
//192.168.1.222/shared /media/shared2 cifs username=xxxxxxxxxxx,password=xxxxxxxxxxx,uid=0,gid=0,iocharset=utf8,noperm 0 0
Results:
Code:
[root@Docker-Centos media]# mount -a
mount: only root can use "--all" option (effective UID is 100000)
None of the mountsworks.
I tried to integrate the gid uid in the fstab :
Code:
[root@CentosPrivilegied media]# cat /etc/fstab
//192.1681.222/shared /media/shared1 cifs username=xxxxxxxxxxx,password=xxxxxxxxxxx,uid=100000,gid=100000,iocharset=utf8,noperm 0 0
//192.1681.222/shared /media/shared2 cifs username=xxxxxxxxxxx,password=xxxxxxxxxxx,uid=101001,gid=101001,iocharset=utf8,noperm 0 0
Results
Code:
[root@Docker-Centos media]# mount -a
mount: only root can use "--all" option (effective UID is 100000)
Thanks in advance for your help.
EDIT : THE SOLUTION thanks to Wolfgang :
First you can mount CIFS shares in a LXC ONLY if it's Privilegied.
You MUST untick "Unprivilegied Container" when creating the LXC
After creation you start the LXC, you have to modify Feature in Proxmox/Your LXC Option/Feature: adding CIFS capability:
you log in as root/sudo and install cifs-util :
Code:
[root@Centos-Docker shared]# yum install cifs-utils
Once done edit the LXC's fstab :
Code:
[root@Centos-Docker shared]# vi /etc/fstab
//192.168.1.XXX/shared /media/shared cifs username=xxxxxxxxxxxxxx,password=xxxxxxxxxxxx,rw,users,dir_mode=0777,file_mode=0777 0 0
Mount the share on your LXC :
Code:
[root@Centos-Docker shared]# mount -a
And voilà !
Code:
[root@Centos-Docker shared]# mount |grep 222
//192.168.1.222/shared on /media/shared type cifs (rw,nosuid,nodev,noexec,relatime,vers=3.1.1,cache=strict,username=monsignore,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.222,file_mode=0777,dir_mode=0777,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1)
[root@Centos-Docker shared]#
You got a fully Read-Write share mounted on your LXC.
Once again a huge thanks for this product, and for the support team !
Last edited: