[Solved] Conbee 2 fails to connect to ZHA (HA in Unraid VM)

Extra info that didn't fit in the original post:

Unraid (Version: 6.10.3) VM Config
<?xml version='1.0' encoding='UTF-8'?>

<domain type='kvm' id='10'>

  <name>Home Assistant v2</name>

  <uuid>58fc4601-ab12-d110-1e09-4e784dd59c48</uuid>

  <metadata>

    <vmtemplate xmlns="unraid" name="Linux" icon="linux.png" os="linux"/>

  </metadata>

  <memory unit='KiB'>4194304</memory>

  <currentMemory unit='KiB'>3145728</currentMemory>

  <memoryBacking>

    <nosharepages/>

  </memoryBacking>

  <vcpu placement='static'>4</vcpu>

  <cputune>

    <vcpupin vcpu='0' cpuset='2'/>

    <vcpupin vcpu='1' cpuset='8'/>

    <vcpupin vcpu='2' cpuset='5'/>

    <vcpupin vcpu='3' cpuset='11'/>

  </cputune>

  <resource>

    <partition>/machine</partition>

  </resource>

  <os>

    <type arch='x86_64' machine='pc-q35-6.2'>hvm</type>

    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>

    <nvram>/etc/libvirt/qemu/nvram/58fc4601-ab12-d110-1e09-4e784dd59c48_VARS-pure-efi.fd</nvram>

  </os>

  <features>

    <acpi/>

    <apic/>

  </features>

  <cpu mode='host-passthrough' check='none' migratable='on'>

    <topology sockets='1' dies='1' cores='2' threads='2'/>

    <cache mode='passthrough'/>

  </cpu>

  <clock offset='utc'>

    <timer name='rtc' tickpolicy='catchup'/>

    <timer name='pit' tickpolicy='delay'/>

    <timer name='hpet' present='no'/>

  </clock>

  <on_poweroff>destroy</on_poweroff>

  <on_reboot>restart</on_reboot>

  <on_crash>restart</on_crash>

  <devices>

    <emulator>/usr/local/sbin/qemu</emulator>

    <disk type='file' device='disk'>

      <driver name='qemu' type='qcow2' cache='writeback'/>

      <source file='/mnt/user/domains/hassos_ova-4.10.qcow2' index='1'/>

      <backingStore/>

      <target dev='hdc' bus='sata'/>

      <boot order='1'/>

      <alias name='sata0-0-2'/>

      <address type='drive' controller='0' bus='0' target='0' unit='2'/>

    </disk>

    <controller type='pci' index='0' model='pcie-root'>

      <alias name='pcie.0'/>

    </controller>

    <controller type='pci' index='1' model='pcie-root-port'>

      <model name='pcie-root-port'/>

      <target chassis='1' port='0x10'/>

      <alias name='pci.1'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>

    </controller>

    <controller type='pci' index='2' model='pcie-root-port'>

      <model name='pcie-root-port'/>

      <target chassis='2' port='0x11'/>

      <alias name='pci.2'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>

    </controller>

    <controller type='pci' index='3' model='pcie-root-port'>

      <model name='pcie-root-port'/>

      <target chassis='3' port='0x12'/>

      <alias name='pci.3'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>

    </controller>

    <controller type='pci' index='4' model='pcie-root-port'>

      <model name='pcie-root-port'/>

      <target chassis='4' port='0x13'/>

      <alias name='pci.4'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/>

    </controller>

    <controller type='virtio-serial' index='0'>

      <alias name='virtio-serial0'/>

      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>

    </controller>

    <controller type='sata' index='0'>

      <alias name='ide'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>

    </controller>

    <controller type='usb' index='0' model='ich9-ehci1'>

      <alias name='usb'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>

    </controller>

    <controller type='usb' index='0' model='ich9-uhci1'>

      <alias name='usb'/>

      <master startport='0'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>

    </controller>

    <controller type='usb' index='0' model='ich9-uhci2'>

      <alias name='usb'/>

      <master startport='2'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>

    </controller>

    <controller type='usb' index='0' model='ich9-uhci3'>

      <alias name='usb'/>

      <master startport='4'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>

    </controller>

    <interface type='bridge'>

      <mac address='52:54:00:5f:b5:b2'/>

      <source bridge='br0'/>

      <target dev='vnet9'/>

      <model type='virtio'/>

      <alias name='net0'/>

      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>

    </interface>

    <serial type='pty'>

      <source path='/dev/pts/2'/>

      <target type='isa-serial' port='0'>

        <model name='isa-serial'/>

      </target>

      <alias name='serial0'/>

    </serial>

    <console type='pty' tty='/dev/pts/2'>

      <source path='/dev/pts/2'/>

      <target type='serial' port='0'/>

      <alias name='serial0'/>

    </console>

    <channel type='unix'>

      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-10-Home Assistant v2/org.qemu.guest_agent.0'/>

      <target type='virtio' name='org.qemu.guest_agent.0' state='connected'/>

      <alias name='channel0'/>

      <address type='virtio-serial' controller='0' bus='0' port='1'/>

    </channel>

    <input type='tablet' bus='usb'>

      <alias name='input0'/>

      <address type='usb' bus='0' port='1'/>

    </input>

    <input type='mouse' bus='ps2'>

      <alias name='input1'/>

    </input>

    <input type='keyboard' bus='ps2'>

      <alias name='input2'/>

    </input>

    <graphics type='vnc' port='5901' autoport='yes' websocket='5701' listen='0.0.0.0' keymap='en-us'>

      <listen type='address' address='0.0.0.0'/>

    </graphics>

    <audio id='1' type='none'/>

    <video>

      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>

      <alias name='video0'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>

    </video>

    <hostdev mode='subsystem' type='usb' managed='no'>

      <source>

        <vendor id='0x1cf1'/>

        <product id='0x0030'/>

        <address bus='1' device='28'/>

      </source>

      <alias name='hostdev0'/>

      <address type='usb' bus='0' port='2'/>

    </hostdev>

    <memballoon model='virtio'>

      <alias name='balloon0'/>

      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>

    </memballoon>

  </devices>

  <seclabel type='dynamic' model='dac' relabel='yes'>

    <label>+0:+100</label>

    <imagelabel>+0:+100</imagelabel>

  </seclabel>

