Since I installed Proxmox for my small home server, I struggled a bit with nas shares due to user ownership and permissions, but after searching a bit I encountered a tutorial (I can remember where) to do it easily. So, before I forget it I will write here how I nailed it.
It works to share a mountpoint from Proxmox to the LXCs, so if you have an ssd/hdd in that directory, it will share the whole disk.
It works by the following assumption:
- Proxmox maps group 110000 in Proxmox to group 10000 in the LXC.
- Proxmox maps user 101000 in Proxmox to user 1000 in the LXC.
On Proxmox
Create a nas
user that will be shared across proxmox and the LXCs.
|
|
Mount the ssd/hdd
Make sure you already have the ssd/hdd formated, so mount it:
|
|
Replace /dev/sda2
with the partition you will mount and share with the LXCs.
Change ownership of the mountpoint to the nas user.
|
|
On the LXCs
On each LXC you want to create a nas share, create the nas_shares
group and the nas
user that will be mapped to Proxmox.
From inside the LXC, run:
|
|
Stop the container and from inside Proxmox, run this to map the mountpoint to the lxc:
|
|
Replace lxc-number
whith the number of each lxc you want to share the mountpoint.
Restart the LXC and the mount point will be already available to use. Follow usual samba configuration from inside the LXC.
If you found this content useful, please support me:
BTC: 1E2YjL6ysiPxRF4AEdXChpzpesRuyzgE1y