Working with CLion from windows remotely on Ubuntu machine

已回答

Hi

I have a C++ project on my Ubuntu machine, and I am programming using CLion while connecting to the machine using VNC viewer (this is not so comfortable obviously). I know that there supposed to be a way to connect to the machine using CLion. My goal is to work on my project from my windows PC (using CLion. By working I mean editing code and using the code suggestions of CLion), but still compile and build on the ubuntu machine (and do it from my windows machine). I managed to do it using PyCharm, but didn't to manage doing it with CLion. With PyCharm I edit my code on my windows machine (with the windows machine's interpreter), but the files are saved automatically to the ubuntu machine and when I run the code it runs on the ubuntu machine.

Can someone please guide me and tell me what is the best way to do that? If something is not clear, please ask.

Thanks.

1

Hello! For your scenario you can use  Microsoft Subsystem for Linux (WSL). WSL is a compatibility layer for running Linux binary executables natively on Windows 10. For now, it supports Ubuntu, OpenSUSE and SLES distributions. More info: 
https://www.jetbrains.com/help/clion/how-to-use-wsl-development-environment-in-clion.html ,
https://blog.jetbrains.com/clion/2018/01/clion-and-linux-toolchain-on-windows-are-now-friends/.

Or you can try using initial remote development support in CLion 2018.3 EAP. More info: 
https://www.jetbrains.com/help/clion/2018.3/remote-projects-support.html ,
https://blog.jetbrains.com/clion/2018/09/initial-remote-dev-support-clion/.

0
Avatar
Permanently deleted user

Hi Anna, Thanks for your comment.

I tried to use WSL without success. Just to make sure: I will have all of the code files on my windows machine and will be able to edit them. Once I edit a file it automatically uploads to the remote ubuntu machine. When I build the project, it builds it on the remote machine and downloads the build files to my windows machine. Am I right?

Thanks

0

> I tried to use WSL without success

What issues have you faced?

As for your question: your code files will be automatically uploaded to the remote Ubuntu machine (the remote Ubuntu WSL machine in case of WSL), the project will be built on the remote Ubuntu machine, the build files won't be automatically transferred to the local machine (but you can do it manually).

0
Avatar
Permanently deleted user

When I try to reload CMake it fails to generate. It states that it fails to create a folder and that I should delete the cmake folder manually. I tried to do it, and it still doesn't work. How can I use WSL with a remote Ubuntu machine? The only guides I found were on how to setup a "virtual" ubuntu on your own PC, and use it as a "remote" machine. I want to do exactly what Remote Host does in EAP, but because it doesn't work, maybe WSL will? My remote machine and my PC is on the same network though.

Thanks

0

WSL feature works only with WSL distributions from Microsoft Store. If you don't want to install a WSL Ubuntu distributive on your Windows machine, then this variant is not suitable for you.

If you want to have CLion on a Windows machine and to build a project on a remote Linux machine, you need to use the initial remote development support in CLion 2018.3 EAP. Have you tried to configure it according to https://www.jetbrains.com/help/clion/2018.3/remote-projects-support.html?

0

请先登录再写评论。