Category Archives: FreeNAS

Pi-Hole on Ubuntu VM with TrueNAS

Having a dozen Raspberry Pi’s around the house is nice for random projects, but I would like to consolidate as much as I can into jails on FreeNAS/TrueNAS. Unfortunately, running Pi-Hole on a jail isn’t really supported at this point, with previous attempts being abandoned by the community. Deploying it as a VM is the next best thing.

Requirements

Ubuntu Server 21.x
VM with a minimum 1 vCPU, 512MB vRAM, and 10GB Drive

Deployment Steps

Download Ubuntu Server ISO

Create a new VM in TrueNAS, using whatever values you prefer.
Guest Operating System should be Linux
Boot Method should be UEFI
Bind should be the primary IP of your TrueNAS

Operating System

Configure desired system requirements
The minimum requirements were listed above, but I would add another vCPU core and some additional RAM

VM CPU and Memory

Configure VM Disks
Create new Disk Image and make sure to select AHCI as disk type.
Select a Zvol location on your NAS
I used a 12 GB Drive, which is probably overkill for this

Disks

Network Interfaces and Installation Media
You can take the defaults on Network Interfaces
On Installation Media, upload the Ubuntu ISO you downloaded earlier, or select it from your TrueNAS if you have already copied it to a share.

Installation Media

Install Ubuntu OS
After saving the VM settings, power on and run through a default setup of Ubuntu.
Make sure to set the IP address of this VM with a static IP on your network, as this will be your new PiHole DNS Server.
Also, install OpenSSH during the install if you wish to SSH to Pi-Hole.
After installing Ubuntu, update the Ubuntu OS

sudo apt update
sudo apt upgrade

Install Pi-Hole
Run the following command in an SSH or Console session on the Ubuntu VM

sudo curl -sSL https://install.pi-hole.net | bash

Follow the Pi-Hole Wizard to configure additional settings
Choose your DNS provider (I used OpenDNS)
Take the defaults on the rest of the items unless you have specific reasons otherwise.

Pi-Hole Wizard

Manually Update Resilio Sync – FreeNAS or TrueNAS

FreeNAS (Now called TrueNAS) recently removed the Resilio Sync Plugin from their repository which is a shame. Finding a tutorial on updating Resilio Sync that was created as a Plugin, and not a Jail, has been a time consuming waste. I am outlining steps on how to manually update Resilio Sync. I hope one day TrueNAS will add this back.

  1. Download Resilio Sync for FreeBSD x64 here.
  2. Extract the file so you can access the rslsync file

3. Stop the Resilio Sync Jail in FreeNAS

4. Using WinSCP or similar app, Replace the rslsync file located here: /mnt/FreeNAS/iocage/jails/rslsync/root/usr/local/bin
Your path may be different depending on your naming schema

5. Start the plugin in FreeNAS again
6. Using WinSCP Console or SSH to the rslsync file location, run the following:

chmod +x rslsync

7. Start the Jail again


8. Login to Resilio Sync and verify the version under Preferences

Note, the actual version under the plugin section does not get updated with the correct version. This version is controlled by the plugin manifest, and since TrueNAS/FreeNAS is no longer including Reslio Sync in the plugin collection, this will still show the old version.

Update Plex – FreeNAS 11.3

The path to the iocage jails has changed in FreeNAS 11.3. This post shows the new path, but the instructions are the exact same as they were on FreeNAS 11.2.

  1. Download the newest Plex Update via Plex Dashboard Link
  2. Extract the file twice so folders can be accessed
  3. Rename folder plexmediaserver
    For Plex Pass Subscribers, rename plexmediaserver-plexpass
This image has an empty alt attribute; its file name is image.png
This image has an empty alt attribute; its file name is image-1.png
This image has an empty alt attribute; its file name is image-2.png

