Can I install RStudio on c9?


#1

I have created an account on Cloud9 to work on R. I could successfully install R on it. However, as I am more used to working on the R IDE which is RStudio, I was trying to install it on the system. After lot of troubleshooting and googling I was able to resolve all the errors and I could successfully install RStudio. However, when I try to launch it by typing rstudio on terminal. It gives an error stating

QXcbConnection: Could not connect to display
Aborted

Is it possible to use RStudio at all?


#2

you may be able ro use rstudio server https://www.rstudio.com/products/rstudio/download-server/


#3

I installed rstudio server from the instructions given. However, I still could not launch rstudio server. I tried,

rstudio-server
Also,

rstudio-server start

nothing happens using these commands.

When I do

rstudio-server verify-installation

I get an error,

26 Dec 2016 09:42:11 [rserver] ERROR system error 22 (Invalid argument); OCCURRED AT: rstudio::core::Error rstudio::server::app_armor::enforceRestricted() /home/ubuntu/rstudio/src/cpp/server/ServerAppArmor.cpp:90; LOGGED FROM: int main(int, char* const*) /home/ubuntu/rstudio/src/cpp/server/ServerMain.cpp:511


#4

see https://support.rstudio.com/hc/en-us/community/posts/202190728-install-rstudio-server-error?page=1#community_comment_213178427 you need to add server-app-armor-enabled=0 to etc/rstudio/rserver.conf
and start the server with /usr/lib/rstudio-server/bin/rserver --server-daemonize=0

after that create a file named nginx.conf in ~/workspace

user www-data;
worker_processes 4;
pid /run/nginx.pid;

events {
	worker_connections 768;
	# multi_accept on;
}

http {

  map $http_upgrade $connection_upgrade {
      default upgrade;
      ''      close;
    }

  server {
    listen 8081;
    
    
    location /rstudio/ {
      rewrite ^/rstudio/(.*)$ /$1 break;
      proxy_pass http://localhost:8787;
      proxy_redirect http://localhost:8787/ $scheme://$host/rstudio/;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $connection_upgrade;
      proxy_read_timeout 20d;
    }
  }
}

and then open https://<workspace>-<user>.c9users.io:8081/rstudio/


#5

You can also launch the Rstudio desktop version via cloud9-vnc which worked for me.

First install R & Rstudio

sudo apt-get update
sudo apt-get install r-base

sudo apt-get install gdebi-core
wget h t t p s ://download1.rstudio.org/rstudio-1.0.136-amd64.deb
sudo gdebi rstudio-1.0.136-amd64.deb

To install cloud9-vnc

cd ~
mkdir plugins
cd plugins
git clone https://github.com/acabey/cloud9-vnc.git
cd cloud9-vnc
sudo ./install.sh

To install all the dependencies:

sudo apt-get update
sudo apt-get install supervisor
sudo apt-get install x11vnc
sudo apt-get install xvfb
sudo apt-get install fluxbox
sudo apt-get install novnc

To start the vnc client:
In the menu go to custom C9 runner:

Run > Run With > C9vnc

Go to //-.c9users.io/vnc.html (x11 available via there)
Open a bash shell (Right mouse click -> Applications > Shells > Bash)
type rstudio (enter) to start rstudio


#6

thks jeborsel… Works perfectly …great… many thks


#7

https://-.c9users.io:8081/rstudio/
changed to
https://-.c9users.io:8080/rstudio/
ok then


#8

actually … after a few new tests . some pbs with the editor… Tab when i type sthing else,…


#9

Hello Jeborsel, this actually did not work for me. I went through your tutorial, to this point without errors:
“Go to //-.c9users.io/vnc.html (x11 available via there)
Open a bash shell (Right mouse click -> Applications > Shells > Bash)
type rstudio (enter) to start rstudio”

The feedback was this:
":~/workspace $ rstudio
QXcbConnection: Could not connect to display
Aborted"


#10

This sounds as if you are trying to open rstudio from within your cloud9 bash, but you should connect to your VNC and run from the bash within the VNC, which is located at //[workspacename]-[username].c9users.io/vnc.html when you use the runner in your menu: Run > Run With > C9vnc


#11

Gotcha! Yes I did this and had no errors and nothing started.

2017-02-11 22:09:52,742 INFO supervisord started with pid 12845
2017-02-11 22:09:53,743 INFO spawned: ‘novnc’ with pid 12848
2017-02-11 22:09:53,745 INFO spawned: ‘xvfb’ with pid 12849
2017-02-11 22:09:53,746 INFO spawned: ‘x11vnc’ with pid 12850
2017-02-11 22:09:53,748 INFO spawned: ‘fluxbox’ with pid 12851
2017-02-11 22:09:54,939 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-02-11 22:09:54,939 INFO success: xvfb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-02-11 22:09:54,939 INFO success: x11vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-02-11 22:09:54,940 INFO success: fluxbox entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)


#12

Not sure if I understand correctly now. Did you manage to open a shell from within the vnc display?

Right mouse click
-> Applications > Shells > Bash


#13

Thank you! But I have a problem in the last step:

When I type rstudio it says that the command is not found…


#14

hey jeborsel thx for your post, it indeed works, the only problem is that im with a free account/500MB RAM and Rstudio is not responding at all after launch, the interface toally freezes :confused: