Technical

Fix qemu-guest-agent Not Working in a CentOS 7 Proxmox VM

Fix qemu-guest-agent Not Working in a CentOS 7 Proxmox VM

qemu-guest-agent does not work on CentOS 7? Check the service, the virtio-serial device, and SELinux. One of those is almost always the problem.

Focused detail of a modern server rack with blue LED indicators in a data center.

Check the service first

Is qemu-guest-agent even running? On CentOS 7 it’s a systemd service. Start it and enable it so it comes back after a reboot.

systemctl start qemu-guest-agent
systemctl enable qemu-guest-agent
systemctl status qemu-guest-agent

If status shows it failed, look at the journal. The error usually tells you exactly what’s wrong.

journalctl -u qemu-guest-agent

Check the virtio-serial device

The agent talks to Proxmox over a virtio-serial port. If the VM doesn’t have that device, nothing works. In Proxmox, the VM’s hardware tab needs a serial device with type socket and the agent enabled. The device name is usually org.qemu.guest_agent.0.

Inside CentOS 7, check if the device exists.

ls /dev/virtio-ports/

If it’s empty, the device isn’t attached. Add it in Proxmox: shut down the VM, go to Hardware, add a serial device, set it to socket, and check the qemu-guest-agent box. Then boot the VM again.

Detailed close-up of ethernet cables and network connections on a router, showcasing modern technology.

Check SELinux

CentOS 7 ships with SELinux enforcing. The agent needs to talk to that virtio port, and SELinux can block it. Check for denials.

ausearch -m avc -ts recent | grep qemu-ga

If you see denials, fix the context. The package usually ships with a policy, but sometimes it’s not applied. You can restore the context or create a local policy. The quick and dirty way is to put SELinux in permissive mode temporarily to see if that’s the issue.

setenforce 0
systemctl restart qemu-guest-agent
# test, then setenforce 1

If it works in permissive mode, you know SELinux is the culprit. Then you can either write a proper policy or just leave it permissive if you don’t care about security on that VM. I’d write the policy, but for a homelab, permissive is fine.

Confirm Proxmox sees the agent

Once the service is running and the device is there, Proxmox should show the agent as running in the VM summary. If it still doesn’t, check the Proxmox task log for errors. Sometimes the agent needs a kick: restart it inside the VM and then check again.

Also, make sure the VM’s OS type is set correctly in Proxmox. If it’s set to something weird, the agent might not be detected. Set it to Linux 7.x or CentOS 7.

This is annoying because the error messages are often useless. But going through these three things — service, device, SELinux — usually nails it. If you’re still stuck, check out this checklist for SSH in LXC; the same methodical approach applies.

Leave a comment

Comments are reviewed before they appear. Your email is never published.