A couple of years ago, I took the plunge, bought an Intel NUC, a ton of external storage, and built a Plex server for all my media (literally hundreds of DVD’s and Bluray discs). It has been chugging along well, dishing up what I want, when I want it.
But, I took the easy route when I set it up originally. I installed Ubuntu desktop on my then new NUC, as that made the configuration trivial. Setting up Wifi? Easy peasy. All the published tutorials on getting Plex up and running. Boffo.
There is a downside though, since it is a desktop focused distribution, it had some limitations. The first being the graphical desktop. I could not get it to boot up and just “work”. I had to plug in the HDMI cable, insert the wireless keyboard and mouse dongle, and log in to the system. Otherwise, networking and the plex service wasn’t started, and ergo, no Plex.
I logged in via SSH a couple times a week to run updates, but about once a month or so, an update touched some part of the kernel that required a complete reboot to work, and I would have to go through this ritual.
Second was that as a desktop distro, there was a ton of crap on it that really wasn’t needed. Sure, I had plenty of internal storage (256GB SATA card), but it had a ton of not useful processes running in the background. Not awful, but messy. I only use this server for Plex, and nothing else at the moment, so it just bugged me.
Attempt 1 – turn a desktop into a server
I did some googling, and found a few tips to turn off the GUI, and return the system to a headless system. Thinking that this would be sufficient, I dove in.
Alas, it was merely moving from run level 5 to run level 3, and while that did disable the GUI overhead, it still didn’t perform as expected. I still needed to connect a monitor and keyboard to the system and log in before networking was enabled.
I get why this is so, it prevents user workstations from being vulnerable before there is a user logged in. But it isn’t a server behavior, and it didn’t meet my needs.
At this point, I knew that I needed to reinstall with the ubuntu server ISO…
Attempt 2 – Install Ubuntu Server at my desk
Getting the image, and making the boot USB stick was trivial. This has gotten so easy, that one would think that if Linux was ever going to be widely adopted on the desktop, it would be huge (like The Beatles huge), but it isn’t and I doubt that it ever will.
I moved my HDMI cable and plugged in my keyboard dongle, and rebooted. I did a major gulp when I was prompted to wipe and reinstall on my internal SSD drive.
Then I came to the part about the networking. Turns out that the server install package doesn’t have native wifi extensions. It is expecting a wired connection.
Fuck. Fuck-fuck-fuckety fuck.
So I continue and I figure I will go into my living room and just plug in to my router after it is all done.
But that is a big fail burger, as no networking stack was installed and configured.
A more knowledgeable Linux person than me could have recovered from this, and made it work. But I am a hack, and I know it. Fortunately, the prepared USB stick was on hand, and reinstalling was easy, so on to …
Attempt 3 – Booting shenanigans
Got the stick in, rebooted, successfully installed and configured with networking. It took longer for the first pass of security updates (done by the installer before the first boot), and I was ready.
But, there was an issue. Apparently the boot code for Ubuntu server and the Intel NUC are weird. For some reason, no matter how I tweaked the BIOS settings, it kept trying to use the Intel Netboot protocol to start.
I am teleported back to the world of the 1990’s and having to figure out what magic incantation will satisfy the BIOS gods. I sure as hell don’t miss that.
About 2 hours of fucking around, fiddling, failing, flailing, and the sort, and I finally have a system that boots up, and does it unattended. It comes up, networking works, and I am ready to install the goodies.
Installing the goodies
Fortunately, there are several excellent tutorials on the web for installing Plex, but most of them are focused on using a desktop version of Linux. But I found a few, one at Digital Ocean for installing it on a droplet (I thought about that for a few nanoseconds, then I calculated how much my 4TB of media files would cost to store in the cloud every month, and backed away from the edge.
I followed the instructions I found at:
It starts with the usual how to install it on a desktop install, but further down she (I presume it is a “she”, hence the Linux Babe moniker) has detailed instructions for how to install it on a server.
The instructions work. Perfectly.
Then I learned another lesson about the server linux difference from the desktop. If you plug in an external disk, it doesn’t automount. Fuck. Now I need to remember (read: go googling) for how to create a mountpoint, modify fstab, and get it to work. The quirk is that you really need the UUID of the drive/partition, not the /dev/sdbx name.
But, at this point, I had the server and the disk in my living room, connected via ethernet to my router (good) and I can do all this supplemental work from my office via SSH.
Got the drive setup, repeated the setup of Plex, and voilá, I have a server. Added my libraries, and tested, all is well.
Since I don’t like typing the IP address of my NUC, I want to use local name resolution. Had to install the correct service to do the bonjour like resolution. One install, and poof, it works. Now it is gander-nuc.local within my network.
Since I use SSH a lot, and I prefer to have key based authentication (because I am a lazy bastard), I did the ssh-copy-id to insert the keys from my mac mini, and macbook pro.
Overnight, Plex completed the indexing. I also setup a recurring rsync to archive all the media files on my mondo Drobo box. Right now, it is mirroring the 4+TB of files to my storage unit.