</domain>

Edit: 6/15/2022
Paddle on discord says:

 `OSError: [Errno 5] I/O error: '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE-if00'`


There's an issue with your USB passthrough, the serial port isn't functional

It may have a USB descriptor but if software can't open the serial port and talk to it, it's likely a problem with your Unraid configuration

FINAL EDIT: My Solution.

The issue was how I was passing the USB through unraid to Hass.
Here's what worked for me:

  1. Turn off your Hass Host in Hardware (Shutdown Host).
  2. Go into your VM Settings, ensure Hass is off. Edit the VM and if you have the Conbee stick selected, deselect it. Hit Apply.
  3. Go to this post: https://forums.unraid.net/topic/113301-passthrough-of-conbee-ii-zigbee-usb-gateway-to-home-assistant-virtual-machine/page/2/
    They recommend that you insert this code into your VM Config:
    <serial type='dev'>
      <source path='/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_3DE24#####'/>
      <target type='usb-serial' port='1'>
        <model name='usb-serial'/>
      </target>
      <alias name='serial0'/>
      <address type='usb' bus='0' port='4'/>
    </serial>
  1. Go back in to edit your VM. Switch to Advanced in the top right. Scroll until you find </interface>. Create a new line, and paste the code above.

  2. We need to find your source path to enter above. Open an unraid command prompt and enter

cd /dev/serial/by-id/.

Then enter

ls

If your Conbee2 USB is connected, you should get an entry:

usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE######-if00@

Select this to copy it, and paste that in your <source path='/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_3DE24#####'/>

  1. Next we should doublecheck the port in target. Navigate to your UnraidIP/Tools/SysDevs and look under USB devices. If your conbee stick is listed as Port 1--X, then I think in <target type='usb-serial' port='1'> your port is 1, and you can leave it as is.
    The <address type='usb' bus='0' port='4'/> Does not need to be changed as this is configuring what Hass will see the port as.

  2. Save/Apply and restart the Hass VM.

  3. Open your Home assistant and got to /config/hardware. Click the 3 dots, click "all Hardware" and look for your USB. For me, it no longer shows up as my Conbee... instead, it shows up as:

/dev/serial/by-id/usb-QEMU_QEMU_USB_SERIAL_1-0000:00:07.7-4-if00-port0

  1. Now you can go to your Integrations and set up ZHA. This worked for me and i got my network back. Albeit, I had to re-rename everything. Which was a pain.

Let me know if this helped you.

Some Extra Notes:

I switched back my VM to q35 v4.2, as per the post I linked. Unsure if that also helped.

When I open the log for my Hass VM, I am getting this error: Domain id=13 is tainted: custom-ga-command. It seems that despite this, everything is working correctly.

My FINAL WORKING Unraid VM config. I took out the serial after DE and replaced it wil #s
<?xml version='1.0' encoding='UTF-8'?>

