[SOLVED] Windows Server 2022 - QEMU Guest Agent Exec (Failed to execute child process (No such file or directory)

linushstge

Well-Known Member
Dec 5, 2019
77
10
48
Proxmox info:
- Version: 8.0.4 (pve-manager/8.0.4/d258a813cfa6b390)

VM info:
- Windows Server 2022 (Latest)
- QEMU GA enabled
- Machine: Default (i440fx) 8.0
- VirtIO Drivers: 0.1.240 (Latest)

Problem:
After running sysprep for further cloning of Windows servers, the QEMU guest agent is unable to execute any command.

Windows 2022 Services:

qemu-ga-w2022.png

Proxmox CLI:

Code:
qm guest exec <VM-ID> "netsh help"

Agent error: Guest agent command failed, error was 'Failed to execute child process (No such file or directory)'

Windows Shell:
1698071143090.png

All other qemu agent commands like "get-fsinfo", "info" works as expected. Agent ping also exits with code 0.

Code:
qm guest cmd <VM-ID> info
      {
         "enabled" : true,                # as expected
         "name" : "guest-exec",
         "success-response" : true
      },
      {
         "enabled" : true,                # as expected
         "name" : "guest-exec-status",
         "success-response" : true
      },

Does anyone have an idea how to solve this problem or do i miss something?
 
Last edited:
I dont have a VM to try at this moment, but I suspect the issue is your quoting.
The man page states:
qm guest exec <vmid> [<extra-args>] [OPTIONS]

Executes the given command via the guest agent

<vmid>: <integer> (1 - N)
The (unique) ID of the VM.

<extra-args>: <array>
Extra arguments as array
You can also find an example here: https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/qemu/{vmid}/agent/exec


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Thank you very, very much!

That was exactly the problem.

I already suggested earlier in this national topic to rename "command" to "commands" for the PVE 8 implementation to still support the command string implementation.

Proposal for PVE 8:

- command (singular) still as string implementation (internal translation into the new array structure if necessary).

- commands (plural) as array implementation [mark command as deprecated for PVE 9].
 

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!