Run shell from r-studio

Hello everybody,

at the moment I am trying to set up a ssh-tunnel on windows 10 and for convenience I wanted to start it from within R/r-studio with the "shell" or "system" command from the base-package. From a plain command shell (cmd.exe) the ssh tunnel is working perfektly as well as from RGUI. Only when I try to run the R-script from inside r-studio, the cmd-shell flashes up and closes immediately and the ssh command was not executed. I am using openssh from the windows/system32 folder. Maybe helpful: if I install openssh inside the my user-folder (for instance by using scoop [c.f. hhtps://]) everything is working fine too! Unfortunately I am working together with some other people and I cannot urge them to install an exta version of openssh inside their user-folder.

So it somehow seems to be an issue of access privileges for r-studio? Has anyone experienced similar problems or an idea to go on?

Thank you very much!
KR, Alex

Hello everybody,

I could finally resolve this issue! It was no matter of access privileges, but I had to unset the display environment variable with sys.unsetenv("DISPLAY"). Now the "shell" as well as the "system" commands are working fine.

I also changed the title of this thread since the issue was not about access privileges.

Best regards,


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.