<domain type='kvm'>

  <name>Home Assistant v2</name>

  <uuid>58fc4601-ab12-d110-1e09-4e784dd59c48</uuid>

  <metadata>

    <vmtemplate xmlns="unraid" name="Linux" icon="linux.png" os="linux"/>

  </metadata>

  <memory unit='KiB'>4194304</memory>

  <currentMemory unit='KiB'>3145728</currentMemory>

  <memoryBacking>

    <nosharepages/>

  </memoryBacking>

  <vcpu placement='static'>4</vcpu>

  <cputune>

    <vcpupin vcpu='0' cpuset='2'/>

    <vcpupin vcpu='1' cpuset='8'/>

    <vcpupin vcpu='2' cpuset='5'/>

    <vcpupin vcpu='3' cpuset='11'/>

  </cputune>

  <os>

    <type arch='x86_64' machine='pc-q35-4.2'>hvm</type>

    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>

    <nvram>/etc/libvirt/qemu/nvram/58fc4601-ab12-d110-1e09-4e784dd59c48_VARS-pure-efi.fd</nvram>

  </os>

  <features>

    <acpi/>

    <apic/>

  </features>

  <cpu mode='host-passthrough' check='none' migratable='on'>

    <topology sockets='1' dies='1' cores='2' threads='2'/>

    <cache mode='passthrough'/>

  </cpu>

  <clock offset='utc'>

    <timer name='rtc' tickpolicy='catchup'/>

    <timer name='pit' tickpolicy='delay'/>

    <timer name='hpet' present='no'/>

  </clock>

  <on_poweroff>destroy</on_poweroff>

  <on_reboot>restart</on_reboot>

  <on_crash>restart</on_crash>

  <devices>

    <emulator>/usr/local/sbin/qemu</emulator>

    <disk type='file' device='disk'>

      <driver name='qemu' type='qcow2' cache='writeback'/>

      <source file='/mnt/user/domains/hassos_ova-4.10.qcow2'/>

      <target dev='hdc' bus='sata'/>

      <boot order='1'/>

      <address type='drive' controller='0' bus='0' target='0' unit='2'/>

    </disk>

    <controller type='pci' index='0' model='pcie-root'/>

    <controller type='pci' index='1' model='pcie-root-port'>

      <model name='pcie-root-port'/>

      <target chassis='1' port='0x10'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>

    </controller>

    <controller type='pci' index='2' model='pcie-root-port'>

      <model name='pcie-root-port'/>

      <target chassis='2' port='0x11'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>

    </controller>

    <controller type='pci' index='3' model='pcie-root-port'>

      <model name='pcie-root-port'/>

      <target chassis='3' port='0x12'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>

    </controller>

    <controller type='pci' index='4' model='pcie-root-port'>

      <model name='pcie-root-port'/>

      <target chassis='4' port='0x13'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/>

    </controller>

    <controller type='virtio-serial' index='0'>

      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>

    </controller>

    <controller type='sata' index='0'>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>

    </controller>

    <controller type='usb' index='0' model='ich9-ehci1'>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>

    </controller>

    <controller type='usb' index='0' model='ich9-uhci1'>

      <master startport='0'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>

    </controller>

    <controller type='usb' index='0' model='ich9-uhci2'>

      <master startport='2'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>

    </controller>

    <controller type='usb' index='0' model='ich9-uhci3'>

      <master startport='4'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>

    </controller>

    <interface type='bridge'>

      <mac address='52:54:00:5f:b5:b2'/>

      <source bridge='br0'/>

      <model type='virtio'/>

      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>

    </interface>

    <serial type='pty'>

      <target type='isa-serial' port='0'>

        <model name='isa-serial'/>

      </target>

    </serial>

    <serial type='dev'>

      <source path='/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE########'/>

      <target type='usb-serial' port='1'>

        <model name='usb-serial'/>

      </target>

      <alias name='serial0'/>

      <address type='usb' bus='0' port='4'/>

    </serial>

    <console type='pty'>

      <target type='serial' port='0'/>

    </console>

    <channel type='unix'>

      <target type='virtio' name='org.qemu.guest_agent.0'/>

      <address type='virtio-serial' controller='0' bus='0' port='1'/>

    </channel>

    <input type='tablet' bus='usb'>

      <address type='usb' bus='0' port='1'/>

    </input>

    <input type='mouse' bus='ps2'/>

    <input type='keyboard' bus='ps2'/>

    <graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='0.0.0.0' keymap='en-us'>

      <listen type='address' address='0.0.0.0'/>

    </graphics>

    <audio id='1' type='none'/>

    <video>

      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>

    </video>

    <memballoon model='virtio'>

      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>

    </memballoon>

  </devices>

</domain>