Home Assistant Virtualization .. please set up mDNS

I have been using TrueNAS Scale on an 10 year old ASUS PC. Originally I tried to use TrueNAS on Proxmox but because my machine doesn’t support IOMMU, it was impossible to pass through the SATA card. So I decided to use TrueNAS Scale on bare medal as an alternative. I added Pi-Hole and RSync as APPs which worked fine but I needed to use a VM for HAOS since I wanted to use HACS adding. The VM started fine and I could access the shell through the VM app. However, Home Assistant did not detect device and I could not go to has.local.

After much playing around I found I needed two items:

  1. I had to set the “Trust Guest Filters” on in the NIC options for the VM
  2. I had to modify TrueNAS’s /etc/nsswitch.conf

hosts: files dns → hosts: files mdns4_minimal dns
(use sudo vi /etc/nsswitch.conf from the System->Shell command)

Once this was done, I can resolve has.local on my network and HA is able to see devices as I add them to the network.

HOWEVER, the challenge is each time I get a TrueNAS update, it seems to wipe out the edits to /etc/nsswitch.conf. Is it possible that the upgrades could just not touch this file or could you please enable mDNS in version of /etc/nsswitch.conf you are distributing?

regards and thanks for consideration, Paul

ps. if you wondered how I figured this out, here was the flow … couldn’t get to has.local on my network but I noticed it did resolve properly in the VM shell. Then I noticed, I could not resolve truenas.local in the VM shell. Turn on mDNS allowed me to see has.local but HA was not seeing devices … the filters enabled mDNS to get back to the VM from outside.

pps. If someone knows a better way, please let me know.

ppps. Thanks for the update, I think it was 24.02 or maybe later which fixed SMB and TimeMachines on new Macs … I had an old mac that could TimeMachine to the share but my newest (MBA M1, Sonoma) refused to do the backup … it would start up and then error #19 … since that update, things work fine for both macs.

Why not use the IP or a DNS pointing to the IP? Are you using a network bridge for the VM? No need to use .local addresses or change nsswitch.

mDNS allows for everything to publish its addresses automatically. For DNS I think I’d have to do manual setup in Pi-Hole and use static IP addresses (which I prefer to not user).

With respect to network bridge … I can not see any options in the VM configuration on TN to set up a bridge. I used CPU Mode = Host Passthru and in the NIC settings, I used VirtIO … could not find anything to set as a bridge