Skip to main content
POST
/
execute
curl -X POST "http://VM_API_IP:PORT/execute" \
  -H "Content-Type: application/json" \
  -d '{"command": ["ls", "-la", "/home/user"], "shell": false}'
{
  "stdout": "total 48\ndrwxr-xr-x 12 user user 4096 Nov 20 10:00 .\ndrwxr-xr-x  3 root root 4096 Nov 15 08:00 ..\n-rw-r--r--  1 user user  220 Nov 15 08:00 .bash_logout\n",
  "stderr": "",
  "exit_code": 0
}
Executes a shell command or script inside the VM. Use this for programmatic control of the desktop environment.
Replace VM_API_IP:PORT with the actual IP and port of the VM’s Desktop Environment API server.

Request Body

command
array
required
Command and arguments as an array. For example: ["ls", "-la", "/home/user"]
shell
boolean
default:"false"
Whether to run the command in shell mode

Response

stdout
string
Standard output from the command
stderr
string
Standard error output from the command
exit_code
number
Exit code of the command (0 = success)
curl -X POST "http://VM_API_IP:PORT/execute" \
  -H "Content-Type: application/json" \
  -d '{"command": ["ls", "-la", "/home/user"], "shell": false}'
{
  "stdout": "total 48\ndrwxr-xr-x 12 user user 4096 Nov 20 10:00 .\ndrwxr-xr-x  3 root root 4096 Nov 15 08:00 ..\n-rw-r--r--  1 user user  220 Nov 15 08:00 .bash_logout\n",
  "stderr": "",
  "exit_code": 0
}