Mount an SMB share and use iGPU on an unprivileged Debian 12 LXC container in Proxmox
Procedure¶
Prerequisites:
Create an unprivileged Debian 12 LXC container.
Inside the LXC container, use the root user to create a non-root user. In this example the user is added to the sudo and docker groups after installing Docker inside the LXC container.
Change the user password as needed.
This user's default UID:GID will be 1000:1000. If not, create it with:
Take note of this UID:GID as it will be used to map the share in Proxmox. The share itself can live on another system; here an unRAID VM on the same host is used.
SMB share¶
On the Proxmox host¶
Create a user that can be mapped from the host to the LXC container. Without this step, the share ends up read-only inside the LXC container.
Proxmox maps the users and groups from the host to the LXC containers starting at UID:GID=100000:100000.
The created ismael user then:
- Inside the LXC container UID: 1000
- Inside the host UID: 101000
Create a group on the host with GID=101000 that will own the directory created for the SMB share
Create the same user that will be used inside the LXC container but with the right UID:GID combination
Make a directory for the share
Change the directory's owner to the previously created user
Modify the /etc/fstab file to mount the SMB share on the directory we created
Copy this line inside the nano editor for /etc/fstab (note the guest part, as this SMB share has no password set)
For shares that require a password:
//192.168.0.10/media /mnt/media cifs username=<username>,password=<password>,rw,uid=1000,gid=1000,file_mode=0777,dir_mode=0777 0 0
Reload the changes to /etc/fstab before mounting
Create a mountpoint in your LXC container pointing to the created share directory
Start the LXC container and the share is mounted in /mnt/user/media, writable by the mapped user.
iGPU¶
Coming soon...