grep -R 'Working Proxmox QEMU Guest Agent on Alpine Linux' *
How about you write a guide for yourself on how to get the QEMU Guest Agent working on Alpine Linux?
Hold my “No Guest Agent configured” string, I’m going in!
This post (well, the whole blog) is more like a notepad for myself, and I cannot recommend applying my fix/es for production use before consulting a professional. As always with my stuff, it works, but is probably not the best way to solve the problem.
Upon cloning a bunch of Alpine Linux VMs (no, of course I did not follow “best” practices and create a template, I just blindly cloned a working VM), I noticed that the qemu-guest-agent wouldn’t work.
I don’t know. All I know is that I was greeted with the dreaded status: crashed output from running
service qemu-guest-agent status, as well as a /var/log/qemu-ga.log telling me that:
critical: failed to initialize guest agent channel
… was in my case was pretty simple, I noticed the /etc/conf.d/qemu-guest-agent file was misconfigured (well, not configured at all). It should work with the default config, but for some reason it didn’t. On any of my 10 VM clones. It worked flawlessly on the original VM, though.
# Specifies the transport method used to communicate to QEMU on the host side # Default: virtio-serial #GA_METHOD="virtio-serial" # Specifies the device path for the communications back to QEMU on the host # Default: /dev/virtio-ports/org.qemu.guest_agent.0 #GA_PATH="/dev/virtio-ports/org.qemu.guest_agent.0"
Make sure you have enabled QEMU Guest Agent under the VM options.
First, find the device name, in my case it’s /dev/vport2p1. A simple
ls /dev/vport* will get you far.
Second, add it to the /etc/conf.d/qemu-guest-agent file:
echo 'GA_PATH="/dev/vport2p1"' >> /etc/conf.d/qemu-guest-agent
Second Second, symlink
Third, make sure qemu-guest-agent runs on boot:
rc-update add qemu-guest-agent
There are some false posts/discussions online saying that qemu-guest-agent requires udev in order to function properly. To save yourself some disk space, I can confirm my QEMU Guest Agent is working fine without the udev package installed.