How to install TrueNas as VM in Proxmox

Cover Image for How to install TrueNas as VM in Proxmox

How to install TrueNas as VM in Proxmox

How-to written and screenshots taken on 2021 October 54 min read

Introduction

What started as a project to run "some crypto applications" grew into something much bigger, but also more useful. I learned a tremendous amount about virtual machines, lxc containers and Proxmox. And although I'm just scratching the surface and I don't actually understand it, I know how to do some things. I'll write them down here, partly for myself, but also for you in hopes it will save one of us a lot of time and frustration.

Create a VM for TrueNas

  1. Click on "local (pve)" on the left. Select "ISO Images" and click "Upload". Upload the TrueNas image.

  2. In the top of the screen click the "Create VM" button.

    Create VM button

  3. Select Start at boot and optionally Start/Shutdown order.

    Start options

  4. Set the Guest OS to "Other". Proxmox will select the best defaults and lower level settings. Especially important when installing a Windows guest.

    OS options

  5. Set Machine to q35.

    Machine type

  6. Select SCSI as Bus/Device and set the Disk size to 8-16 GB. Select the Discard option and SSD emulation (if installing on SSD). The discard option will free up disk space on the host when files are deleted in the guest.

    Disk options

  7. First set the number of Sockets, Cores and VCPUs. The number of vCPU's = Sockets x Cores. Only use multiple sockets if the host has multiple too. Set Type to host and select Enable NUMA if the host machine has multiple sockets. Also scroll all the way down and enable "aes".

    CPU options

  8. Set the amount of RAM. TrueNas with ZFS loves RAM so set is as high as possible. Setting a minimum is of no use here as TrueNas will take everything it can (you can disable "Ballooning Device").

    Memory options

  9. Select the network Bridge that should be used by the guest and select "VirtIO" as model.

    Network options

  10. Confirm and finish.

    Confirm settings

  11. Wait a few moments for the VM to be initialized.

Install TrueNas

  1. Go to the VM and start it.

    Start the VM

  2. Open the console and the installer should be started. (I'll open a windowed console (button above the VM screen) to make the next screenshots.)

    TrueNas installer in Proxmox console

  3. Select "Install/Upgrade" and press 'enter' to continue.

    TrueNas installation menu

  4. Press 'space' to select the virtual harddisk and 'enter' to continue.

    TrueNas installation select harddisk

  5. You will get a warning. Press 'enter' to continue.

    TrueNas installation disk warning

  6. Enter a password.

    TrueNas installation enter password

  7. Choose to boot via BIOS.

    TrueNas installation boot type

  8. Installation will start. Depending on the underlying harddisk type this can take a few minutes.

    TrueNas installation progress

  9. When installation is done reboot the system.

    TrueNas installation completed

    caution

    Although the installer asks to remove the installation medium, do not do this. After removing, the reboot "button" does not work anymore. You can always remove it later using the Proxmox GUI.

    TrueNas reboot

  10. After reboot you can login using the WebGUI. The address will be displayed in the console.

    TrueNas booted

Add storage disks

The best way to add storage disks to TrueNas is by passing a HBA straight to the VM. In How to enable PCIe passthrough in Proxmox you can read how to enable this in Proxmox. If you have enabled passthrough, you can continue.

  1. Shutdown the VM.

  2. Add the HBA as a PCI Device to the VM. Select the correct device and select "All functions".

    Add HBA pci device

  3. Start the VM. The HBA will be booted inside the VM.

    The HBA is booted inside the VM

    caution

    Initially when I added the PCIe HBA, TrueNas inserted the drives attached to the HBA in front of the OS disk. During boot the VM wanted to boot from a HBA drive instead of the virtual OS drive. After disabling the boot option of the HBA TrueNas booted fine. To disable the boot option on a LSI card, you have to erase the BIOS, see How to flash an IBM M1115 HBA card.

Configuration

Configuration of TrueNas in Proxmox is not different from configuring a stand alone instance. In How to do basic TrueNas configuration I go into the details.