Hello from a new user,
In most guides I run across the common way to connect the HAOS KVM guest with a USB zigbee adapter is with USB passthrough, but unfortunately USB passthrough protocol might use more CPU in the host than the HAOS guest itself.
It’s perhaps simpler to configure ZHA with the guest using USB passthrough first because the UI seem to like to see the USB device, but once you successfully configured ZHA, and you notice the increased CPU load in the host, you may want to switch the config to use pci-serial.
In qemu command line terms it means to replace:
-chardev serial,path=/dev/ttyUSB0,id=serial-usb0 -device pci-serial,chardev=serial-usb0
You also need the cp210x kernel module in loaded in the host (east to check with lsmod). At last you need to be in the dialout group (as in /etc/group) or otherwise to have enough permission to open /dev/ttyUSB0.
After the KVM config change, you can boot again and then ssh into HAOS (inside the ssh container, host root not required) and edit ~/config/.storage/core.config_entries, search 115200 and change the line above that starts with “/dev/serial…” to point to “/dev/ttyS1” or maybe S0 if you had no other serial line. The actual number depends on your machine type topology. Then reboot (the guest).
At the next boot, assuming you picked the right guest serial line number, ZHA should be working again, no need to touch the ZHA configuration UI.
If pci-serial doesn’t work for whatever reason, it should be possible to reboot the guest back into USB passthrough mode. Once back in USB passthrough mode, the HAOS UI should be able to fixup ZHA with a few clicks. I successfully switched back and forth from USB passthrough and pci-serial with the above procedure no apparent regression.
Hope this helps save some CPU power. It should be applicable to all KVM based solutions using the qcow2 image, enjoy.