Cockpit VNC and QEMU guest agent issues in Home Assistant OS KVM VM

I just wanted to share this info in case it helps anyone else. I’ve been running Home Assistant OS as a VM on a Linux Host using a combination of cockpit and virt manager to manage the VM. I imported this a long time ago, so maybe this wouldn’t occur today. It could also be how I imported it. But because these 2 things never impacted me, i didn’t worry much about it. But i decided to fix the issue today, and i wanted to share what i did in case it helps anyone.

Issue 1:
When using cockpit to manage the VM, VNC viewer inside the cockpit browser did not work.
Solution 1:
I used virt manager to edit the virtual machine xml code and added the following. Since I’m not used to manually editing the xml file, i made sure to back up anything first. But this worked for me, and then the VNC console in cockpit started working.

    <graphics type="vnc" port="-1" autoport="yes" listen="127.0.0.1">
      <listen type="address" address="127.0.0.1"/>
    </graphics>

Issue 2:
QEMU guest agent would not start in Home Assistant OS VM. I just happened to notice this one day when i was troubleshooting another issue, and i watched the boot process.
Solution 2:
I once again, had to change the virtual machine XML config and added the following. Note, i also had to change the spice port.

    <channel type="unix">
      <target type="virtio" name="org.qemu.guest_agent.0"/>
      <address type="virtio-serial" controller="0" bus="0" port="1"/>
    </channel>

This was on the same port “1” as “spicevmc” so the final edits actually looked like this after changing the port. I changed spice to port “2”. Virt manager notified me of my mistake at first when i attempted to apply my changes, so that was good.

    <channel type="unix">
      <target type="virtio" name="org.qemu.guest_agent.0"/>
      <address type="virtio-serial" controller="0" bus="0" port="1"/>
    </channel>
    <channel type="spicevmc">
      <target type="virtio" name="com.redhat.spice.0"/>
      <address type="virtio-serial" controller="0" bus="0" port="2"/>
    </channel>

I highly suspect this is becaue of how i imported the VM at the time, but i wanted to post this in case it helps someone else who might have these annoyances. Since i really like using cockpit, the VNC issue was my biggest complaint.

I’m not an expert, but this was my solution to my problem. I hope it helps someone else.

2 Likes