Examples not working?

Work with RStudio #

R is available on Wynton HPC via a contributed environment module. It can be run interactively in the terminal via R on a development node, as explain on the how-to ‘Work with R’ page. To run R via the RStudio IDE, there are two options:

  1. The RStudio Server via the web browser (recommended)

  2. The RStudio Desktop over X11 Forwarding

Running desktop applications over X11 forwarding works, but depending on your network connection, you will experience more or less lag. For instance, you might see a small delay between a key is pressed and it is echoed at the R prompt. Similarly, plotted graphics might take some time to render. This is also true for the RStudio Desktop. Because of this, we recommend running a personal RStudio Server instance, because that is designed to run remotely.

Regardless which one you use, you will be running the same version of R as you would when running from the terminal and all your installed packages will be available in either.

Alt 1. Personal RStudio Server #

You can run a personal RStudio Server instance, which you, and only you, can access via your local web browser. Contrary to RStudio Desktop, this approach does not require X11 forwarding. Instead, it does require running two separate SSH connections to the cluster: (i) one to launch RStudio Server, and (ii) one to connect to it.

Step 1. Launch your own RStudio Server instance #

Assuming you are already logged on to a development node, launch your personal RStudio Server instance as:

[alice@dev1 ~]$ module load CBI rstudio-server-controller
[alice@dev1 ~]$ rsc start
alice, your personal RStudio Server 2023.09.1-494 running R 4.3.2 is available on:


Importantly, if you are running from a remote machine without direct access
to dev1, you need to set up SSH port forwarding first, which you can do by

  ssh -L 20612:dev1:20612 alice@log1.wynton.ucsf.edu

in a second terminal from your local computer.

Any R session started times out after being idle for 120 minutes.
WARNING: You now have 10 minutes, until 2023-11-15 17:06:50-08:00, to
connect and log in to the RStudio Server before everything times out.
Your one-time random password for RStudio Server is: y+IWo7rfl7Z7MRCPI3Z4

There are two things you should pay extra attention to here:

  1. The one-time random password that was generated

  2. The instructions how to log in to the cluster with SSH port forwarding

You will need both below.

Step 2. Connect to your personal RStudio Server instance #

On your local computer, log into the cluster in a second terminal following the instruction above. Make sure to use your own username and make sure to use the port number (e.g. 20612) that was assigned to you.

{local}$ ssh -L 20612:dev1:20612 alice@log1.wynton.ucsf.edu
alice1@log1.wynton.ucsf.edu:s password: XXXXXXXXXXXXXXXXXXX
[alice@log1 ~]$ 

Step 3. Open RStudio Server in your local web browser #

If you successfully completed the above two steps, and you made sure to use the correct port, then you should be able to open your personal RStudio Server in your local web browser by going to:

You will be presented with a ‘Sign in to RStudio’ web page where you need to enter:

  1. Your cluster username (e.g. alice)
  2. The one-time random password displayed in Step 1 (e.g. y+IWo7rfl7Z7MRCPI3Z4)

After clicking ‘Sign In’, you should be redirected to the RStudio interface.

To terminate the RStudio Server, start by exiting R by typing quit() at the R prompt. Then press Ctrl-C in the terminal where you called rsc start. Alternatively, run rsc stop in another terminal, e.g. the second one used in Step 2.

Stuck at “R is taking longer to start than usual”? #

Some users report that they stuck when they try to log in to RStudio. After they enter their username and password, and click ‘Sign In’, they get to a page “R is taking longer to start than usual” with a spinner that never ends. The user is presented with three options ‘Reload’, ‘Safe Mode’, and ‘Terminate R’. Ideally, ‘Safe Mode’ or ‘Terminate R’ would solve the problem and let the user access the RStudio GUI. Unfortunately, for some users, none of these options help. Consecutive attempts to use rsc stop and rsc start fail for same reasons.

As of 2023-12-04, it is not clear why and when this happens. The one workaround we have found is to wipe the user’s RStudio setup. For this, we recommend to use:

$ tar -cvf ~/rstudio-config.tar ~/.local/share/rstudio && rm -rf ~/.local/share/rstudio

This will create a local copy of your problematic RStudio setup in file ~/rstudio-config.tar, and, only then, remove the actually settings. The next time you call rsc start, you should start out with a fresh RStudio setup, and the login issue should be gone.

Alt 2. RStudio Desktop over X11 Forwarding #

To run the RStudio Desktop client, you must be logged via SSH with X11 forwarding enabled. Then load the rstudio (Desktop) module from the CBI stack and launch rstudio:

[alice@dev1 ~]$ module load CBI rstudio
[alice@dev1 ~]$ rstudio
TTY detected. Printing informational message about logging configuration.
Logging configuration loaded from '/etc/rstudio/logging.conf'. Logging to

You should see the RStudio Desktop interface appear after a few seconds. If you get a blank window, which some macOS users have reported, retry with:

[alice@dev1 ~]$ QMLSCENE_DEVICE=softwarecontext rstudio

To exit the RStudio Desktop, type quit() at the R prompt, or press Ctrl-C in the above terminal.