vm_guest_exec
Run a command inside a VM guest OS via VMware Tools. Without confirmation, previews the blast radius; with confirmation, returns exit code, stdout, stderr, and timeout status.
Instructions
[WRITE] Execute a command inside a VM via VMware Tools.
Requires VMware Tools running in the guest OS. Returns exit_code, stdout, stderr, timed_out, and blast_radius.
Without confirm=True this only previews: blast_radius names the VM (name, instance UUID), the guest account, the exact command, arguments and working directory, 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 identity or status that cannot be read, or a name that matches more than one VM.
Note: the Guest Ops API does not capture stdout/stderr directly, so use this only for fire-and-forget commands — prefer vm_guest_exec_output whenever you need the output.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | Optional vCenter/ESXi target name from config. | |
| command | Yes | Full path to program (e.g. "/bin/bash", "C:\Windows\System32\cmd.exe"). | |
| confirm | No | False (default) returns the blast radius and changes nothing. True applies it. | |
| 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. | |
| arguments | No | Command arguments (e.g. "-c 'whoami'"). | |
| working_directory | No | Working directory inside guest (optional). |