Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I need to access one of my school Linux servers from my home computer that runs Windows. And I need to access graphical desktop (X server) on them remotely, not only shell.

The problem includes 3 Linux servers with different settings. I don't have admin privileges on any of them and cannot change those settings. The 3 servers are called Aisa, Lethe and Aura (somebody loves Greek mythology here). All of them are part of school's local network.

I need to access graphical interface on either Lethe or Aura, any of them would be fine.

Here is what I have found out:

  • ports for services like VPN are not available on any of the 3
  • SSH is allowed on Lethe and Aisa, not on Aura. I can still access Aura when I SSH to Aisa or Lethe using Putty and then ssh aura.
  • I have tried Xming program that allows graphical connection from windows to Linux via SSH. I was only able to connect to Aisa this way (why not to Lethe?! Putty works there).

So what can I try to get graphical connection to either Lethe or Aura from my Windows computer? Any suggestions are very much welcome.

edit Here is the code showing how I get disconnected from Aura back to Aisa after running vncserver:

aisa:/home/user>$ ssh aura
Last login: Sat Oct 13 00:00:00 2012 from aisa.domain.com
aura:/home/user>$ module add vnc
aura:/home/user>$ vncserver

New 'aura.domain.com:1 (user)' desktop is aura.domain.com:1

Starting applications specified in /home/user/.vnc/xstartup
Log file is /home/user/.vnc/aura.domain.com:1.log

aura:/home/user>$ Connection to aura closed by remote host.
Connection to aura closed.
aisa:/home/user>$ 

edit 2 Content of file /home/user/.vnc/aura.domain.com:1.log after executing command vncserver:

aura:/home/user>$ cat /home/user/.vnc/aura.domain.com:1.log
/packages/run/vnc-4.1.2/Xvnc: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
/home/user/.vnc/xstartup: line 4: xsetroot: command not found
/home/user/.xsession: line 15: xset: command not found
vncconfig: unable to open display "aura.domain.com:1"
/home/user/.xsession: line 42: xmodmap: command not found
Module xv
Module modules
Module viewers
Module WindowMaker-0.80.2
Module mozilla
ModuleCmd_Load.c(199):ERROR:105: Unable to locate a modulefile for 'mozilla'
stty: standard input: For this device invalid ioctl
wmaker: error while loading shared libraries: libtiff.so.3: cannot open shared object file: No such file or directory

Note: I have translated some strings that were displayed in czech (Aura is running czech version of Red Hat)

share|improve this question

2 Answers 2

VNC is not the easiest way to run a GUI program. It has additional benefits over the straight remote X method, such as not killing the program if the connection goes down, but it requires more programs running on the remote side. I recommend Xming + PuTTY or Xming + Cygwin SSH for the easy way.

Run the Xming server, then run PuTTY, telling it to forward X. Since you can run X programs on Aisa, you've already got that part working. Make sure that you've enabled X forwarding to Lether and Aura too.

The reason this doesn't work on Lethe may be that X forwarding is disabled, or it might be that it's lacking some libraries. Check the value of the DISPLAY environment variable in the SSH session (echo $DISPLAY). You should see somehing like localhost:10.0. If the value is empty, then the X forwarding failed. This may be because it has been disabled by the system administrator. Check the SSH server configuration, usually in /etc/sshd_config or /etc/ssh/sshd_config. It should contain the line X11Forwarding yes. If it doesn't, ask your system administrator to add it (there is no security risk to the server in doing so, since the client takes all the risks and it can be set up manually anyway — having the option default off doesn't make any sense, but that's how it is in the default OpenSSH configuration).

If X11 forwarding is disabled on the server, you may still be able to make it work, but it takes some effort. You'll need to set up a port forwarding of port 6010 on the remote side to port 6000 on localhost: port 6000+N corresponds to the DISPLAY value :N.0. Set the DISPLAY environment variable accordingly, e.g. export DISPLAY=localhost:10 for port 6010. If port 6010 is taken on Lethe, pick a different one. Then you'll need to copy the X cookie to the remote system. I don't know how to extract the cookie with Xming. On the server side, run xauth add localhost:10 0123456789abcdef0123456789abcdef (the 32-digit hexadecimal number is the cookie value).

For Aura, use SSH tunnelling. Tell PuTTY to connect to Aisa (with agent and X11 forwarding enabled), then run the command ssh -X there.

share|improve this answer

You can try to use VNC X server. It uses non-privileged port to communicate and it may be run without any root privileges. To avoid the building of VNC find out what port of it the distro being in use contains (there is a number of options TigerVNC, OpenVNC, RealVNC, e.t.c.).

For example the Fedora 17 has tigervnc-server-minimal package that has everything you need to start a VNC server:

/usr/bin/Xvnc 
/usr/bin/vncconfig 
/usr/bin/vncpasswd 
/usr/share/man/man1/Xvnc.1.gz 
/usr/share/man/man1/vncconfig.1.gz 
/usr/share/man/man1/vncpasswd.1.gz

Download it, extract the binaries and put them into your ~/bin folder for convenience.

First you need to run vncpasswd once at each system to set a password to access your vnc server instance.

Then start the server itself by the command Xvnc and note what display it started (it will print out the info on standard output).

Then you will be setting up a TCP port forwarding with putty to the port with number 5900+<display number>, e.g. for the display :1 you should create a tunnel to port 5901:

putty -ssh -L5901:127.0.0.1:5901 user@host

Then start the VncViewer and connect to the display localhost:1 at your Windows box.

When you are finished don't forget to stop Xvnc server, so it is not wasting the resources at server:

killall Xvnc

The case of aura is a bit more complex as you can't log in directly. If one of your servers allow to set the tunnels to any machine in the LAN, then just create the proper tunnel, say:

putty -ssh -L5901:<ip-of-aura>:5901 user@host

Otherwise, you start the ssh session with aura with port forwarding from the remote shell at aisa or lethe:

ssh -L5901:127.0.0.1:5901 aura
share|improve this answer
    
+1 Your answer seems to be promising as there is VNC module installed on both Aisa and Aura. After adding the module vncpasswd runs as expected on them. Xvcn does not work but vncserver does run. However when execute it I get kicked off the server (independent if Aisa or Aura). Does it matter? Anyway I do not quite understand the rest of the procedure: putty is not recognised command on Linux servers nor is it recognised by my Windows computer's command line (and I have putty installed on it). Where do I run putty -ssh -L5901:127.0.0.1:5901 user@host? –  drasto Oct 12 '12 at 23:51
    
"However when execute it I get kicked off the server (independent if Aisa or Aura)." this is strange as it should printout the display number and then run in background –  Serge Oct 13 '12 at 0:07
1  
"Where do I run..." on your windows machine from the command line while your current directory is the one containing the putty. or you can modify your PATH variable to include its location. Alternatively you can specify a tunnel to establish in the putty's GUI configuration of the ssh connection. –  Serge Oct 13 '12 at 0:09
1  
try to add the -fg switch to run it in a foreground to see any error message it could printout –  Serge Oct 13 '12 at 0:15
1  
Are you sure you have X installed at all at aura? –  Serge Oct 13 '12 at 0:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.