Skip to content

Instantly share code, notes, and snippets.

@daniel-packard
Last active October 22, 2022 09:13
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daniel-packard/62b89c5904e44a462df2b07d9f3d60d2 to your computer and use it in GitHub Desktop.
Save daniel-packard/62b89c5904e44a462df2b07d9f3d60d2 to your computer and use it in GitHub Desktop.

install xming

  1. download the installer available here:

  2. Run the installer, the default options are fine

    • (you might want to create shortcuts on the desktop for Xming and XLaunch)
  3. Launch Xming

    • on your first launch, it will ask you which types of networks you want to allow... if you work in a lot of coffee shops, you should also include Public Networks (excluded by default)

At that point, the xming xwindows server should be running, and ready to use.

NOTE: You will probably need to relaunch after rebooting your computer.

configure git-bash to use the local xwindows display

  1. launch git bash
  2. add these lines to the end of your local .bashrc
    • i.e. on your computer, not the VM running in the cloud
    • you might have to create this file if it doesn't exist
# use XMing local display
export DISPLAY=localhost:0
  1. source your .bashrc file (only required in your current git-bash session, future sessions will auto-load this file)
source ~/.bashrc

Now you should get x11-forwarding to your local xwindows display, like everyone else

example use

  1. from git bash (with the DISPLAY variable set, and your .bashrc sourced as described above), ssh into your remote VM instance with x11 forwarding enabled (i.e. using the -X or -Y flags in your SSH command)
ssh -Y daniel@104.155.139.96

(use your own IP address)

  1. open R, and enter the following commands:
x=c(1:10)
y=(x-5)*(x-5)
plot(x,y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment