home server

DIY HOME SERVER 2021 – Software – TRUENAS

1. DIY HOME SERVER - TRUENAS prepare VM

This guide is my implementation of the official TrueNAS Core Installation Guide.

I choose to install TrueNAS Core (formerly FreeNAS) as my primary Proxmox virtual machine. I use PCI Passthrough to completely pass the HBA Controller and all attached hot-swappable disks from Proxmox to TrueNAS. This way these disk will no longer be available to Proxmox but will be managed exclusively by TrueNAS. This requires some advanced BIOS settings as explaned in the BIOS Configuration section of a previous post.

My system contains 2 internally installed SSD connected to the onboard SATA ports. These 2 disks are used in ZFS (Raid 1) mirror to boot Proxmox and store VMs.

My system also contains a HBA Controller attached to 8 hot-swappable HDD bays. At the moment 4 bays are in use.

Download the latest TrueNAS ISO and upload it to Proxmox → local storage → ISO Images.

In Proxmox, click the Create VM button.

In the General tab, give the new VM an appropriate Name.

Click the Next button.

On the OS tab, select Use CD/DVD disc image file (iso) and select the TrueNAS ISO image.

Click the Next button.

On the System tab, set BIOS to OVMF (UEFI) and select local-zfs as storage.

Do not select Qemu Agent!

Set Machine to q35.

Click the Next button.

On the Hard Disk tab, set the Disk size to 20 GB.

Enable the SSD emulation option.

Click the Next button.

On the CPU tab, specify the number of cores.

Click the Next button.

On the Memory tab, specify a decent amount of memory. TrueNAS needs at least 8 GB + 1 GB/ TB storage.

Click the Next button.

Tip :

Whatever amount of memory you throw at TrueNAS, it wil allways use it up to more than 90%. This is not a bug, it’s a feature. By design TrueNAS uses the available memory for caching purposes.

On the Network tab, there’s nothing to adjust.

Click the Next button.

On the Confirm tab, check all settings.

Click the Finish button to create the new VM.

After the VM is created, select HardwareAddPCI Device.

In the Device list, select your HBA controller.

Check the Advanced option and uncheck the ROM-Bar option and check the PCI-Express option.

Click the Add button.

On the Hardware tab, check all settings.

We are now ready to install TrueNAS in a VM.

2. DIY HOME SERVER - TRUENAS Installation

Start the TrueNAS VM.

Activate the option Install/Upgrade.

Tab to OK and enter.

Select the 20 GB emulated HDD.

Tab to OK and enter.

Accept the security warning.

Set and confirm a password.

Tab to OK and enter.

Select the Boot via UEFI option.

Accept the message.

TrueNAS Core will be installed.

Activate the option Shutdown System.

Tab to OK and enter.

After the VM is shut down, select Hardware → CD/DVD Drive.

Unmount the TrueNAS ISO file by activating the option Do not use any media.

Click the OK button.

Being our NAS, we want TrueNAS Core to start up first and shutdown last.

While the VM is shut down, select Options.

Set Start at boot to Yes.

Set Start/Shutdown order to 1.

Click the OK button.

3. DIY HOME SERVER - TRUENAS Log in

Start the TrueNAS VM.

Select the console to watch TrueNAS boot into its main menu for the first time.

Now is a perfect moment to configure the network interface and set it to a fixed IP address.

Then you can open the newly configured IP address in a browser to access the TrueNAS web interface.

Log in to TrueNAS as user root with the password set during installation.

4. DIY HOME SERVER - TRUENAS Configuration

a. Some minor settings

Select  Network → Global Configuration.
Set the Nameservers for your main network adapter.
Set the Default Gateway for your main network adapter.

Select  System → General.
Set the Timezone.

b. Creating the first pool

Select  Storage → Pools.

Click on the Add button.

Click  CREATE POOL.

Set the pool Name.

Enable Encryption if you wish to.

Select the harddisks you want to use in your first pool.

I choose to create a ZFS Raid 1 (mirror) of two 3 TB drives.

I selected the dropdown option Add Spare to add a third 3 TB drive as a hot spare.

Click the Create button to generate the pool.

Now it is up to you to organize your own data structures by :

  • on the tab Accounts, creating users and groups
  • on the tab StoragePools, creating datasets on the pools and setting security on those datasets 
  • on the tab SharingSMB or NFS, sharing those datasets as SMB or NFS network shares
  • on the tab Services, configure the SMB or NFS service
  • on the tab TasksPeriodic Snapshot Tasks, create a periodic snapshot task. 

In the next episode, we’ll install PI-HOLE Network-wide Ad Blocking as a LXC container.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.