In case anybody out there is running a recent Debian (jessie or later), and has ever wondered how much of a hassle it would be to install Plex into a container to segregate it from the rest of your system: It turns out, it's not much of a hassle at all!

You can do something like I did here:

# as rootcd /var/lib/container/
mkdir plex
debootstrap --arch amd64 vivid plex http://archive.ubuntu.com/ubuntu/
# Set the root password for later
systemd-nspawn --directory plex
# Now you should be at a root prompt inside the container!
passwd
# and you can enter a new password.

Now you hold Ctrl and hit ] three times, and it'll kill the container host process.

# assuming you already have a bridge set up for your NIC and it's named lxcbr0:
systemd-nspawn --network-bridge=lxcbr0 --boot --directory plex

That'll get you a fresh minimal Ubuntu Vivid installation, perfect for installing Plex. You can safely ignore the systemd-journald errors on the first boot; updating to the latest packages will fix the errors.

You'll need to bring up the network inside the VM, so log in as root using the password you just set, and run:

dhclient host0

Then add the vivid-updates repo, and upgrade to the latest packages to fix the journald errors from vivid's starting state:

(If you don't have a Plex Pass, you can use the regular non-PlexPass repo, just substitute wheezy for plexpass in the above echo command. The wheezy name appears to be hilariously inaccurate, because it doesn't seem to even work on jessie anymore, but I digress.)

Now, hit Ctrl+]]] again, and stop the Plex server in the host, assuming it's on the same machine. You'll want to copy the Application Support folder from your existing Plex server (using these packages, the default location is in /var/lib/plexmediaserver/Library, but your OS may have it in a different place). Just make sure that you copy the Application Support folder into the /var/lib/container/plex/var/lib/plexmediaserver/Library on the host.

Look up the ID of the plex user inside the container. Mine didn't match between host and guest, so I ran:

If you have a static IP for your NIC, then you should definitely use ifconfig or ip addr add to configure lxcbr0 in the second part above using the same configuration you previously had on your NIC. You'll want to update your host's /etc/network/interfaces if you're on Debian or Ubuntu on the host system. (Basically just s/eth0/lxcbr0/g on the whole file, and add a new line under the iface lxcbr0 inet <> line that looks like:

bridge_ports eth0 # or whatever your NIC is

MAKE SURE THAT YOU USE THE brctl addif && syntax IF YOU'RE DOING THIS REMOTELY, OTHERWISE YOUR MACHINE WILL FALL OFF THE NETWORK LIKE A DRUNK.