qemu-guest-agent service fail to start due to missing device file (ie: /dev/vport3p1)
In recent Alpine versions (ie: 3.12.x) the qemu-guest-agent service fails to start due to a missing device file for the guest agent channel (ie: /dev/vport3p1) that is used for communication with the hypervisor.
The QEMU guest agent log will show errors similar to:
1606834487.940191: critical: error opening channel: No such file or directory
1606834487.940212: critical: error opening channel
1606834487.940218: critical: failed to create guest agent channel
1606834487.940223: critical: failed to initialize guest agent channel
1606834726.256900: critical: error opening channel: No such file or directory
1606834726.256927: critical: error opening channel
1606834726.256933: critical: failed to create guest agent channel
1606834726.256938: critical: failed to initialize guest agent channel
1606835089.922209: critical: error opening channel: No such file or directory
1606835089.922647: critical: error opening channel
1606835089.922657: critical: failed to create guest agent channel
1606835089.922663: critical: failed to initialize guest agent channel
This device file should be automatically created on boot and udev in Alpine already contains the necessary rules to create it but unfortunately since udev services are not configured to automatically start on boot by default, the device file is not created and the QEMU guest agent fails to start.
In order to solve this, udev must be installed along the qemu-guest-agent package:
apk add udev qemu-guest-agent
And the udev services must also be enabled to automatically start on boot:
rc-update add udev sysinit
rc-update add udev-trigger
rc-update add udev-settle
rc-update add udev-postmount
rc-update add qemu-guest-agent
After rebooting, the QEMU guest agent service should be able to start successfully.
Thanks.