Remote Development
There are several options for remote development in CLion, each targeting a particular subset of the setups: Full Remote Mode, WSL, and two variants of using GDB/gdbserver, GDB Remote Debug and Remote GDB Server.
To help you compare these options and choose the most suitable one, we summarized their details in the tables given below. Learn more from our webinar Remote Development with CLion and the articles dedicated to each option.
System and IDE configuration
Full Remote Mode | WSL | GDB Remote Debug | Remote GDB Server | |
---|---|---|---|---|
Local OS | macOS / Linux / Windows | Windows | macOS / Linux / Windows | macOS / Linux / Windows |
Remote OS | Linux | Certain Linux distributions | Any OS supporting gdbserver | Any OS supporting gdbserver and SSH |
Connection protocol | SSH | SSH | TCP / UDP or serial line | TCP / UDP or serial line; |
Required tools | - | gdbserver on target | gdbserver on target | |
Sources location | Locally | Locally | Locally; | Locally |
Synchronization | Automatic for all sources; | Not required | Manual | Automatic for the binary |
Building | Remotely | On WSL | Not specified | Locally (cross-compilation required) |
Running Debugging | Remotely | On WSL | Program runs remotely under gdbserver; | Similar to GDB Remote Debug |
Project-level settings
Full Remote Mode | WSL | GDB Remote Debug | Remote GDB Server | |
---|---|---|---|---|
Project format | CMake | CMake / Compilation database | Any | CMake |
Toolchain | Remote | WSL | Not specified | Default on macOS/Linux; |
Path mappings | Created automatically, | Not required | Not created automatically, | Not created automatically, |
Steps of the workflow
Full Remote Mode
Create a Remote toolchain:
- provide credentials and check the connection,
- wait for tools detection, provide the paths manually if required.Set the Remote toolchain as default
or create an associated CMake profile.If needed, adjust path mappings in the deployment entry.
Use the default profile or select the profile from step 2 for build, run, and debug.
WSL
Create a WSL toolchain and provide credentials.
Set the WSL toolchain as default
or create an associated CMake profile.Select the default profile or the profile from step 3 for build, run, and debug.
GDB Remote Debug
Place the binary on the remote machine and symbol file on the local machine.
In CLion, create a GDB Remote Debug configuration:
provide the symbol file location,
specify connection details,
set up path mappings.
Launch the program under gdbserver on the remote machine.
In CLion, debug the configuration created on step 2.
Remote GDB Server
Create a Remote GDB Server configuration:
provide the credentials to access the target,
configure the uploading process,
(optional) set the gdbserver connection details.
Select the Debug CMake profile and start a debug session for the created configuration.