vm_guest_exec_output
Execute shell commands inside a VM and capture stdout, stderr, and exit code. Automatically detects guest OS and selects the correct shell.
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vm_name | Yes | ||
| command | Yes | ||
| username | No | root | |
| password | No | ||
| timeout | No | ||
| target | No |