Installing HAOS in a VM on TrueNAS

I have the P dongle and am receiving the following error with your settings:

)
[2024-09-30 22:14:14] info: 	z2m: Starting zigbee-herdsman (0.57.3)
[2024-09-30 22:14:14] warning: 	zh:ezsp: Deprecated driver 'ezsp' currently in use, 'ember' will become the officially supported EmberZNet driver in next release. If using Zigbee2MQTT see https://github.com/Koenkk/zigbee2mqtt/discussions/21462
[2024-09-30 22:14:14] error: 	zh:ezsp:ezsp: Connection attempt 1 error: Error: Error: No such file or directory, cannot open /dev/ttyACM0
[2024-09-30 22:14:19] error: 	zh:ezsp:ezsp: Connection attempt 2 error: Error: Error: No such file or directory, cannot open /dev/ttyACM0
[2024-09-30 22:14:29] error: 	zh:ezsp:ezsp: Connection attempt 3 error: Error: Error: No such file or directory, cannot open /dev/ttyACM0
[2024-09-30 22:14:44] error: 	zh:ezsp:ezsp: Connection attempt 4 error: Error: Error: No such file or directory, cannot open /dev/ttyACM0
[2024-09-30 22:14:44] error: 	z2m: Error while starting zigbee-herdsman
[2024-09-30 22:14:44] error: 	z2m: Failed to start zigbee
[2024-09-30 22:14:44] error: 	z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
[2024-09-30 22:14:44] error: 	z2m: Exiting...
[2024-09-30 22:14:45] error: 	z2m: Error: Failure to connect
    at Ezsp.connect (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/ezsp.ts:364:19)
    at Driver.startup (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/driver.ts:183:13)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:138:29)
    at Zigbee.start (/app/lib/zigbee.ts:64:27)
    at Controller.start (/app/lib/controller.ts:140:27)
    at start (/app/index.js:154:5)

If you have the p, you dont need ā€œezspā€ i think.

Os your dongle at the same port? (You can check it in your hardware in Homeassistant (in my case ā€œGerƤtepfadā€))

1 Like

Interestingly, the built-in Zigbee integration works, but I can’t use it because I have devices like heating thermostats that aren’t compatible with it.




