CLion 2021.2 Help

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 gdbserver/lldb-server, Remote Debug (GDB/LLDB) and Remote GDB Server (GDB only).

Watch this webinar recording and refer to the tables below for a summary on remote development options in CLion.

System and IDE configuration

Full Remote ModeWSLRemote DebugRemote GDB Server
Local OSmacOS / Linux / WindowsWindows
  • macOS / Linux / Windows for GDB

  • macOS / Linux for LLDB

macOS / Linux / Windows
Remote OSLinuxCertain Linux distributions
  • Any OS supporting gdbserver for GDB

  • macOS / Linux or another supporting lldb-server for LLDB

Any OS supporting gdbserver and SSH
Connection protocolSSH-TCP / UDP or serial lineTCP / UDP or serial line;
SSH for uploading
Required tools rsync for macOS / Linux clients;
tar for Windows clients
-gdbserver or lldb-server on targetgdbserver on target
Sources locationLocallyLocallyLocally;
symbol file also placed locally
Locally
SynchronizationAutomatic for all sources;
manual resync of header search paths
Not requiredManualAutomatic for the binary
BuildingRemotelyOn WSLNot specifiedLocally (cross-compilation required)
Running
Debugging
RemotelyOn WSLProgram runs remotely under gdbserver/lldb-server;
CLion's GDB/LLDB connects to the running process
and debugs it locally
Program runs remotely under gdbserver;
CLion's GDB connects to the running process
and debugs it locally

Project-level settings

Full Remote ModeWSLRemote DebugRemote GDB Server
Project formatCMake / MakefileCMake / Compilation database / MakefileAnyCMake
ToolchainRemoteWSLNot specifiedDefault on macOS/Linux;
MinWG, Cygwin, WSL on Windows
Path mappingsCreated automatically,
customizable in deployment entry
Not requiredNot created automatically,
should be set up in run/debug configuration
Not created automatically,
should be set up in run/debug configuration

Steps of the workflow

Full Remote Mode

  1. Create a Remote toolchain:
    - provide credentials and check the connection,
    - wait for tools detection, provide the paths manually if required.

  2. Set the Remote toolchain as default or create an associated CMake profile.

    Switch to the remote toolchain in Settings/Preferences | Build, Execution, Deployment | Makefile.

  3. If needed, adjust path mappings in the deployment entry.

  4. Use the default profile or select the profile from step 2 for build, run, and debug.

    Call Tools | Makefile | Clean and Reload Makefile Project.

    In the configuration settings, point Executable to the remote binary.

WSL

  1. Configure WSL.

  2. Create a WSL toolchain and provide credentials.

  3. Set the WSL toolchain as default or create an associated CMake profile.

    Switch to the WSL toolchain in Settings/Preferences | Build, Execution, Deployment | Makefile.

  4. Use the default profile or select the profile from step 2 for build, run, and debug.

    Call Tools | Makefile | Clean and Reload Makefile Project.

    In the Makefile Application configuration, point Executable to the binary using the \mnt\.. notation.

Remote Debug

  1. Place the binary on the remote machine and symbol file on the local machine.

  2. In CLion, create a Remote Debug configuration:

    • provide the symbol file location,

    • specify connection details,

    • set up path mappings.

  3. Launch the program under gdbserver/lldb-server on the remote machine.

  4. In CLion, debug the configuration created on step 2.

Remote GDB Server

  1. Create a Remote GDB Server configuration:

    • provide the credentials to access the target,

    • configure the uploading process,

    • (optional) set the gdbserver connection details.

  2. Select the Debug CMake profile and start a debug session for the created configuration.

Last modified: 02 August 2021