vm
View and control a vSphere virtual machine’s console through vCenter: capture the screen, click, type, and send keys without installing software in the guest.
Instructions
Operate the screen of a VMware vSphere virtual machine through vCenter, the same way its console window does: look takes a picture of the VM's screen, click/move/drag/scroll use its mouse, type/key use its keyboard. Nothing is installed in the VM, so it also works at sign-in and lock screens, BIOS, installers, and when the VM's own network is down. This may be a real machine that people are using: look before acting, and click or type only what the user asked for. Name the VM in every call (vm=...); action='vms' lists them. There is no way to power on/off, reset or reconfigure a VM with this tool. Do not restart, shut down or sign out of a VM from its screen unless the user asked for exactly that.
Actions:
vms: the VMs vCenter knows, with power state, guest OS and IP address.
look: a picture of the VM's screen (at most max_width pixels wide, default 1568), and the real screen size.
click: at rx,ry (0-1000 across and down the screen, as seen in the look picture) or x,y (real screen pixels). button left/right/middle, count=2 for a double-click.
move: put the mouse at rx,ry (hover menus, tooltips).
drag: press at from_rx,from_ry (or from_x,from_y), move, release at rx,ry (or x,y).
scroll: amount notches at rx,ry (positive = up, negative = down).
type: type text with the VM's keyboard; only characters on the keyboard ("\n" presses Enter). layout is the guest's keyboard layout (us or jis); symbols come out wrong with the wrong layout.
key: press keys, e.g. "ctrl+alt+delete", "win+r", "alt+tab", "tab tab enter" (space-separated). then_look=true returns a new picture after click/move/drag/scroll/type/key. Look again before deciding that an action worked.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Screen x in real pixels (instead of rx) | |
| y | No | Screen y in real pixels (instead of ry) | |
| rx | No | click/move/drag/scroll: 0-1000 across the screen | |
| ry | No | click/move/drag/scroll: 0-1000 down the screen | |
| vm | No | The VM: its name in vCenter, its id (vm-123) or its IP address. Required for every action except vms | |
| keys | No | key: e.g. "ctrl+alt+delete" or "tab tab enter" | |
| text | No | type: the text | |
| count | No | click: 2 = double-click, 3 = triple-click | |
| action | Yes | What to do | |
| amount | No | scroll: notches, positive = up, negative = down | |
| button | No | Mouse button | |
| from_x | No | drag: start x in real pixels | |
| from_y | No | drag: start y in real pixels | |
| layout | No | type/key: the guest's keyboard layout | |
| from_rx | No | drag: start, 0-1000 across | |
| from_ry | No | drag: start, 0-1000 down | |
| max_width | No | look: largest picture width in pixels (default 1568) | |
| then_look | No | After the action, also return a new picture |