vm_guest_exec_output
Executes shell commands inside a VM and captures stdout, stderr, and exit code. Automatically detects Linux or Windows guest OS.
Instructions
[WRITE] Execute a shell command inside a VM and capture stdout + stderr.
Automatically detects guest OS (Linux/Windows) and selects the correct shell. Output is captured by redirecting to a temp file, downloading it, then cleaning up — no manual redirection needed.
Returns exit_code, stdout, stderr, timed_out, os_family.
Args: vm_name: Target VM name. command: Shell command (e.g. "df -h", "ls /etc", "ipconfig"). username: Guest OS username (default "root"). password: Guest OS password. timeout: Max wait seconds (default 300). target: Optional vCenter/ESXi target name from config.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"vm_name": "<vm_name>",
"command": "<command>"
},
"name": "vm_guest_exec_output"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | ||
| command | Yes | ||
| timeout | No | ||
| vm_name | Yes | ||
| password | No | ||
| username | No | root |