Skip to content

Suggestion for using R in WSL - run RStudio in WSL through a Linux graphical desktop #1

Closed
@remlapmot

Description

@remlapmot

I really enjoyed your blog about running R on Ubuntu on WSL.

I don't know if this is the best way to contact you - anyway - there is another method you could include.

You can install a graphical desktop environment in WSL and then run the Ubuntu version of RStudio in there.

I have followed online which show how to install MATE desktop and KFCE4 desktop on WSL (I can't make GNOME 3 work), e.g. here.

Below is some more possibly helpful info:

  • You need an X11 client for Windows e.g. Vcxsrv
  • Install MATE desktop in WSL with:
sudo apt update && apt upgrade -y
sudo apt install ubuntu-mate-desktop --no-install-recommends -y
sudo dpkg-reconfigure dbus && service dbus restart
sudo apt-get install mate-desktop-environment-extras
sudo apt install ubuntu-mate-icon-themes
  • With the X11 client running in Windows launch a graphical session within WSL with
mate-session
  • In WSL install R as you've done
  • Install RStudio by downloading the deb file from one of their install pages. I have been using the preview version from here.
  • Then install the .deb file with gdebi (changing the name of the .deb file as required)
sudo apt-get install gdebi-core
wget https://s3.amazonaws.com/rstudio-ide-build/desktop/bionic/amd64/rstudio-1.3.938-amd64.deb
sudo gdebi rstudio-1.3.938-amd64.deb
  • One quirk is that sometimes clicking the RStudio icon to launch it I just get a black window. When that happens I simply launch RStudio as sudo, e.g. sudo rstudio, and it works (having made sure rstudio is on my $PATH) (I guess not ideal running as sudo).
  • Here's a screenshot of my Windows 10 RStudio on the left and an X11 window running Ubuntu RStudio in WSL on the right.
    rstudio-win10-wsl

cheers
Tom

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions