Unable to Mount 3rd NFS Share in LXC Container on Proxmox Server
Proxmox servers are often used to run multiple virtual machines (VMs) and Linux containers (LXCs) that provide various services. In this article, we will discuss the issue of mounting NFS shares in an LXC container running on a Proxmox server, specifically when trying to mount the third NFS share.
Prerequisites
Before we dive into the issue, let's go over the prerequisites:
- A Proxmox server with one or more LXC containers
- A TrueNAS Scale server running NFS shares
- The LXC container should have the necessary tools installed to mount NFS shares, such as the
nfs-commonpackage
Mounting NFS Shares in an LXC Container
Mounting NFS shares in an LXC container on a Proxmox server is a straightforward process. You need to edit the container's configuration file, add the NFS share details, and restart the container. However, when trying to mount the third NFS share, users may encounter an issue where the share is not mounted.
The Issue
The issue arises due to a limitation in the LXC container's network namespace. The container's network namespace has a limited number of file descriptors, which limits the number of NFS shares that can be mounted in the container. By default, LXC containers have a limit of 1024 file descriptors, which is not enough to mount more than two NFS shares.
Solution
To solve this issue, you need to increase the limit of file descriptors in the LXC container's network namespace. You can do this by editing the container's configuration file and adding the following line:
This line allows the container to create and manage network devices, which increases the limit of file descriptors. After adding this line, restart the container, and you should be able to mount the third NFS share without any issues.
References
- Mounting NFS shares in LXC container
- Why does my LXC container only have 1024 file descriptors?
- lxc.conf(5)
Note: The above references are provided for informational purposes only and are not affiliated with or endorsed by the author or the website where this article is published.
End of article.