Skip to content

Guest Exec

mieweb exec runs one command as root in a running Proxmox container, for its owner or an admin. Manager uses only the node's Proxmox API (the termproxy console), so nothing is installed on the Proxmox hosts or in the guest, and the guest needs no SSH.

mieweb login
mieweb exec --site 1 --container 42 -- id
mieweb exec --site 1 --container 42 -- sh -c 'apt-get update && apt-get install -y curl'

--container is the Manager container ID, not the Proxmox VMID. Each word after -- is passed as one argument, without shell interpretation. Call sh -c explicitly for shell syntax.

Requirements

Requirement Detail
Node type Proxmox only. Docker and dummy nodes return exec_unavailable.
Console mode The container's cmode must be shell. Manager sets it on new containers (see below).
Node credentials VM.Audit, VM.Console and VM.Config.Options on the container. root@pam (see Nodes) has them; API tokens work too.
Guest tools sh, stty, mkdir, sleep, cat, wc, dd and od. Images without a shell (distroless) are unsupported.

Console mode

With cmode: shell, the Proxmox console of a container is a root shell without a login prompt. Manager sets it when it creates a container and when it reconfigures one.

Proxmox applies a cmode change to a running container only after it restarts. For containers created before this feature, the first mieweb exec sets cmode: shell and fails with exec_restart_required. Restart the container once, then run the command again.

Warning

Any Proxmox user with VM.Console on the container gets a root shell from the Proxmox web console without logging in.

Behavior

Item Behavior
User Guest root, in /, with stdin from /dev/null
Time limit 30 seconds, after which the command is killed (exec_timeout)
Output First 64 KiB of stdout and stderr each, reported separately with truncation flags
Exit status Returned as-is. A nonzero exit is still HTTP 200. Killed by a signal: 128 + signal number.
Arguments At most 128 arguments and 16 KiB in total, no NUL bytes
Background processes When the command returns, plain & jobs receive SIGHUP. Processes started with setsid, nohup or a service manager keep running. Their stdout and stderr stay attached to the command's capture files, which are deleted after the exec but keep using disk while written to, so redirect a long-running process's output (for example nohup app >/var/log/app.log 2>&1 &) or start it with a service manager.
Concurrency One command per container at a time, across all Manager processes (exec_busy). If the outcome is unknown (the connection dropped after the command was sent), or the Manager process died, the container stays busy until the claim expires after 150 seconds.
Audit Manager logs the caller, container, timing and outcome. Arguments and output are not logged.

If the connection drops after the command was sent, the result is exec_outcome_unknown. Check the container's state before running a command that changes state again.

Shared console session

Proxmox runs one console session per container, shared by every console connection. If someone has the container's Proxmox web console open while a command runs, they see the session and their typing reaches it. Keep the web console closed while using mieweb exec.