Configure Proxmox

Before starting it’s a good idea to upgrade our installation with the latest packages using

apt update && apt dist-upgrade

Since LXC conatiners use the host’s kernel we’ll need to load all the drivers for ut GPU on the host (Proxmox) itself

Install GPU Drivers

Intel

If you want to use the Intel GPU in your processor the drivers are most probably installed and activated already by default and if so you can skip to the next step.

You can check if your card is detected and usuable if you see any device with the prefix renderD with the following command output

ls /dev/dri | grep renderD

AMD

Install the amdgpu open-source AMD Drivers

apt update && apt install firmware-amd-graphics libgl1-mesa-dri libglx-mesa0 mesa-vulkan-drivers xserver-xorg-video-all

Restart your system to load the new drivers

Nvidia

To install the latest Nvidia drivers on proxmox first we need to add the debian backports repo to our server

Add the following to your /etc/apt/sources.list

# buster-backports
deb http://deb.debian.org/debian buster-backports main contrib non-free

Now refresh your package databse and install the Nvidia drivers

apt update && apt install -t buster-backports nvidia-driver firmware-misc-nonfree

Now reboot your system to load the new drivers.

Optionally Apply this Patch to remove some of the driver limitaions.

Create LXC Container

Now we can create a new container for our Media Server install.

Follow This guide to setup a conatiner and docker for our Media Server install.

NOTE: This method in untested with unpriveleged containers, You need to use a Priveleged container for this.

If installing Plex you can skip the docker install and just create a regular Priveleged container like you normally would.

Update your conatiner with the latest packages.

Passthrough Your GPU

First identify the device you want to passthrough, List all devices using

ls -l /dev/dri

Usually if the CPU has a builtin GPU it’d the first in my case it was RenderD128 and all subsiquent would be PCI e.g RenderD129 would be your GPU in your first PCI slot.

We’ll passthrough our inbuilt QuickSync GPU in our Intel Processor which is RenderD128 and card0

Add the following lines to the config file of your conatiner config file located in /etc/pve/lxc/, in my case it’s /etc/pve/lxc/111.conf

lxc.cgroup.devices.allow: c 226:* rwm
lxc.mount.entry: /dev/dri/<Your card> dev/dri/card0 none bind,optional,create=file
lxc.mount.entry: /dev/dri/<Your RenderD> dev/dri/renderD128 none bind,optional,create=file

Example

lxc.cgroup.devices.allow: c 226:* rwm
lxc.mount.entry: /dev/dri/card0 dev/dri/card0 none bind,optional,create=file
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file

Reboot the container for the changes to take effect.

Confirm that the devices are available inside the container with ls -l /dev/dri/

Install Media Server

Plex

Head over to the Plex Server Download page, Download and Install the appropriate package for your conatiner OS.

You can also add the Official Plex repos to some of the supported Distros for easier installation and updates

Debian/Ubuntu Linux

Add the repo by running

apt update && apt install curl gpg2
echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -

Then simply install the Plex Server package using

apt install plexmediaserver

Arch Linux

Install the plex-media-server from the AUR

Fedora Linux

Install the Plex Server Package from the above link and install it

Enable the repo by changing the enabled option to 1 in /etc/yum.repos.d/plex.repo

That file should look something like this

[PlexRepo]
name=PlexRepo
baseurl=https://downloads.plex.tv/repo/rpm/$basearch/
enabled=1
gpgkey=https://downloads.plex.tv/plex-keys/PlexSign.key
gpgcheck=1

Jellyfin

Head over to the Official Install Documentaion and install Jellyfin using the Docker method.

Let me know if i missed anything.