Hi.
I'm having trouble running commands using guest agent on a centos 7 VM.
I have installed qemu-guest-agent on VM and it's running. (tested via
Problem is I can't execute arbitrary commands from host.
I've tried it in different forms but all failed:
In last case, it recognizes "-c" as an option for "qm guest exec", not a bash option.
So how should I run commands using qm guest exec?
I'm having trouble running commands using guest agent on a centos 7 VM.
I have installed qemu-guest-agent on VM and it's running. (tested via
qm agent $VMID ping
)Problem is I can't execute arbitrary commands from host.
I've tried it in different forms but all failed:
Bash:
qm guest exec 384194 /bin/bash "ls"
{
"err-data" : "/usr/bin/ls: /usr/bin/ls: cannot execute binary file\n",
"exitcode" : 126,
"exited" : 1
}
qm guest exec 384194 /bin/bash "echo hello"
{
"err-data" : "/bin/bash: echo hello: No such file or directory\n",
"exitcode" : 127,
"exited" : 1
}
qm guest exec 384194 /bin/bash "echo" "hello"
{
"err-data" : "/usr/bin/echo: /usr/bin/echo: cannot execute binary file\n",
"exitcode" : 126,
"exited" : 1
}
qm guest exec 384194 /bin/bash "-c" "echo" "hello"
Unknown option: c
400 unable to parse option
qm guest exec <vmid> [<extra-args>] [OPTIONS]
In last case, it recognizes "-c" as an option for "qm guest exec", not a bash option.
So how should I run commands using qm guest exec?