[SOLVED] Using qmemu-ga to send QMP commands to the host

sesquipedality

New Member
May 19, 2020
12
3
3
45
I have been trying to control my VM from within it by using qemu-ga to send monitor commands to the host. I run a new qemu-ga instance as follows

qemu-ga -d -m unix-listen -p /var/run/qemu-ga.socket

I then attach to the socket using

socat - unix:/var/run/qemu-ga-socket

This then accepts JSON commands, but valid QMP commands don't seem to work

{ "execute": "qmp_capabilities" }
{"error": {"class": "CommandNotFound", "desc": "The command qmp_capabilities has not been found"}}
{ "execute": "query-commands" }
{"error": {"class": "CommandNotFound", "desc": "The command query-commands has not been found"}}

I am aware of the need to send a "qmp_capabilities" command to 'activate' the other commands, but this does not work. Stopping the existing qemu-agent using systemctl also has no effect on the outcome. I have also used rlwrap rather than socat directly, but this makes no difference.

What am I doing wrong? Thanks.
 
I think I just answered my own question - whatever JSON qemu-ga is expecting, it does not appear to be QMP commands. To use these, it is necessary to connect from the host. The appropriate socket is created by proxmox, and is found at /var/run/qemu-server/<id>.qmp.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!