4. Stop the current Plex Jail
5. Open WinSCP and login to FreeNAS and browse to: /mnt/FreeNAS/iocage/jails/plexpass/root/usr/local/share
6. Rename existing plexmediaserver folder and add _old at the end
7. Copy the plexmediaserver folder you downloaded into the WinSCP window

This image has an empty alt attribute; its file name is image-9.png
This image has an empty alt attribute; its file name is image-3.png

8. Right-Click on the copied folder and set permissions recursively to 0775
9. Open the plexmediaserver folder and select the file Plex Media Server
10. Click New Link

11. Name the link Plex_Media_Server and click OK
12. Click the Link you created and select the Console Button
13. Enter the command: chmod -h 775 Plex_Media_Server

This image has an empty alt attribute; its file name is image-7.png
This image has an empty alt attribute; its file name is image-8.png

Upgrade Complete!

Update Plex – FreeNAS iocage

Manual Plex Upgrade

  1. Download the newest Plex Update via Plex Dashboard Link
  2. Extract the file twice so folders can be accessed
  3. Rename folder plexmediaserver
    For Plex Pass Subscribers, rename plexmediaserver-plexpass

4. Stop the current Plex Jail
5. Open WinSCP and login to FreeNAS and browse to /mnt/iocage/jails/root/usr/local/share/
6. Rename existing plexmediaserver folder and add _old at the end
7. Copy the plexmediaserver folder you downloaded into the WinSCP window

8. Right-Click on the copied folder and set permissions recursively to 0775
9. Open the plexmediaserver folder and select the file Plex Media Server
10. Click New Link

11. Name the link Plex_Media_Server and click OK
12. Click the Link you created and select the Console Button
13. Enter the command: chmod -h 775 Plex_Media_Server

Upgrade Complete!

Update Plex – FreeNAS 11.2 iocage via SSH Console

Basic Plex Upgrade

  1. SSH into FreeNAS
  2. Type jls to list installed jails

3. Type jexec {n} csh where {n} is the installed jail ID
4. Type pkg upgrade

5. Type service plexmediaserver stop
6. Type service plexmediaserver start

Plex-Pass Upgrade

Change the following commands in step 5-6

5. Type service plexmediaserver_plexpass stop
6. Type service plexmediaserver_plexpass start

FreeNAS Alerting with Amazon AWS SNS

When setting up alerting on FreeNAS 11,x, I chose to use AWS’ free SNS Service. I was a SNS virgin before going through this, so I documented the procedures below.

  1. Assuming you already have an AWS Account (even if you arent paying for any services), you can add free SNS service to the account here: Amazon AWS SNS
  2. Upon logging into the SNS Dashboard, click “Create Topic

  3. Give the topic and Name and Display Name

  4. Click “Create Subscription“. The topic ARN will already be filled out, so just select Email for Protocol, and put in the email address to receive the alerts. You will receive an email requesting you to click a link to confirm the subscription.

  5. After subscription confirmation, click on the subscription and note the Region and ARN, as this will be used in FreeNAS later.

  6. While still logged in with your AWS account, go the the AWS Identity and Access Management console (IAM). https://console.aws.amazon.com/iam/home#/home
  7. Click on the Users Menu, and then Add User. Create a Username and Select Programmatic Access as the access type.

  8. For policies for the user, select “AmazonSNSFullAccess“. (I am not sure if Full Access is required, but I didn’t have time to play around with lowest permissions needed.
  9. The final step on the AWS side, is to make note of the Access Key ID and Secret Access Key that is automatically created under the IAM user you just created.

  10. Login to your FreeNAS management console, and go to SystemAlert Services. Click Add Alert Service, and have all that AWS info ready as follows:Service Name: AWS-SNS
    Region: (Region found on the SNS Subscription)
    ARN: (ARN found on the SNS Subscription)
    Key ID: (Found under the AWS IAM account you created)
    Secret Key: (Found under the AWS IAM account you created)

  11. Click OK (Before you Send Test Alert), and then click Edit on the Alert Service again, and from there you can send test alert. In my case, there was about a 1 min delay before email came in.