<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Plex on juni&#39;s blog ٩(◕‿◕｡)۶</title>
    <link>/tags/plex/</link>
    <description>Recent content in Plex on juni&#39;s blog ٩(◕‿◕｡)۶</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Fri, 04 Aug 2023 00:00:00 +0000</lastBuildDate><atom:link href="/tags/plex/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Plex &amp; Proxmox</title>
      <link>/posts/4/proxmox-plex-container/</link>
      <pubDate>Fri, 04 Aug 2023 00:00:00 +0000</pubDate>
      
      <guid>/posts/4/proxmox-plex-container/</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&amp;hellip; &amp;amp; pulling files from an external SSD &amp;amp;/or an internal HDD. &lt;strong&gt;Yes, this was&amp;hellip; interesting.&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;h2 id=&#34;--so-why-did-i-write-this&#34;&gt;- So&amp;hellip; why did I write this?&lt;/h2&gt;
&lt;p&gt;My primary objective was to setup a home lab, which could do the following things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;run LXCs of various linux distros (Kali via external install, and CentOS via Proxmox template) &lt;strong&gt;[done]&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;run a Plex Media server, accessing both external SSD and internal HDD data &lt;strong&gt;[done]&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Setup a VPN for use in the server &lt;strong&gt;[done]&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Setup VPNs for containers &lt;strong&gt;[yet to do]&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Automatically pull files from various torrents safely and securely with Deluge (?), Sonarr, Radarr, and Prowlarr &lt;strong&gt;[yet to do]&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run my previously self-hosted Minecraft server &lt;strong&gt;[yet to do]&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;act as a NAS to store and backup family photos &lt;strong&gt;[for the future, if I upgrade hardware]&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I know that my use case is incredibly specific, but after scouring the web for guides on the various problems I had along the way, I was exhausted enough to pull together a guide of how I accomplished each of the above.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;This guide will focus on setting up a Plex Media server in a Proxmox container, which can access data from both an external SSD and an internal HDD.&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;h2 id=&#34;--prerequisites&#34;&gt;- Prerequisites:&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Installing Proxmox on a server&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;--setting-up-a-container&#34;&gt;- Setting up a container&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Download a template for the distribution of Linux you want to use.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Simple? Should be. Pick your desired flavour of Linux and it should be available via accessing your local volume [&lt;code&gt;local (juniproxmox)&lt;/code&gt; for me] and selecting &lt;code&gt;CT Templates&lt;/code&gt; &amp;gt; &lt;code&gt;Templates&lt;/code&gt;. However, &lt;em&gt;make sure what you&amp;rsquo;re selecting is &lt;strong&gt;actually a LXC&lt;/strong&gt;, and not another version of Ubuntu/Debian (otherwise it will run like a VM inside of a container. And yes, that means it&amp;rsquo;s s l o w)&lt;/em&gt;. The difference is somewhat explored in the folllowing &amp;lsquo;shallow dive&amp;rsquo; of sorts, and practically illustrated within Proxmox in Figure 2.&lt;/p&gt;
&lt;blockquote&gt;
&lt;h3 id=&#34;testing-the-waters-1-lxc-vs-vms&#34;&gt;&lt;strong&gt;Testing the waters #1: LXC vs VMs.&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;From what I understand, LXCs are essentially lightweight VMs, which share the kernel (lowest-level software interfacing with computer hardware) with the host OS. In my case, Proxmox (based on Debian Linux) will share its kernel with an installed LXC (in this case, CentOS 9 Stream), allowing the LXC to run significantly faster than a VM by having access to the same kernel. However, I am unsure if you can run a LXC of Debian/Ubuntu on top of existing Debian/Ubuntu infrastructure, as I haven&amp;rsquo;t been able to easily find LXC images for these online. However, I am most likely very much misunderstanding the nature of LXCs in general and am missing something obvious, so if anyone knows, please feel free to enlighten me by contacting me ~&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Figure 1: Finding CT Templates&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../posts/4/e50f054c-0ace-44ed-bb6e-96fe76c6619b.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Figure 2: LXC Images vs Standard Image&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../posts/4/069bb70d-9876-4d23-bcd9-f770b78adedc.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;After the CT template has been downloaded, installing is fairly straightforward.&lt;/strong&gt;
I followed the following video to get up to speed on what was recommended for a container install.&lt;/p&gt;
&lt;p&gt;Here are the specs for my installation of CentOS 9 Stream, running a Plex Server which would have 2-3 users MAX (these are only testing values, take them with a grain of salt!):&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../posts/4/2434eda3-0247-48df-947b-9614ee44e17d.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../posts/4/5d7670d4-5dc4-40d8-8de1-a02feb276966.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Once the container has been setup and you can access the console (visuals included in above video, it&amp;rsquo;s pretty straightforward), login using root (and preferably setup a lower privilege user if you&amp;rsquo;re using the system for important things) and your container is ready to use!.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id=&#34;--installing-plex-media-server&#34;&gt;- Installing Plex Media Server:&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;~ to be written ~&lt;/em&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;--passing-usbexternal-devices-to-lxc&#34;&gt;- Passing USB/External Devices to LXC:&lt;/h2&gt;
&lt;p&gt;Now, for my use case, I wanted to use an external SSD containing media files as a sort of &amp;lsquo;attached storage device&amp;rsquo; and have my Plex media server access and make the files streamable. However, doing so is a little complicated. It&amp;rsquo;s covered rather well in &lt;a href=&#34;https://www.youtube.com/@virtualizeeverything&#34;&gt;Virtualize Everything&amp;rsquo;s&lt;/a&gt; series of videos, but it can be confusing as there are quite a few ways of doing it, depending on one&amp;rsquo;s use case.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;My use case: Pass an External Device to a LXC WITHOUT ERASING DATA FROM IT, to transfer/access files on the External Device.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Based on the following video: &lt;a href=&#34;https://www.youtube.com/watch?v=6oripI7F8tw&#34;&gt;Add USB storage to Proxmox (CLI)&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Note: The term &amp;lsquo;SSD&amp;rsquo; can be used interchangeably with &amp;lsquo;External HDD/USB&amp;rsquo; &amp;ndash;&amp;gt; this should work for all removable storage solutions.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Plug in your USB to the server (in my case, my brother&amp;rsquo;s old laptop). Nagivate to &lt;code&gt;&#39;your home node&#39; (juniproxmox)&lt;/code&gt; -&amp;gt; &lt;code&gt;disks&lt;/code&gt;. Here is a display of all of the functioning devices connected to your machine. My laptop has an internal HDD (listed as &lt;code&gt;sda&lt;/code&gt;), and an internal SSD (used as the boot drive, &lt;code&gt;sdb&lt;/code&gt;). I also have a USB plugged in to the device, occupying &lt;code&gt;sdc&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Thus, my SSD is &lt;code&gt;sdd&lt;/code&gt;, which checks out given it&amp;rsquo;s been identified as &lt;code&gt;SSD&lt;/code&gt; with &lt;code&gt;1.00TB&lt;/code&gt; of storage. It is best practice to have the drive using GPT, although I will be attempting to use one still using MBR, as it has worked before for me.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../posts/4/212d77a6-88cd-47d8-9c21-d186f24e2da4.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;--formatting-drive-to-use-gpt---guid-partitioning-table&#34;&gt;- Formatting drive to use GPT - GUID Partitioning Table.&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;On your main node, open the shell and use &lt;code&gt;fdisk -l&lt;/code&gt; to list all available disks on the system in the CLI.&lt;/p&gt;
&lt;p&gt;After the text has been printed, look near the bottom for your chosen device, in my case &lt;code&gt;sdd&lt;/code&gt;. It&amp;rsquo;s product name and actual usable size (smaller than but close to its advertised size) should be listed too. Take note of the device&amp;rsquo;s identifier, which includes its location on the system. For me, it&amp;rsquo;s listed under &amp;lsquo;Device&amp;rsquo; at the bottom, as &lt;code&gt;/dev/sdd1&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../posts/4/d7352649-ef16-4aeb-b109-5d164023e67e.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now we know the path to the device, we need to make a folder on our home system for it to be accessed from. I think of this as creating its new address - the SSD has gone from floating around in the ether, homeless, and we&amp;rsquo;re now making a directory on our system for it to call home. I poked around a bit using the &lt;code&gt;cd&lt;/code&gt; (&lt;code&gt;cd&lt;/code&gt; = &lt;strong&gt;change directory&lt;/strong&gt; - essentially how you traverse your Linux system in the CLI) and &lt;code&gt;ls&lt;/code&gt; (&lt;code&gt;ls&lt;/code&gt; = &lt;strong&gt;list contents in current directory&lt;/strong&gt;) commands, before deciding to make a new directory in &lt;code&gt;/mnt/pve/&lt;/code&gt;, called &lt;code&gt;EXT_SSD&lt;/code&gt;. I suggest navigating to where you&amp;rsquo;d like the directory to be and &lt;strong&gt;then&lt;/strong&gt; making it, as not all system&amp;rsquo;s file structures are the same.&lt;/p&gt;
&lt;p&gt;Once I found the desired folder, create the directory using:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mkdir YOUR_DIRECTORY_NAME_HERE&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../posts/4/f1562673-1712-4dab-8f58-dfbc0106998a.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now, we need to mount the device so that the system can access its contents. This command takes the following form:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;mount [physical device identifier] [new folder &#39;home&#39;]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This is essentially telling the system to point my SSD (which has the identifier &lt;code&gt;/dev/sdd1&lt;/code&gt;, as we identified in step 1) to live in the directory &lt;code&gt;/mnt/pve/EXT_SSD/&lt;/code&gt; so its contents can be accessed by my home user.&lt;/p&gt;
&lt;p&gt;To test if it worked, I navigated to its new home with &lt;code&gt;cd mnt/pve/EXT_SSD/&lt;/code&gt; and then listed its contents and&amp;hellip; success! I can now access my files on an external SSD within Linux.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../posts/4/4a1ee575-6f6a-4ca2-a52f-045261e4163b.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Important Note:&lt;/strong&gt; Every time my system reboots, the device needs to be manually re-mounted (aka repeating step 3) in order to access the files on the SSD. To avoid having to do this, I modified the crontabs file (specifies tasks to be run ahead of time/periodically) using &lt;code&gt;sudo crontabs -e&lt;/code&gt; . I added &lt;code&gt;@reboot&lt;/code&gt; to specify the task to run upon reboot, added &lt;code&gt;sudo&lt;/code&gt; at the start just to ensure it runs even if logging in with a lower privilege user, and ended it with &amp;amp; to tell the system to keep going &amp;amp; setting up after running this command:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;img src=&#34;../../posts/4/924eddd8-ffd1-47a6-93eb-8c324bde0a91.png&#34; alt=&#34;&#34;&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I learnt this &lt;a href=&#34;https://www.youtube.com/watch?v=Gl9HS7-H0mI&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&#34;-miscellaneous-images-to-be-used-in-future-tutorials-if-i-return-to-this-&#34;&gt;~ miscellaneous images to be used in future tutorials if i return to this ~&lt;/h3&gt;
&lt;p&gt;&lt;img src=&#34;../../posts/4/1327d5e1-354e-4fb3-a104-a1144c537db4.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../posts/4/435c87ee-a2ff-41e3-831b-8b6b19ea58dd.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../posts/4/a323178c-9191-4dde-823d-99a3d0bef9e2.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../posts/4/84802981-73da-427a-a7ab-1d2ef2e235cd.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;DISCLAIMER:&lt;/strong&gt; &lt;em&gt;I would consider this a LEGACY POST of mine, written a long time ago. Please excuse any typos, errors or lapses in memory/judgement - as it was added to the site from the archives, just to put everything in one place. Thankq for your understanding 🙇‍♀️&lt;/em&gt;&lt;/p&gt;
&lt;hr&gt;
</description>
    </item>
    
  </channel>
</rss>
