KVM - Chromecast Ultra and Google Home Mini not discovered

Hello,

I have a problem with my google devices (Chromecast Ultra and Google Home Mini), my HA can’t detect them even they are connected to the network.
I create a new virtual machine in KVM with QCOW2 image as described here: https://www.home-assistant.io/hassio/installation/

I have on other PC an virtual machine created in Virtual Box and there they are discovered.

Has anyone encountered this problem?

Thank you,
Ciprian

Using virtual manager, check the ‘NIC’ config for that image. If the ‘network source’ is set to NAT, then that is the problem. If it is set to a bridge, then go to another machine and see if you can ping your hassio.

Hello @wmaker,

This is how the NIC setup looks:

And both devices are an answering to ping.

But still when I want to add them to HA:

image

Thank you!

OK, that’s good!

The only other thing that I can think of is that the IP address of your Hassio
may be on a different subnet than your google devices.

Both are in the same subnet 192.168.86.xxx, same router the only difference is that my server is connected with LAN cable and the chromecast and google dot are connected on WiFi.
For all 4 I have reserved IP’s.

I’m running out of ideas…but here is another test,
Using your web browser to get to HA’s front end,
if you use something like: http://homeassistant.local:8123/
if the .local works, then you know multicast addresses (and in particular multicast DNS) are getting through. Although I don’t have the devices you’re trying to discover, it is my understanding that they use mDNS for discovery.

If I try to access http:// homeassistant.local :8123/ I receive the message: This site can’t be reached.

I will investigate more.

Hello,

I was not able to integrate the google devices as long as I used HA in the virtual car in KVM.
I gave up using HA in the virtual machine in KVM and I moved HA in doker container and now everything works perfectly.

Thank you!

I came across the following, where the reddit user had the same issue and that thinks that macvtap does not work but bridge does.

I had similar problems with KVM and discovery of Google Cast devices. Problem was that by default KVM network driver doesn’t allow multicast DNS requests. So you have to edit XML of the VM manually to enable it. Then everything works OK

Thanks :slight_smile: !
Curious…

  1. What does the XML portion that you edited look like?
  2. Where is the XML file located at?

Something like:

<interface type='direct' trustGuestRxFilters='yes'>
   <mac address='XX:XX:XX:XX:XX:XX'/>
   <source dev='enp1s0f1' mode='passthrough'/>
   <model type='virtio'/>
   <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
 </interface>

Actually the important part is to add: trustGuestRxFilters=‘yes’ into the network definition.

the issue is that macvtap won’t do multicast by default, mDNS uses multicast, and google’s discovery requires mDNS, or some other mutlicast. trustGuestRxFilters enables it.

One additional note, if you enabled XML editing in virt-manager and edit while the VM is powered on, it looks like your addition gets removed, but it doesn’t actually. Power off the VM and your edit will show up.

Thank you all for your help and I apologize for not being able to provide an feedback faster.
Today I edited XML files after I turned off the VM. I also switched to Network Interface -> Device model to “virtio”.

It worked perfectly!!

Thank you!