vm_guest_exec_output
Execute shell commands inside a VM and capture stdout/stderr automatically. Preview the blast radius before running, then receive exit code, output, and OS family in the response.
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. Prefer this over vm_guest_exec whenever you need the output. Requires VMware Tools running and a writable temp directory in the guest.
Returns exit_code, stdout, stderr, timed_out, os_family, and blast_radius.
Without confirm=True this only previews: blast_radius names the VM (name, instance UUID), the guest account, the exact command and the shell it runs through, VMware Tools status and any blockers; nothing runs. Show it to the user. Do not set confirm=True on your own because the user asked earlier: they have not seen the preview yet. Refused outright: VM not powered on, VMware Tools not running, an unreadable identity or status, or a name that matches more than one VM.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | Optional vCenter/ESXi target name from config. | |
| command | Yes | Shell command (e.g. "df -h", "ls /etc", "ipconfig"). | |
| confirm | No | False (default) returns the blast radius and changes nothing. True applies it. | |
| timeout | No | Max wait seconds (default 300). | |
| vm_name | Yes | Target VM name. | |
| password | No | Guest OS password. | |
| username | Yes | Guest OS account to run as. Required — there is no default, so a call can never act as root without choosing root. |