Better Decisions === Faster Stats

Running R GUI on Google Compute

I wanted to run R GUIs ( rattle, Rcmdr, Deducer) on my Google Compute Instance, but didnt know how to figure out how to enable x11.

Initially I just tried to enable x11 forwarding in the local ssh (Ubuntu) and remote sshd( GCE), but it still needed some more.

Note I use gedit to edit files locally ( since it is easier) and vi to edit files remotely ( because I didnt have a graphical environment there yet) . I used vi help from the link here (basically sudo vi filename opens the file in Linux, you scroll down and press Insert to write your changes, then hit escape, then write this to save and quit :qw ( or :q! to NOT save and quit), your mouse is quite useless and the arrow keys dont help much in vi- I assure you that)

[local]
/etc/ssh_config or ~/.ssh/config
ForwardX11 yes

restarted local ssh

[remote]
/etc/sshd_config
X11Forwarding yes

restarted remote sshd

Well this is how it is done- following is a copy and paste from actual discussion-

here are two steps you have to do in order to run X-windows applications on your instance.

1) You have to install some X-windows applications on your instance. I used the command

sudo apt-get install xterm

which works on Ubuntu. On Centos, you would use the command

yum install xterm

but I didn’t test that.

2) You have to create an X-windows tunnel through SSH. You do that with the -X switch to the gcutil ssh command:

gcutil ssh –ssh_arg -X INSTANCE

When you login to the instance, verify that the tunnel is in place.

$rman@test-pd:~$ echo $DISPLAY

localhost:10.0

rman@test-pd:~$

By way of contrast, this is what it looks like if the tunnel didn’t work: