LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

qm-guest-exec

Run commands inside a Proxmox VM

TLDR

Execute a command via guest agent
$ qm guest exec 100 command arg1 arg2
copy
Execute asynchronously
$ qm guest exec 100 command --synchronous 0
copy
Execute with timeout of 10 seconds
$ qm guest exec 100 command --timeout 10
copy
Execute and forward stdin to guest
$ qm guest exec 100 command --pass-stdin 1
copy

SYNOPSIS

qm guest exec vmid command [arguments...] [options]

DESCRIPTION

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.

PARAMETERS

--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).

CAVEATS

Requires QEMU guest agent to be installed and running in the VM. Some commands may require specific permissions within the guest OS.

HISTORY

Part of Proxmox VE QEMU/KVM management tools. Guest agent communication provides out-of-band management capabilities.

SEE ALSO

qm(1), qm-agent(1)

Copied to clipboard
Kai