# Execute a Command in a Virtual Machine

**prlctl exec** <*vm\_id* | *vm\_name*> <*command*>

Executes a command inside a virtual machine. Parallels Tools must be installed in the virtual machine. Commands in Linux guests are invoked with bash -c.

#### Optional Parameters

**--current-user** or **--user** <*user\_name*>

Include the **--current-user** option to log in as the user currently logged in inside the guest OS; or use the **--user** parameter and specify a user name.

**--password** <*password*>

The user password

**-r**, **--resolve-paths**

Enable converting host paths to guest.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.parallels.com/landing/parallels-desktop-developers-guide/command-line-interface-utility/manage-virtual-machines-from-cli/general-virtual-machine-management/execute-a-command-in-a-virtual-machine.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
