# Creating a shared device connection

## What is a shared device connection? <a href="#what-is-a-shared-device-connection" id="what-is-a-shared-device-connection"></a>

The Shared Device Connection feature allows Parallels Client to share one connection across all users using a computer.

You can define the shared connection during or after the installation of Parallels Client. The shared connection is stored on the system in the Local Machine registry hive.

When a user starts Parallels Client, it automatically makes a copy of the shared connection in the user profile with the shared settings. All the other settings are available for the user to modify unless the corresponding policies are set.

The connection can share the connectivity information only or both the connectivity information and the credentials.

An administrator can update the shared connection information or delete the shared connection.

{% hint style="info" %}
**Note:** Parallels Client supports only a single shared connection.
{% endhint %}

## How to execute a shared device connection command <a href="#how-to-execute-a-shared-device-connection-command" id="how-to-execute-a-shared-device-connection-command"></a>

### Using the installer <a href="#using-the-installer" id="using-the-installer"></a>

Use the `SHAREDDEVICE` argument to instruct the installer to perform a command related to the shared connection. The format is `SHAREDDEVICE="mode:settingsstring"`.\
You can use commands that use UI or commands that are executed silently.&#x20;

Example:\
\
`msiexec.exe /qn /i RASClient.msi SHAREDDEVICE="mode:settingsstring"`

### Using the Parallels Client application <a href="#using-the-parallels-client-application" id="using-the-parallels-client-application"></a>

You can work with the shared connection after Parallels Client is installed by using the following command:

`APPServerClient.exe -shareddevice "mode:settingsstring"`

Please ensure that the application is executed with elevated privileges using the **Run as administrator** option. This is required when storing information in the Local Machine registry hive.

## Arguments

### Available operations (modes)

The command string has the format `"mode:settingsstring"`, where the settings string depends on the mode. The following modes are possible:

* `0` - Delete the shared connection.
* `1` - Create or update a shared connection with shared connection settings.
* `2` - Create or update a shared connection with shared connection settings and credentials (the authentication type is set to **Credentials**).

### Shared device connection settings string <a href="#shared-device-connection-settings-string" id="shared-device-connection-settings-string"></a>

The `settingsstring` parameter will determine how to read or write the connection settings information. You can use one of the following values:

* `ui` — This will open the UI and let you enter the configuration arguments. Once you press **OK**, the settings are stored in the Local Machine registry hive.\
  e.g., `AppServerClient.exe -shareddevice 2:ui`
* `export:filepath` - This will open the UI and let you enter the configuration arguments. Once you press **OK**, the settings are saved to the file with the provided path.\
  e.g., `AppServerClient.exe -shareddevice 1:export:c:\test\shared.xml`
* `import:filepath` - Settings are imported from a configuration file, preferebly created with the export command, and stored in the Local Machine registry hive.\
  e.g., `AppServerClient.exe -shareddevice 1:import:c:\test\shared.xml`\
  Please use the same mode that was used when exporting the settings.

### Possible settings for different modes <a href="#shared-device-connection-settings-information-matrix" id="shared-device-connection-settings-information-matrix"></a>

| Setting               | Mode 1 | Mode 2                 |
| --------------------- | ------ | ---------------------- |
| Primary connection    | yes    | yes                    |
| Connection Mode       | yes    | yes                    |
| Port                  | yes    | yes                    |
| Secondary Connections | yes    | yes                    |
| Name                  | yes    | yes                    |
| Authentication Type   | yes    | Set to **Credentials** |
| Username              | no     | yes                    |
| Password              | no     | yes                    |
| Domain                | no     | yes                    |

## Examples

### Using the installer <a href="#using-the-installer.1" id="using-the-installer.1"></a>

* Use the UI to configure a shared connection:\
  `msiexec.exe /i cRASClient-x64.msi SHAREDDEVICE=1:ui`
* Use the UI to configure a shared connection and export the settings to a file. The connection is not added to the client:\
  `msiexec.exe /i cRASClient-x64.msi SHAREDDEVICE=1:export:filepath`
