Tools & Add-onsPVE Tools
PVE LXC Execute
Run one shell command inside every Debian and Ubuntu LXC container on a node.
execute.sh asks for a command and runs it with pct exec in every Debian or Ubuntu container you did not exclude.
Website entry: execute. Source: tools/pve/execute.sh.
Run
In the Proxmox VE host shell, as root:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/execute.sh)"Prompts
| Prompt | Choices | Effect |
|---|---|---|
| "This will execute a command inside selected LXC Containers. Proceed?" | Yes / No | No ends the script. |
| "Select containers to skip from executing:" (checklist) | All containers from pct list | Ticked containers are skipped. Cancel ends the script. |
Enter here command for inside the containers: | Free text | The command line to run. |
What it does
For every container that is not excluded:
- Containers whose
ostypeis notdebianorubuntuare skipped. - A stopped container (that is not a template) is started, given 5 seconds, and shut down again after the command.
- The command is first run as
bash -c "command <your command> >/dev/null 2>&1". If that fails, the container is reported ashas no commandand skipped. If it succeeds, the command is run a second time with its output shown.
Environment variables
| Variable | Default | Purpose |
|---|---|---|
COMMUNITY_SCRIPTS_CORE_URL | https://raw.githubusercontent.com/community-scripts/core/main | Base URL the script loads api/api.func from. |
Limits
- Because of the check described above, a command that succeeds runs twice in each container. Do not use it for commands that must run only once, such as appending to a file.
- A command that exists but returns a non-zero exit code is reported as missing.
- Alpine and other non-Debian containers are never touched.
- The command runs as root in each container and there is no undo.