Proxmox LXC running Docker with NFS mounted storage, Help needed

Hey L1T,

I have decided to try something new within Proxmox.

It started as a goal of sharing a GPU between multiple debian 12 LXC (This has been acheived :tada:)
Followed by learning how to map NFS shares to an unprivileged LXC (This has been achieved :tada:). I am able to read and write with the share after mapping permissions.

I’m now trying to get my docker containers to run off my NFS share instead of the local drive for the LXC. This was working in my docker VM previously and permissions have remained the same between my users. However considering the mapping between the Proxmox host and LXC it still may be a permissions issue but goes above my knowledge base.

I have confirmed docker containers run locally for the LXC with no issues. When mapping the docker to the NFS share I get an error message:

Error response from daemon: error while creating mount source path ‘/nfs/heimdall2/config’: mkdir /nfs/heimdall2: permission denied

Any suggestions or advice would be amazing!

I was able to solve this issue by remaking my LXC container and paying careful attention to when I added NFS mounting points to the container.

It appears I had to ensure the user permissions were mapped in a boot prior to adding the NFS mount point in the LXC container.

I hope this is able to help someone in the future.

Would you mind sharing the guide(s) you used to get NFS working properly in an unprivileged container? It’s on my to-do list to slowly migrate my privileged containers to unprivileged ones. When you say you had to map the user permissions prior to adding the NFS mount point, are you handling that all in the lxc .conf file or are you mapping NFS drives at boot using fstab or systemd?

Thanks!

Maybe you don’t have permissions to create folders in the nfs root path? You can start 1 folder deeper and give the correct permissions to that folder.

This is the guide I used to mount NFS shares in my LXC.

Where I had issues was adding my mp0 etc to the LXC before ensuring that the user permissions were added as per the guide. For some reason it wasn’t updating when both were done at the same time.

I also had to verify the NFS server and NFS user matched. Due to reorganizing my shares there may have also been incorrect/out-of-date permissions on the server side, just something to watch out for in your set up.

1 Like