I have a large collection of movies and TV Shows on DVD and BluRay that I am not keen on just throwing away, there was a lot of money invested in these over the years but I also don’t want to have to keep them on a shelf gathering dust. Around 2016 I decided to burn them all to disk and I setup a workflow on my Mac using MakeMKV, Handbrake, Hazel and Subler and over a period of several months I ripped close to 200 movies which are now all housed on my Unraid NAS and shared via SMB to the home network.
Over the years I’ve toyed at trying to get Plex to work locally to play these, on a smart TV, on my PC, even my iPad and Apple TV, anywhere really, but I’ve had little success and even when I have managed to get the apps to find and download the movies, playing them has been incredibly laggy and the video and sound never synced properly.
So here we are in 2025 almost ten years since I first started, trying again. This time I am using Proxmox and an LXC. The attempt is as much to learn a bit about LXC and mounting shares as much as it is actually hoping to get Plex to work. The journey started with an article published by GeekBITZone linked at the foot of the page. It is a really good walkthrough of the process to create an LXC in Proxmox, install and connect the Plex Media Server, but they use a privileged container and I wanted to try and use an unprivileged one given that I work in Cyber Security… least privilege and all that.
At a high level these are the steps, but the article has much more detail and pics.
- Download a suitable Linux Template (I used Debian 12)
- Create a CT (use the Create CT Button)
- Choose unprivileged Container and configure as necessary (see the note below regarding unprivileged container permisisons
- Logon in to the container console and update the OS using:
-
apt update && apt upgrade
-
- Install curl and gnupg:
-
apt install curl gnupg -y
-
- Add the curl GPG key:
-
curl -sS https://downloads.plex.tv/plex-keys/PlexSign.key | gpg --dearmor | tee /usr/share/keyrings/plex.gpg > /dev/null
-
- Add there Plex repository:
-
echo "deb [signed-by=/usr/share/keyrings/plex.gpg] https://downloads.plex.tv/repo/deb public main" > /etc/apt/sources.list.d/plexmediaserver.list
-
- Install the Plex Media Server:
-
apt update && apt install plexmediaserver -y
-
- Reboot the container
Now we need to check Plex is running, and connect it to a Plex account.
- Login to the container as root using the password set when you built it.
- Verify that Plex is running
systemctl status plexmediaserver
- Note the container IP Address using
ip addr
- Open a browser and navigate to https://<ip address>:32400/web
- Sign in to Plex or create an account
- Give your server a friendly name
- and now we need to create and mount some libraries
As I mentioned I have all my media on my Unraid server so I don’t want to copy them to the Proxmox host and definitely don’t want to store them all in the container, so I chose to mount them Unraid share on the Proxmox host and then pass that through to the LXC. because I am using an unprivileged container I needed to do things slightly differently than mentioned in the article
There is a really good channel on YouTube called Automation Avenue, he has some fantastic Proxmox tutorials and videos and this one is a really good explanation about permissions https://www.youtube.com/watch?v=CFhlg6qbi5M I tried to embed the video at the bottom of the page, but Youtube have made it more and more difficult to you’ll need to follow the link which will open a new tab.
In short, an unprivileged container doesn’t match the root user uid and gid when it attempts to access the host file system so it isn’t authenticated. The uid and gid are offset by 100,000 – The Plex server use an account named Plex, you can find the id of this account by simply typing id plex in the container shell. Mine showed the uid was 999 and the gid was 996 so when I mounted the external SMB share on proxmox I added these as options
mount -t cifs -o user=<smb share username>,uid=100999,gid=100996 //<hostname or IP Address>/sharename
Note here that we have mounted the share using the uid and gid of the Plex user from the container offset by 100,000. Now when we mount that inside the container they will match and the connection will be made by a fully authenticated user with full read and write permissions assuming the user=<smb share username> has those on the target share.
Create the Libraries in Plex
- Browse to your Plex instance using https://<hostname or IP Address>:32400/web and login if required
- If you are not prompted to add a library, click on the spanner and navigate to Manage > Libraries from the left menu
- Use the Add Library button
- Choose the type of Library > Click next
- Click Browse for Media Folder > choose the folder you mounted using pct from the video by Automation Avenue > click Add
- If necessary click Scan Library Files
Your media should start to populate in the library in Plex
I have stopped here for now. I have access thanks to GeekBITZone and Market, from Automation Avenue for excellent articles and tutorials to help me manage something I’ve struggled with until now.
To Do:
- make the mount in proxmox persist over a reboot
- investigate GPU passthrough to the LXC. I don’t have an iGPU only one GTX1080i in a PCIe slot but it seems doable to an LXC without running headless
Links
- Automation Avenue – https://www.youtube.com/@Automation-Avenue
- GeekBitZone – https://www.geekbitzone.com