TrueNAS CORE & SCALE as a VM on Proxmox VE: An In-Depth Passthrough Guide
An expanded, comprehensive guide on how to install TrueNAS as a VM on Proxmox VE. This version focuses specifically on the critical process of passing through physical hardware—such as disk controllers and drives—to the VM to ensure ZFS integrity and optimal performance.
Step 1: Understanding the VM and Passthrough
Running TrueNAS in a VM on Proxmox VE lets you run multiple services on one machine. For ZFS to work correctly, TrueNAS needs direct access to physical data drives, bypassing Proxmox's virtualization layer.
Step 2: The Importance of PCIe Passthrough
This is achieved by **PCIe Passthrough**, a feature that maps a physical PCI device like a disk controller or network card directly to a VM. This is the only way to ensure ZFS data integrity.
Step 3: Enable IOMMU in BIOS/UEFI
IOMMU is a prerequisite for PCIe passthrough. You must enable it in your server's BIOS or UEFI settings. Look for 'Intel VT-d' or 'AMD-Vi' and enable it. The exact name varies by manufacturer.
Step 4: Enable IOMMU in Proxmox
You also need to enable IOMMU in the Proxmox bootloader. Access the Proxmox shell via SSH or the web UI, then run this command to edit the GRUB configuration file.
nano /etc/default/grub
Step 5: Modify GRUB and Reboot
Find `GRUB_CMDLINE_LINUX_DEFAULT` and add `intel_iommu=on` or `amd_iommu=on`. Save the file, update GRUB, and reboot.
update-grub
reboot
Step 6: Create the VM
In the Proxmox UI, click 'Create VM'. Use the TrueNAS ISO. Set the Guest OS to **FreeBSD** for CORE or **Linux** for SCALE. Give it a name like 'TrueNAS'.
Step 7: Configure VM Disks
Create a new virtual disk for the boot drive. A size of **32 GB** is sufficient. This disk is for the OS only. **Do not** add your data drives here.
Step 8: Allocate CPU and Memory
Allocate at least **4 cores** and a minimum of **8 GB of RAM**. ZFS performance scales with RAM, so **more RAM is highly recommended.**
Step 9: Find PCI Device ID
In the Proxmox shell, run `lspci -nn` to list all devices. Find the device ID of your disk controller (e.g., LSI HBA). This ID will be used for passthrough.
lspci -nn
Step 10: Passthrough the Controller
In the VM's `Hardware` tab, click `Add` then `PCI Device`. Choose your controller from the list. This gives TrueNAS direct control over your data drives, which is critical for ZFS.
Step 11: Install TrueNAS OS
Start the VM. The TrueNAS installer will load. When prompted to select a drive, **carefully choose the small 32 GB virtual disk you created.** The physical data drives will appear but are for your pool, not the OS.
Step 12: Passthrough Other Devices (Optional)
You can use the same passthrough method for a dedicated network card (NIC) for better performance or a USB controller to pass through devices like a UPS. This ensures direct access for TrueNAS.
Step 13: Access the Web UI
Remove the ISO and reboot the VM. The TrueNAS console will display its IP. Use this IP in your browser to access the web UI. Log in with the 'root' user and the password you set during installation.
Step 14: Create Your ZFS Pool
Go to `Storage > Pools` in the web UI. You will now see your physical drives listed by their model names. This confirms the successful passthrough, allowing you to create a secure ZFS pool.
Step 15: Create a ZFS Dataset
A dataset is a directory within a pool. It allows for separate permissions, snapshots, and compression settings. To create one, go to `Storage > Pools`, click the three dots on your pool, and select 'Add Dataset'.
Step 16: Create a User Account
It is best practice not to use the root account for shares. Create a new user for network access by navigating to `Accounts > Users` and clicking 'Add'. Fill in the required details and a strong password.
Step 17: Create a Windows (SMB) Share
To share your data with Windows and macOS clients, create an SMB share. Go to `Shares > Windows (SMB) Shares` and click 'Add'. Select the dataset you created earlier and set the necessary permissions for your new user.
Step 18: Finalize and Access
You have now successfully set up a shared network storage. You can access it from your Windows PC via the network location. Explore other features like the Apps section for SCALE or Jails for CORE to add new services.