← 返回命令列表

Linux command

qm-guest-exec 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Execute

qm guest exec 100 command arg1 arg2

Example

qm guest exec 100 command --synchronous 0

Example

qm guest exec 100 command --timeout 10

Example

qm guest exec 100 command --pass-stdin 1

说明

qm guest exec executes commands inside a virtual machine through the QEMU guest agent. This allows host-level control over guest operations without network access to the VM. The guest agent must be installed and running inside the VM for this to work.

参数

--synchronous _0|1_
Wait for the command to complete (default _1_). With _0_, qm guest exec returns a PID immediately; collect output later with qm guest exec-status.
--timeout _seconds_
Maximum time to wait for synchronous completion (default _30_). Forces an asynchronous run when exceeded.
--pass-stdin _0|1_
Forward the host's stdin to the guest command (default _0_).

FAQ

What is the qm-guest-exec command used for?

qm guest exec executes commands inside a virtual machine through the QEMU guest agent. This allows host-level control over guest operations without network access to the VM. The guest agent must be installed and running inside the VM for this to work.

How do I run a basic qm-guest-exec example?

Run `qm guest exec 100 command arg1 arg2` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --synchronous _0|1_ do in qm-guest-exec?

Wait for the command to complete (default _1_). With _0_, qm guest exec returns a PID immediately; collect output later with qm guest exec-status.