API: Quemu Guest Agent Windows No args

AdminSecNum

New Member
Feb 2, 2024
2
0
1
Hello, I have come to you regarding a problem when running pvesh on a Qemu Guest Windows agent.

I try to send a command for example netsh help

if I only send the netsh command, I get the PID back

Code:
pvesh create /nodes/XXXX/qemu/200/agent/exec --command 'netsh'

If I put an argument to the command it is no longer executed

Code:
pvesh create /nodes/XXXX/qemu/200/agent/exec --command 'netsh help'
Agent error: Guest agent command failed, error was 'Failed to execute child process (No such file or directory)'

in the qemu agent log I can see that the command is only in the path and that the arguments are empty :

Code:
1706861085.367996: debug: read data, count: 153, data: {"arguments":{"id":33244502},"execute":"guest-sync-delimited"}
{"arguments":{"path":"netsh help","capture-output":true,"arg":[]},"execute":"guest-exec"}

Code:
qm guest exec 200 -- 'netsh' 'help'

When I execute the command with qm it works, and I have the arguments visible in the logs

Code:
1706861225.320535: debug: read data, count: 154, data: {"execute":"guest-sync-delimited","arguments":{"id":33280402}}
{"arguments":{"arg":["help"],"path":"netsh","capture-output":true},"execute":"guest-exec"}

Any advice ?
 

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!