Skip to main content

Plex Media Server on Ubuntu Under Proxmox VE

Possible duplicate content with plex-ubuntu-proxmox

Server Hardware

I'm using a Dell R610 server with 64MB of memory.

Dell iDRAC 6 Enterprise

The DRAC provides a means for out-of-band management of the R610. I configured the DRAC to have an IP address of 192.168.88.30.

Proxmox VE Setup

Initial Install

Router, configured as bridge w/ static IP: 192.168.88.9 DHCP off, GW: 192.168.1 DRAC5 card: 192.168.88.10 PVE eno1 192.168.88.20 / server.local

Install on ZFS RAID 0 sda, sdb Note that this creates the pool 'rpool' with /dev/sda and /dev/sdb. These devices are assigned based on when and where drives are inserted/removed. Therefore, it's important not to change device locations. More later.

'zpool list' Shows 136G mirror online

'zpool status' Shows status of all pools

'zfs list' Shows all zfs filesystems --> the single pool 'rpool' plus the other zfs filesystems that PVE created for its use.

Install two 8TB ata-WDC_WD80EFAX-68LHPN0_7SGJ4H6C /dev/sdd ata-WDC_WD80EFAX-68LHPN0_7SGK1PGC /dev/sde

zpool create -f tank mirror \ ata-WDC_WD80EFAX-68LHPN0_7SGJ4H6C\ ata-WDC_WD80EFAX-68LHPN0_7SGK1PGC

https://forum.level1techs.com/t/how-to-create-a-nas-using-zfs-and-proxmox-with-pictures/117375

zfs create tank/vmsdata

zfs set compression=on tank

Tell PVE to pickup the storage

pvesm zfsscan

Tell PVE to use tank/vmdata for VM and Container storage. In PVE UI, Datacenter->Storage-Add
tank/vmdata for 'Disk image, Container'

Confirm that PVE has it: cat /etc/pve/storage.cfg

To remove the storage from PVM: in UI: Datacenter->Storage->Remove

Then remove it from zfs: zpool destroy tank

pvesm zfsscan

Raw disk passthrough to VM.

Find the two 8TB disks by serial number: ls /dev/disk/by-id ata-WDC_WD80EFAX-68LHPN0_7SGJ4H6C ata-WDC_WD80EFAX-68LHPN0_7SGK1PGC

Note that 'ls /dev/disk/by-id' will show each disk ID and a link to the /dev/sd? device it is associated with.

Create FreeNAS VM on PVE. Install FreeNAS. After install, shutdown VM.

Add the two devices to the VM as passthrough. Note that '100' is the ID of the FreeNAS VM. qm set 100 -virtio2 /dev/disk/by-id/ata-WDC_WD80EFAX-68LHPN0_7SGJ4H6C qm set 100 -virtio3 /dev/disk/by-id/ata-WDC_WD80EFAX-68LHPN0_7SGK1PGC

Confirm via 'cat /etc/pve/qemu-server/100.conf'

Boot the FreeNAS VM and configure.

Configure FreeNAS.

When it reboots, use PVM to access the console.

Choose 1) to configure the network interface. Choose to configure the em0 interface. Answer 'no' to 'reset?'. 'no' DHCP 'yes' configure IPv4 static IP 192.168.88.21/24 'no' configure IPv6

Add 192.168.88.1 as the gateway.

Access the system now via http://192.168.88.21 for the remainder of the configuration.

Skip the setup wizard. You can always run it later.

Storage->Volumes->ViewDisks and confirm the two 8TB drives are there.

Storage->Volumes->VolumeManager add mirrored volume consisting of both disks named 'vol1'

Storage->Volumes->ViewVolumes confirm that the volume exists.

Basic Ubuntu Server Install in a PVE VM

I installed Ubuntu Server 16 LTE.

Network Configuration

The network device that PVE provides to the Ubuntu VM is named ens18. I removed the ens18 configuration that was created during the install and replaced it with the following (in /etc/network/interfaces):

auto ens18
iface ens18 inet static
    address 192.168.88.32/24
    gateway 192.168.88.1
    dns-nameservers 192.168.88.1

