Mastering Virtual Machines on TrueNAS SCALE: A Comprehensive Home Lab Guide

Virtualization tutorial - IT technology blog
Virtualization tutorial - IT technology blog

Why TrueNAS SCALE Excels at Virtualization

Previously, if you used TrueNAS Core (FreeBSD), you likely struggled with bhyve because it was extremely picky about hardware and offered underwhelming performance. TrueNAS SCALE changed the game by moving to the Debian Linux platform. The integration of KVM (Kernel-based Virtual Machine) gives SCALE virtualization capabilities on par with big names like Ubuntu or CentOS.

In my Home Lab system, while Proxmox still hosts 12 primary VMs, I prioritize TrueNAS SCALE for data-heavy services. For example: a Windows Server node running Active Directory or a Linux node running Docker that needs high-speed file access. The combination of the ZFS file system and KVM makes management much more centralized and secure.

3 Crucial Concepts You Must Understand

Don’t rush to hit the Create VM button just yet. To ensure your virtual machine runs smoothly without bottlenecks, you need to understand these three components:

  • Zvol: This is a block device residing on ZFS. Unlike a Dataset used for storing files, a Zvol acts as a physical hard drive for the VM. Because of it, you can take snapshots or compress VM data in an instant.
  • Bridge Interface: By default, virtual machines are isolated inside the NAS. You need to create a “bridge” so the VM can receive its own IP from the Router and communicate with other devices on the LAN.
  • VirtIO: This is the “essential” driver set for virtualization. Using default Windows drivers for virtual disks often only reaches 50-60% of actual hardware speed. VirtIO helps you fully utilize your hardware bandwidth.

Step 1: Setting Up a Bridge Network (Avoid Connection Loss)

The most common mistake for beginners is creating a VM but being unable to ping it. This happens because the physical network card is busy holding the NAS’s IP and won’t let the VM “piggyback” on the connection.

Go to Network -> Interface and follow these steps:

  1. Note down the current IP settings of your NAS.
  2. Remove the static IP from the physical network card (e.g., enp3s0).
  3. Create a new Interface of type Bridge, named br0.
  4. Under Bridge Members, select the enp3s0 card.
  5. Reassign the old static IP of the NAS to br0 so you don’t lose access to the web UI.
# After saving, use this command to verify
ip addr show br0

Step 2: Preparing the ISO Repository

Create a dedicated Dataset named ISOs. You should upload installation files like Ubuntu 22.04 LTS or Windows 11 here. Keeping them separate helps you manage your OS library neatly instead of scattering them across data folders.

Step 3: Creating the Virtual Machine

Navigate to the Virtualization menu and select Add. Here are the settings to ensure your VM runs most stably:

1. CPU and RAM Allocation

An unbreakable rule: Never allocate more than 80% of your RAM to virtual machines. If your server has 32GB of RAM, you should only dedicate a maximum of 24GB to VMs. The rest must be reserved for the ZFS ARC (cache) to prevent the system from hanging during heavy data access.

2. Disk Configuration

Select Create New Zvol. Under Disk Mode, you must choose VirtIO. If you are installing Linux, the OS will recognize it immediately. If installing Windows, you will need to load drivers during the installation step.

3. Network Interface

Select Adapter Type as VirtIO and point the Bridge to the br0 created in Step 1. This ensures the VM has a (virtual) 10Gbps network speed instead of being limited to 1Gbps by older drivers.

Step 4: Windows Installation Tips and Snapshot Optimization

When installing Windows, you will see an empty disk list. Don’t worry. Download the virtio-win ISO from Fedora, add a second CD-ROM device to the VM, and point it to this file. During installation, select “Load Driver” and navigate to the viostor/w10/amd64 folder; the hard drive will appear immediately.

After finishing the OS installation and basic configuration, take a Snapshot of that VM’s Zvol immediately. If you accidentally install faulty software or get a virus, it takes only 2 seconds to Rollback to the original state. This is the incredible power of ZFS that other storage solutions struggle to match.

# Check the snapshot list for the virtual machine
zfs list -t snapshot -r pool_name/zvol_name

Conclusion: TrueNAS SCALE or Proxmox?

If you need a system dedicated to running dozens of virtual machines with Cluster features, Proxmox is still king. However, if your primary need is secure storage and you only need to run 3-5 critical services, TrueNAS SCALE is a much more streamlined choice. It helps you save hardware resources and reduces complexity when managing multiple separate devices in your Home Lab.

Share: