This repository is a practical, opinionated guide to running TrueNAS SCALE as a VM on Proxmox VE 9.1, optimized for maximum performance, ZFS correctness, and long-term stability.
It focuses on host + VM configuration that avoids common virtualization pitfalls for storage workloads, including:
- PCIe HBA passthrough (IT mode) and disk architecture do’s/don’ts
- CPU configuration (
cpu: host), NUMA locality, and pinning guidance - Memory settings (no ballooning), caching/snapshot caveats, and stability checks
- virtio networking recommendations and miscellaneous platform notes (e.g., TPM)
- ZFS must control disks directly
- Prefer PCIe passthrough over virtual disks
- Avoid double caching
- NUMA-aware CPU and memory layout
- No CPU or RAM overcommit
- UEFI enabled
- Secure Boot disabled
- VT-x / AMD-V enabled
- VT-d / AMD-Vi (IOMMU) enabled
- Disable firmware TPM if hardware TPM is installed
intel_iommu=on iommu=pt
# or
amd_iommu=on iommu=ptValidate:
dmesg | grep -e IOMMU -e DMAR
ls /sys/kernel/iommu_groups/
# Replace {node-name} with your Proxmox node name (shown by: hostname)
# Pass an empty blacklist to show all PCI devices/classes
pvesh get /nodes/{node-name}/hardware/pci --pci-class-blacklist ""Ensure the VFIO stack is available early at boot (especially important for binding devices to vfio-pci). Add the following to /etc/modules:
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
Load modules now (no reboot) so you can validate quickly:
modprobe vfio vfio_iommu_type1 vfio_pci vfio_virqfdThen rebuild initramfs so they’re available at early boot:
# Most common/safest: update the initramfs for the currently running kernel
update-initramfs -u -k "$(uname -r)"
# If you intentionally maintain multiple kernels, you can update all installed kernels
# update-initramfs -u -k allIf your Proxmox installation uses proxmox-boot-tool (common with systemd-boot / ZFS-on-root), refresh the EFI boot partitions so the updated initramfs is actually picked up:
proxmox-boot-tool refreshVerify modules are loaded:
lsmod | grep -E '^(vfio|vfio_iommu_type1|vfio_pci|vfio_virqfd)'Reference (Proxmox official docs):
What to verify (especially before PCI passthrough):
- The command returns entries with an
iommugroupvalue (not missing / not-1). This indicates IOMMU grouping is active. - Your target device (e.g., the HBA) appears with the expected vendor/device IDs and BDF address (the
idfield like0000:04:10.0). - The HBA’s
iommugroupis isolated from unrelated devices you don’t want to passthrough. If multiple critical devices share the same group, passthrough safely requires moving them together or enabling proper ACS / different slot layout. - For passthrough candidates, check the presence of a usable reset capability (
reset/reset_methodfields when shown). Lack of reset can cause VM reboot/shutdown issues on some hardware.
- PCIe HBA passthrough (LSI SAS2008/2308/3008, IT mode)
- ZFS-on-ZFS
- qcow2
- writeback cache
- snapshots of TrueNAS data disks
lspci -nn | grep -i sasecho "options vfio-pci ids=1000:0087" > /etc/modprobe.d/vfio.conf
update-initramfs -uqm set 100 -hostpci0 0000:04:10.0,pcie=1Do NOT enable ROM-Bar for HBA passthrough.
What ROM-Bar is:
- Exposes the PCIe device's Option ROM (firmware blob) to the VM
- Used for legacy BIOS boot (INT 13h), UEFI drivers, or GPU initialization
Why HBAs do NOT need ROM-Bar:
- TrueNAS does not boot from the HBA
- HBA firmware is already initialized by the host
- ZFS only needs controller registers and DMA access
- The Option ROM provides no runtime functionality
Risks of enabling ROM-Bar unnecessarily:
| Risk | Explanation |
|---|---|
| VM fails to start | BAR space conflicts |
| VFIO errors | ROM cannot be mapped |
| IOMMU faults | Seen on some AMD platforms |
| Slower boot | ROM execution path |
| Migration issues | ROM layout differences |
Correct Proxmox settings for HBA passthrough:
In Proxmox UI:
- ROM-Bar: ❌ unchecked
- PCI-Express: ✅ checked
- All Functions: ❌ unchecked (unless multi-function device)
- Primary GPU: ❌ unchecked
Equivalent CLI:
qm set 100 -hostpci0 0000:04:10.0,pcie=1(No rombar=1)
When ROM-Bar is required (rare exceptions):
- GPUs without UEFI GOP (legacy GPUs or primary GPU passthrough)
- NICs used for PXE boot inside the VM (not applicable to TrueNAS)
- Very old server boards that fail to initialize the HBA without Option ROM execution (extremely uncommon)
If the HBA does not appear in TrueNAS and passthrough is otherwise correct, only then test with rombar=1.
- Type: q35
- BIOS: OVMF (UEFI)
- Secure Boot: Disabled
Use only:
CPU type: host
Extra CPU flags: (empty)
Do NOT manually add:
- +aes
- +avx / +avx2
- +x2apic
- +invtsc
These features are automatically exposed by cpu: host. Forcing them may:
- Break live migration or restores
- Cause TSC instability
- Reduce portability
Disable unless compliance requires otherwise:
- ssbd
- md-clear
- spec-ctrl
- ibrs / ibpb
- Dedicated RAM only (no ballooning)
- Minimum: 16 GB
- Recommended: 32–128 GB
- Disable KSM on host for ZFS workloads
echo 0 > /sys/kernel/mm/ksm/run- virtio-scsi
- 16–32 GB
- cache=none
- HBA passthrough only
- Never add data disks in Proxmox
- virtio-net
- vhost enabled
- multiqueue enabled
- MTU consistent with bridge
- TrueNAS SCALE does not require TPM
- Do not enable swtpm
- Hardware TPM should remain unused by the VM
agent: 1
bios: ovmf
boot: order=scsi0
cores: 8
cpu: host
machine: q35
memory: 65536
numa: 1
ostype: l26
scsihw: virtio-scsi-single
hostpci0: 0000:04:10.0,pcie=1
net0: virtio=BC:24:11:D6:5C:FB,bridge=vmbr0,queues=8
scsi0: local-lvm:vm-100-disk-0,cache=none,discard=ignorelscpu
numactl --hardwareExample: pin VM to NUMA node 0 (CPUs 0–7)
qm set 100 -cpulist 0-7
qm set 100 -numa 1qm set 100 -memory 65536 -numa 1Best practice:
- VM CPUs and memory must belong to the same NUMA node
- Do not span NUMA nodes unless VM is very large
lscpuCheck:
- CPU(s)
- NUMA node(s)
- Core-to-node mapping
qm monitor 100
info cpusValidate:
- vCPU count matches configuration
- CPU model = host
- No unexpected feature masking
lscpuConfirm:
- NUMA visibility
- Correct core count
- No ballooning
zpool statusshows physical disks- HBA visible in SCALE
- No IOMMU faults in
dmesg - ARC size stable
- Swap usage minimal or zero
- ZFS on virtual disks
- qcow2
- Ballooning memory
- CPU overcommit
- Sharing HBAs
License: MIT