This guide provides detailed steps to install Home Assistant OS (HAOS) in a Virtual Machine (VM) on TrueNAS SCALE.
- Requirements
- Create a ZVOL
- Setup VM in TrueNAS SCALE
- Install HAOS
- Post-Installation
- Troubleshooting
- Resources
- Collaboration
- Credits
Installing Home Assistant OS on a VM gives you the full package of features, including the Supervisor and Add-ons. Here's why this setup rocks:
- Add-Ons: You get access to Home Assistant Add-ons, which are like plugins that expand your setup with extra functionalities—think MQTT brokers, databases, or Node-RED.
- Supervisor: The Supervisor manages your Home Assistant instance, making updates, backups, and system health checks a breeze.
- Snapshots: VMs make it easy to snapshot your entire setup. Mess something up? Rollback to a previous state in no time.
- Isolation: Your Home Assistant OS runs in its own VM, separate from other systems, reducing the risk of conflicts.
- Resource Management: Allocate exactly the resources you need, ensuring Home Assistant runs smoothly without hogging everything else.
For more details, you can check out the Home Assistant OS Installation Guide and the TrueNAS Community Forum.
- TrueNAS SCALE installed.
- TrueNAS SCALE shell access.
This guide was tested against:
- Version: TrueNAS-SCALE-23.10.2
- Product: TRUENAS-MINI-3.0-X+
- Model: Intel(R) Atom(TM) CPU C3758 @ 2.20GHz
- Memory: 31 GiB
Note: A ZVOL is used instead of a dataset because it allows the storage to be presented as a block device, which is necessary for VM disk images to function correctly.
- Open TrueNAS SCALE web interface.
- Navigate to
Storage
>Pools
. - Select your pool and click
Add Zvol
. - Set the following:
- Name:
HomeAssistantOS
- Size: At least 32 GiB
- Sync: STANDARD
- Compression Level: Inherit (LZ4)
- Enable Atime: ON
- ZFS Deduplication: OFF
- Case Sensitivity: ON
- Comments: Home Assistant OS
- Name:
- Note the ZVOL path, which will be something like
/mnt/your-pool-name/HomeAssistantOS
.
- Open TrueNAS SCALE web interface.
- Navigate to
Virtualization
>VMs
. - Click
Add
to create a new VM.
- Navigate to
- Configure VM settings:
- Guest Operating System: Linux
- Name:
HAOS
- Description: Home Assistant OS
- System Clock: UTC
- Boot Method: UEFI
- Shutdown Timeout: 90
- Start on Boot: Enabled
- Enable Display: Enabled
- Bind:
0.0.0.0
- Password: Set a password for VNC access
- CPU and Memory:
- Virtual CPUs: At least 2 vCPUs
- Cores: 2
- Threads: 1
- CPU Mode: Host Passthrough
- Memory Size: At least 4096 MB
- Add Storage:
- Select Disk Type: VIRTIO
- Use existing disk image: Attach the ZVOL created earlier
- Configure Network:
- Adapter Type: VirtIO
- Mac Address: Auto-generated
- Attach NIC: Select the network interface used by your system
- Choose a NIC for your VM. Set the adapter type to VirtIO. If you are not using a bridge, enable Trust Guest Filters to allow multicast.
- GPU:
- Hide from MSR: Disabled
- Ensure Display Device: Enabled
- Confirm Options and save the VM configuration.
Note: Here we are just downloading an image and writing it to the disk. The disk in our case is the ZVOL. These steps would be considered the installation. After that, it’s just a matter of adding the ZVOL to a VM and booting up.
-
Download the latest HAOS image using TrueNAS SCALE shell:
Note that these commands may require admin privilages and per TrueNAS documentation,
Restrict new TrueNAS user accounts (CORE | SCALE) to the most minimal set of storage ACL permissions and access possible.
On TrueNAS SCALE, create the administrator account on install and disable root NAS administrative access...
wget https://github.com/home-assistant/operating-system/releases/download/12.3/haos_ova-12.3.qcow2.xz unxz haos_ova-12.3.qcow2.xz sudo qemu-img convert -O raw haos_ova-12.3.qcow2 /dev/zvol/<path_to_zvol>
-
Start the VM.
- The system should boot directly from the ZVOL and load Home Assistant OS.
- Access the HAOS web interface:
- Open a web browser and navigate to
http://<vm-ip>:8123
.
- Open a web browser and navigate to
- Complete the initial Home Assistant setup:
- Set up user account.
- Configure basic settings.
- Verify the installation by checking the system information and logs.
This error occurs when trying to convert the HAOS image to a ZVOL and the ZVOL does not have sufficient space or is incorrectly configured.
Solution:
- Ensure the ZVOL has enough space.
- Check the ZVOL path and permissions.
- Recreate the ZVOL if necessary, ensuring it is at least 32 GiB in size.
If your VM stays in an eternal loop in GRUB, it may indicate a problem with the installation or the image file.
Solution:
- Ensure the image file is not corrupted.
- Re-download and extract the image file.
- Check the ZVOL path and permissions.
Issues with USB passthrough can often be resolved by ensuring the correct device path and settings.
Solution:
- Ensure the USB device is correctly identified and passed through.
- Use PCIe passthrough for the USB controller rather than USB passthrough per device to avoid issues:citation[oaicite:2]{index=2}:citation[oaicite:1]{index=1}.
If the Home Assistant CLI is not starting, it may be due to a corrupted download or incorrect setup.
Solution:
- Delete any existing HAOS files.
- Re-download and extract the HAOS image.
- Ensure the ZVOL is correctly configured and has enough space:citation[oaicite:0]{index=0}.
- TrueNAS SCALE Documentation
- Home Assistant OS Installation Guide
- Home Assistant Community Guide
- TrueNAS Community Forum on Installing HAOS
- Josh Creek's Blog on Installing HAOS on TrueNAS SCALE
For contributions, open an issue or pull request in the repository.
Content based on the Home Assistant Community Guide, Home Assistant OS Installation Guide, and TrueNAS Community Forum.
Authored with assistance from GPT-4, provided by OpenAI.
First of all, thank you for your guide. Appreciate your share.
qemu-img convert -O raw haos_ova-12.3.qcow2 /dev/zvol/<path_to_zvol>
this command should be run with a user with elevated priviledges. Truenas installation now sugests that we use a admin account instead of root. With this account we need to add sudo to the command