[07:15:40] INFO: Preparing to start...
[07:15:40] INFO: Socat not enabled
[07:15:41] INFO: Starting Zigbee2MQTT...
Starting Zigbee2MQTT without watchdog.
[2024-10-01 07:15:45] info: 	z2m: Logging to console, file (filename: log.log)
[2024-10-01 07:15:45] info: 	z2m: Starting Zigbee2MQTT version 1.40.1 (commit #unknown)
[2024-10-01 07:15:45] info: 	z2m: Starting zigbee-herdsman (0.57.3)
[2024-10-01 07:15:56] error: 	z2m: Error while starting zigbee-herdsman
[2024-10-01 07:15:56] error: 	z2m: Failed to start zigbee
[2024-10-01 07:15:56] error: 	z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
[2024-10-01 07:15:56] error: 	z2m: Exiting...
[2024-10-01 07:15:56] error: 	z2m: undefined

Now it Work With ā€žzstsckā€œ
Ty

1 Like

Thank you so much for writing this up! I got it working, couldn’t find the config files to change the auth for my network so changed it on the old HA machine and re-backed it up. Made some dumb mistakes in TrueNAS but I got to practice making a zvol and VM a ton. This was really fun, and all the info is here and concise. Super proud of both of us, lol. Thanks again!

1 Like

@sorz212 how to reach that hardware visualization in truenas? I have same issue as @fapandnap and no idea how to make the sonoff reach HA :frowning:

Where exactly are you having problems? Have you added the device in TrueNAS? It’s important that the TYPE is set to: USB Passthrough Device and the Controller Type to qemu-xhci, and then select your device—just like in my screenshot. Afterwards, restart your VM and look under Settings, System, Hardware, All Hardware for your ā€œSonoffā€ and copy the device path. For me, it was /dev/ttyUSB0; for you, it might be /dev/ttyACM0 or something similar. Copy that. Now install Zigbee2mqtt. My MQTT broker runs in Home Assistant as an addon, so you don’t need to configure anything else in Zigbee2mqtt except the SERIAL PATH as shown in my screenshot. I tried out the ā€œAdaptersā€ here; for me, it was ā€œzstackā€. If you don’t enter an adapter, you’ll see adapter options displayed in red text. ( zstack , deconz, ember, zigate)

It is absolutely essential that you use a USB extension cable. For some reason, it only works for me when I use one.

1 Like

i have an issue on my ha… i’m not able to open web pages from ha. it is installed on a vm in a separeted pool on my truenas. it seems as if it is disconnected but i’m able to download app and integrations. what could it be?

Hello! Thank you for the tutorial, but I’m getting an error and I need some help.

I’m trying to install HAOS on my Truenas Scale, but don’t have many (or almost any) experience writing commands on Truenas.

I created the Zvol with 64 GiB and when on shell writing the first command I get the following error:

Also tried with sudo before but the result is the same.

Anyone can please help? Thank you

Thanks for the very nice guide! I followed it through, and it worked just nicely. Up until I thought I could just update HA from the Apps management page in TNS :S
Now most of my added integrations are gone (not all though), and I cannot use addons (so all of them and their config are gone too), possibly what TNS saw as app was now written over with the actual TNS HA app, which is a very different thing from the HAOS on VM.
Luckily I was just starting to mess about with it all, so not much time lost on my side, but, what would be the preferred way of updating HAOS, following this route?
Do a full backup of the configuration, and go through it anew with a completely new zvol and delete the old one?

In the end, that’s what I guess I have to do now at least, since the old one seems to be thoroughly broken - and especially after trying to ā€œrevertā€ (having forgotten about the ā€œHAOS on VMā€ part already) the update xD
Now it does not start anymore at all. :innocent:

Update 2024-12-08: It turns out, I was confused with the parallel setup of two Home Assistant instances, one in the VM, and one as App of TNS. Both instances were just fine, just the App in TNS has not the same capabilities as the HAOS VM installation.
The recent update to HAOS 14 and the new Home Assistant Core worked flawlessly from the HA settings though.

Thanks for this guide, I set it up in TrueNAS Core, I didn’t see if anyone mentioned it, but it was a little irritating because you cannot QEMU copy in Core (apparently).

So I had to set up an iSCI share and then copy it over to the zvol that way.

Apart from that bit the guide was pretty much the same. Thanks.

I have really tried everything I could but I am getting this error:

admin@truenas[~]$ qemu-img convert -O raw haos_ova-14.1.qcow2 /dev/zvol/Main\ Pool/HomeAssistant/HAOS
qemu-img: /dev/zvol/Main Pool/HomeAssistant/HAOS: error while converting raw: Could not create ā€˜/dev/zvol/Main Pool/HomeAssistant/HAOS’: No such file or directory

The first 2 steps worked perfectly. The Zvol has been created and the path is correct. Any idea?

Sorry, I’m on my phone right now so it’s hard to type stuff out correctly in code blocks

Here’s a link to show an example of someone who had a space their zpool name. Basically, I think it depends on what shell you are using, either try putting the path in quotes or using a plus sign to fill the space instead of the escape character

You’re still having trouble, please share a screenshot of your data set details or the output of ā€˜ls /dev/zvol’

:information_source: Upcoming changes in TrueNAS SCALE 25.04 (Fangtooth)

Virtualization in TrueNAS 25.04

TrueNAS 25.04 changes the virtualization hypervisor backend from the previous KVM implementation (TrueNAS 24.10 and earlier) to Incus for virtual machine (VM) deployment and adds support for Linux system containers (LXC). This feature offers lightweight isolation functionality similar to jails in TrueNAS CORE. This is an experimental community feature, with full Enterprise support planned for a future TrueNAS release version.

With this change comes redesigned Virtualization screens in the TrueNAS UI.

Manual Migration Required

Due to configuration incompatibilities between the previous KVM hypervisor implementation (TrueNAS 24.10 and earlier) and Incus in TrueNAS 25.04 (and later), existing VMs do not automatically migrate on upgrade from 24.10.X to 25.04. However, storage zvols are retained, allowing users to easily recreate previously configured VMs.

I installed the first 25.04 beta release and recreated a HAOS VM using the new UI and Incus backend. Although the setup screens were different, the process was straightforward, and I’m happy to report that I encountered no issues.

Screenshots for TrueNAS 25.04 Instance Creation

I should also mention that I’ve moved my primary instance of HAOS to a dedicated device, so my TrueNAS VM is only a backup and is used for testing.

4 Likes

Thanks. This is helpful. I am not familiar with Incus, but the network settings in your screen shots worked.

I am also on Fangtooth beta 1. I downloaded the qcow2, converted it to raw, used dd to write the image to a new 32 MiB zvol, and attached it to a new Instance, copying the network settings that you used. I see that that my DHCP server picked up the new interface’s MAC address from the instance’s macvlan interface.

I’ll play with it more to see if it really works, however it seems to be straightforward also to create a new home assistant instance.

1 Like

Thanks Troy,
I would be stuffed (no, completely stuffed) without your help and this guide.

I tried to set up on 25.04 from scratch using both guides but cannot get it to work. Should I wait for the release candidate or is it possible now?

The highest regards,

Frank

Hi Frank,

I’ll have a go at it this weekend and report back.

I tried it from scratch, and it worked.

What’s not working for you? Any error messages?

No error messages but there is an IP address but no ports open at all, certainly not 8123.

That’s strange… There shouldn’t be any ports that need opening.

I’m not doing anything fancy. The TrueNAS network settings are basically default. I have a static IP instead of DHCP, and I do not have a bridge set up in TrueNAS.

On the Instances page, under Configuration - Global Settings, The Default Network is using the default settings.

When creating the VM, I unchecked Use default network settings, so it used MAC VLAN instead.

If you go to the VM Tools and then click the Shell button, it opens a terminal. Type ha banner. Can you confirm Home Assistant is fully started and has the expected IP address?


EDIT – Upon further testing, I still need to create a bridge on TrueNAS in order for the VM to connect to it. For example, using TrueNAS host as a remote backup location for Home Assistant

2 Likes

Thank you, just followed this on my new NAS and it worked just like you described

1 Like