This is a good reference, as is this.

Once this change is made, the following should make it take effect:

$ sudo ifdown ens18 && sudo ifup ens18

After the up/down i had intermittent problems with the IP disappearing and changing back to DHCP. Research said that there could be problems with starting/stopping interfaces and suggested reboot. After reboot, no problems.

Additional Tools

I also installed a few essential tools:

$ sudo apt-get install emacs-nox
$ sudo apt isntall smbclient

Media Shares

Since this is primarily being done to get a Plex Media Server up and running, access to media is, of course, a key part of the system.

Confirm Availability

I have a FreeNAS 11 server configured to provide media shares over SMB. The IP of the SMB server is 192.168.88.22.

Confirm that the media is available over SMB by:

$ smbclient -L //192.168.88.22
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.6.8-GIT-7a91926]

    Sharename       Type      Comment
    ---------       ----      -------
    media           Disk      Plex Media
    pub             Disk      Public files
    IPC$            IPC       IPC Service (FreeNAS 11 Server)
    khe             Disk      MacOS home directories
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.6.8-GIT-7a91926]

    Server               Comment
    ---------            -------
    FILESSMB             FreeNAS 11 Server

There is no point in proceding until the media share appears in the output.

Configure Ubuntu to Mount the Media

Create a Mount Point

Create a mount point for the media:

$ sudo mkdir /media/media

Mount the Media

I created a user 'guest' passwd 'guest' on FreeNAS. The FreeNAS share Media allows guest user (any guest, not just the above).

This will mount the share manually: sudo mount -t cifs //192.168.88.20/Media /media/media -o username=guest,password=guest

To automount at boot: https://help.ubuntu.com/community/Samba/SambaClientGuide https://ubuntuforums.org/showthread.php?t=288534 https://askubuntu.com/questions/228997/samba-share-mounting-in-read-only-mode

Put this in /etc/samba/user with chmod 0400: username=guest password=

Add the following to /etc/fstab

1) This is supposed to automount as the user 'guest', but I could not get it to work: //192.168.88.20/Media /media/media cifs credentials=/etc/samba/user,iocharset=utf8 0 0

2) This is supposed to automount as a 'guest' (user 'nobody' on FreeNAS), but I could not get it to work: //192.168.88.20/Media /media/media cifs guest,iocharset=utf8 0 0

3) I finally go this to work as the guest user created above: //192.168.88.20/Media /media/media cifs username=guest,password=guest,iocharset=utf8 0 0

sudo mount -a

Plex

https://support.plex.tv/hc/en-us/articles/235974187

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 - sudo apt-get update

sudo aptitude update sudo aptitude install plexmediaserver

browse to 192.168.88.41:32400/web to administer

Docker

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" sudo apt-get update sudo apt-get install docker-ce sudo usermod -aG khe # lets khe run docker without sudo

If on VM, reboot may be required for khe to be able to run without sudo.

Test: sudo docker run hello-world

Run docker at boot: sudo systemctl enable docker

DELL TOOLS

OpenManage Server Administrator Managed Node (Win 64bit), v8.3 Requires Windows Server 2008 or 2012 R2 http://www.dell.com/support/home/us/en/19/Drivers/DriversDetails?driverId=TK61C&fileId=3547081112&osCode=WS8R2&productCode=poweredge-r810&languageCode=en&categoryId=SM

Windows Server 2016 https://www.microsoft.com/en-us/evalcenter/

Dell Systems Service and Diagnostics Tools ISO, v7.0 http://www.dell.com/support/home/us/en/19/Drivers/DriversDetails?driverId=W0R66

Update Dell PE servers via bootable media / ISO. Linux distro + all firmware auto update all FW on system. 1.8GB in size? https://www.dell.com/support/article/us/en/19/sln296511/updating-dell-poweredge-servers-via-bootable-media---iso?lang=en

Check available drivers for your service tag on Dell Support page. One item is the Dell OS Driver Pack, which is apparently just drives for your specific machine. I think it must be like the previous, but smaller, since it only has drivers for one system. 100MB in size? http://www.dell.com/support/home/us/en/19/drivers/driversdetails?driverId=VC4GP