Linux - Run with sudo


I just started using CLion and can't find how to execute the built program as root (sudo). Is this even possible from the IDE?

In case this info is required:
     CLion 1.1.1
     Build #CL-141.2614

Thanks for your time and support!

Comment actions Permalink

Hi Victor!

Straightforward approach is to launch IDE under super user, according to this discussion some users considered it a good solution. If you feel like it's not an option for you, don't hesitate to submit request to our tracker. Description of use case would be very helpful.

Comment actions Permalink


I also need to debug my app as root. I'm testing the workaround (sudo (installPath)/clion/bin/

Clion start correctly but I'm getting these messages after loading my project :

Error:CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
Error:CMAKE_C_COMPILER not set, after EnableLanguage
Error:CMAKE_CXX_COMPILER not set, after EnableLanguage

It works fine in "normal" mode

In Settings/toolchains, Cmake 3.5.1 (make,c compiler en c++ compiler) are found.

Any idea ?




Comment actions Permalink

Hi again,

I've found how to resolve my issue :

- Settings/build/Cmake : Checkbox "Pass system environment variables" was unchecked.

After having checked it, there was some error message "failed simple builds" or something like that.

I had to set cmake path (/usr/bin/cmake) in Settings/build/toolchains, instead of "use bundled"

I can compile and execute in sudo mode now


Hope this helps



Please sign in to leave a comment.