> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Develop with Visual Studio Code via SSH

This guide will walk you through how to connect your development board (e.g. RB3 Gen-2 running Ubuntu) from your local computer using Visual Studio Code (VS Code) over SSH.

### Prerequsites

* The board has an updated Ubuntu image:
  * [Qualcomm Dragonwing RB3 Gen 2 Vision Kit](/devices/rb3-gen2-vision-kit)
  * [IQ-9075 EVK](/devices/iq9075-evk/setup)
* The board is connected to the internet.

### Step 1 — Enable SSH / Locate IP Address

1. Connect to the device using a serial port, see [Qualcomm docs: Configuring Ubuntu on the device](https://docs.qualcomm.com/bundle/publicresource/topics/80-90441-1/Use_Ubuntu_on_RB3_Gen2_3.html) (docs for RB3, but same apply to Rubik Pi 3).
2. Log in over the console, the default username is `ubuntu` and the default password is also `ubuntu`.
3. Ensure the network is set up (Ethernet or Wi-Fi).
4. Find the board’s IP address. For example via:

   ```
   sudo apt update && sudo apt install -y net-tools
   ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'
   # 192.168.1.253
   ```

### Step 2 — Install / Enable Remote ‑ SSH Extension in VS Code

On your **local** machine:

1. Open VS Code.
2. Go to Extensions.
3. Search for **Remote ‑ SSH** (by Microsoft) and install it.

### Step 3 — Add the Board as an SSH Host in VS Code

1. Open the **Command Palette** in VS Code (F1 or Command+Shift+P on macOS, Ctrl+Shift+P on Windows/Linux).

2. Run `Remote‑SSH: Add New SSH Host...`

3. Enter the SSH connection string, e.g.:

   ```
   ubuntu@board-ip-address
   ```

   *Optional:* If you are using a key, you can include the identity file:

   ```
   ssh -i ~/.ssh/id_rsa_board user@board-ip-address
   ```

4. Choose which SSH config file to use (usually `~/.ssh/config`). VS Code will insert an entry for your board.

   Example config snippet:

   ```
   Host my-board
       HostName 192.168.1.100
       User ubuntu
       IdentityFile ~/.ssh/id_rsa_board
   ```

### Step 4 — Connect to the Board via VS Code

1. In VS Code, open the Command Palette again → `Remote‑SSH: Connect to Host...`
2. Select your host (e.g. `ubuntu@board-ip-address` or the name you gave in the SSH config).
3. If prompted, select the platform of the remote.
4. After a short wait, VS Code will install the **VS Code Server** onto the board automatically. The status will be shown in the lower status bar.
5. Once connected, you can use **File → Open Folder...** to browse files on the board, open terminals (these will run on the board), and install extensions on the remote host as needed.

### Troubleshooting

* **VS Code Server uses excessive RAM:** Running many VS Code extensions on the remote host can consume large amounts of memory, leading to out-of-memory (OOM) errors and random network dropouts
  * **Solution:** Disable or selectively enable extensions on the remote host to reduce memory usage

* **SSH connection fails:** Board not reachable / wrong IP / SSH not running
  * **Solution:** Check network, run `ssh ubuntu@IP` from terminal, verify the board’s network tools are updated and working [over serial connection](https://docs.qualcomm.com/bundle/publicresource/topics/80-90441-1/Use_Ubuntu_on_RB3_Gen2_3.html) e.g.

    ```
    sudo apt update && sudo apt install -y net-tools
    ifconfig
    ```

* **Host platform detection incorrect:** VS Code guesses wrong (e.g. ARM vs x86)
  * **Solution:** Manually set `remote.SSH.remotePlatform` in VS Code settings

### Optional: Use SSH Key‑Based Authentication

To avoid typing passwords:

1. On your local machine, generate an SSH keypair if you don’t have one:

   ```
   ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa_board
   ```

2. Add the public key to your board:

   ```
   ssh-copy-id -i ~/.ssh/id_rsa_board.pub user@board-ip-address
   ```

3. Confirm that you can SSH in *without* a password.

4. Update your VS Code SSH configuration to refer to this key (as in Step 3).