* Use the UI to import a previously exported shared connection. Since no UI is involved, this command can be executed in silent mode:\
  `msiexec.exe /qn /i cRASClient-x64.msi SHAREDDEVICE=1:import:filepath`

### Using the Parallels Client application <a href="#hardbreak-using-the-parallels-client-application" id="hardbreak-using-the-parallels-client-application"></a>

* Use the UI to configure a shared connection. This command requires elevated permissions (the **Run as administrator** option):\
  `AppServerClient.exe -shareddevice 1:ui`
* Use the UI to configure a shared connection and export the setting to a file. The connection is not added to the client:\
  `AppServerClient.exe -shareddevice 1:export:filepath`
* Use the UI to import a previously exported shared connection. Since no UI is involved, this command can be executed in silent mode. This command requires elevated permissions (the **Run as administrator** option).\
  `AppServerClient.exe -shareddevice 1:import:filepath`

## How to change the shared device connection via UI <a href="#hardbreak-how-to-change-the-shared-device-connection" id="hardbreak-how-to-change-the-shared-device-connection"></a>

You can use the information in the section above to update the shared connection settings. However, there is an easier way to do so:

1. Run Parallels Client with elevated permissions (using the **Run as administrator** option).
2. Right-click the shared connections and select **Connection Properties**.
3. Change the settings as necessary.
4. &#x20;Click **OK**.

When the shared connection settings are changed, they are automatically updated for all users. Restarting the client will immediately update the settings.

## How to delete the shared device connection <a href="#how-to-delete-the-shared-device-connection" id="how-to-delete-the-shared-device-connection"></a>

### Using the installer <a href="#using-the-installer.2" id="using-the-installer.2"></a>

`msiexec.exe /qn /i RASClient.msi SHAREDDEVICE="0:"`

### Using the Parallels Client application <a href="#using-the-parallels-client-application.1" id="using-the-parallels-client-application.1"></a>

Use the following command line in elevated mode using the “Run as administrator” option:

`APPServerClient.exe -shareddevice "0:"`

When deleting a shared connection, the copy of the connection is also removed from all users' profiles. Re-starting your Parallels Client application will synch the shared connection immediately.

## Troubleshooting

If you are executing a shared device command with the UI and a problem happens, you will be presented with a message explaining what the error is. If there is no UI, the same message is logged to the log file. Make sure that you check the log file of the elevated user and not the current user.

The following is a list of all possible messages that you might encounter:

| Message                                        | Details                                                                                                                                                                                        |
| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Settings saved successfully                    | Success. This message is never displayed on screen.                                                                                                                                            |
| Settings unsupported mode                      | This is not expected to happen and is there in case we add new modes in the future.                                                                                                            |
| Settings unsupported action                    | This is not expected to happen and is there in case we add new actions in the future or the shared connection configuration file is tempered with.                                             |
| You need elevated permissions                  | The process is deployed in the non-elevated mode, and the operation needs access to HKLM. Please ensure the process is executed with the **Run as Administrator** option.                      |
| Failed to clear information                    | Could not clear registry data.                                                                                                                                                                 |
| You cannot run UI in quiet mode                | UI and quiet mode cannot be used together. Please note that export also uses UI.                                                                                                               |
| Action canceled by user                        | Never displayed on screen.                                                                                                                                                                     |
| Failed to save settings in registry            | Unlikely to happen, but this error is thrown if the registry is not available. e.g., the parent keys are not present.                                                                          |
| Failed to read from file                       | The file location is not valid, or Parallels Client does not have the necessary permissions.                                                                                                   |
| Shared mode does not match that stored in file | Settings are exported with a different mode than the one used to import. You must use the same mode for both operations.                                                                       |
| Failed to export settings                      | The file location is not valid, or Parallels Client does not have the necessary permissions.                                                                                                   |
| Invalid argument                               | Wrong arguments set. Please note that when invalid arguments are passed to the MSI file, the setup will still be completed normally. You can change them later by using `AppServerClient.exe`. |


---

# 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/ras-windows-client-guide/v20/using-parallels-client-for-windows/parallels-client-command-line-parameters/creating-a-shared-device-connection.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.
