# Connecting to Linaro Forge using the remote client

## Related Videos
[Connecting to a remote system with Linaro Forge](https://www.youtube.com/watch?v=UPc2vdPIefg)

----

## Outline

1. Benefits of using the Remote Client
2. Prerequisites
3. Download and Installation
4. Configuring the Remote Connection
5. Connecting with Linaro Forge

----

## 1. Benefits of using the Remote Client
The Linaro Forge remote client offers several benefits over generic methods like X-forwarding (X11) or VNC.

**Performance and Speed:**
The Forge remote client is faster than remote X11, which is a significant advantage, especially over slower network connections.

**Native User Experience:**
It provides a native graphical user interface (GUI) on your local machine (Windows, Mac, or Linux), offering a better user experience than generic X-forwarded or VNC desktop sessions.

**Simplified Remote Interaction:**
Linaro Forge has unique capabilities to simplify remote interactive sessions for debugging and profiling. It supports a feature called "Reverse Connect" which is a convenient way for the client to access a job within the batch system. This method avoids the need to explicitly configure the debugger or profiler with program parameters, environment variables, or module files for the job launch.

![image_alt](screenshots/remote-client-benefits.png)

----

## 2. Prerequisites

Before configuring the client, ensure you meet the following requirements:

**Version Match:**
The Local Client version must match the Remote Server version. This can be checked on the remote system by running the command `ddt --version`. This version can be compared with the client version by looking at the bottom right of the Linaro Forge User Interface.

**SSH Access:**
Confirm that you are already able to SSH into the machine without DDT.

----

## 3. Download and Installation
Download the Linaro Forge Client for your local operating system (Windows, macOS, or Linux) [from the official Linaro downloads page](https://www.linaroforge.com/download-documentation/).

## 4. Configuring the Remote Connection

1. Open Linaro DDT on your local machine.

2. On the "Welcome Screen", click `Remote Launch` and select `Configure...`

![image_alt](screenshots/configure-remote-connections.png)

3. Click Add to create a new connection.

4. Fill in the following fields:

    * Connection Name: Give it a recognizable name (e.g., Production Cluster).
    * Host Name: Enter username@hostname (e.g., jdoe@login.hpc.university.edu).
        > Tip: If you have an SSH alias set up in your local ~/.ssh/config file, you can simply enter the alias here.
    * Remote Installation Directory: This is the directory where Forge/DDT is installed on the remote cluster. 
        > How to find this path: SSH into the cluster, load the module, and run: `$(dirname $(which ddt))`. Copy the output path and paste it into this field. It usually looks like: /opt/linaro/forge/<version>

5. Click OK to save the configuration.

[See the Remote Launch Settings documentation](https://docs.linaroforge.com/25.1.1/html/forge/forge/connecting_to_a_remote_system/remote_connections_dialog.html) for more information on the available remote launch settings fields.

----

## 5. Connecting to the Remote System

On the Forge Client "Welcome Screen", click `Remote Launch` and select the connection you configured in step 4.

On the remote system, run the following command:
>```bash
> ddt --connect
> ```

This will ask for a Reverse Connection Requestion on the Forge client. Press Accept to accept the connection.

![image_alt](screenshots/reverse-connect.png)

 ----