VNC: Difference between revisions

From DaqWiki
Jump to navigation Jump to search
m (New page: <h2>How to use VNC</h2> <p> </p> <h3>To establish a VNC connection through the CERN firewall:</h3> <p> </p> <p>X11 applications (i.e. ROOT) are very slow when running at CERN beh...)
 
mNo edit summary
Line 4: Line 4:
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>X11 applications (i.e. ROOT) are very slow when running at CERN behind the CERN firewall using multiple ssh tunnels (one ssh tunnel to lxplus, second ssh tunnel to the experiment computer running your ROOT application). VNC is one solution to this problem. Performance of X11 applications (i.e. ROOT) is greatly improved because they render graphics locally to the local "screen" of the local VNC server, all running at CERN. To see this "screen", you connect to it remotely using a vnc client. Because the CERN firewall prevents normal use of VNC where the vnc client connects to the server using a password, you use a "reverse" connection, where you start the vnc client on your desktop computer and ask the vnc server running at CERN to connect to it, as described below:</p>
<p>X11 applications (i.e. ROOT) are very slow when running at CERN behind the CERN firewall using multiple ssh tunnels (one ssh tunnel to lxplus, second ssh tunnel to the experiment computer running your ROOT application). VNC is one solution to this problem. Performance of X11 applications (i.e. ROOT) is greatly improved because they render graphics locally to the local "screen" of the local VNC server, all running at CERN. To see this "screen", you connect to it remotely using a vnc client. Because the CERN firewall prevents normal use of VNC where the vnc client connects to the server using a password, you use a "reverse" connection, where you start the vnc client on your desktop computer and ask the vnc server running at CERN to connect to it, as described below:</p>
<ul><li>on local machine,&nbsp; run "vncviewer -listen 9999" &lt;--- use whatever port number<br /></li><li>ssh lxplus, on lxplus, ssh alphavme02</li><li>on alphavme02, run "vncserver -geometry 1600x1000", then run "vncconfig -display localhost:1 -connect ladd00.triumf.ca:9999" &lt;--- ladd00 and 9999 are the host name and port number where we started vncviewer.</li><li>vncviewer should see the connection request and open a new graphics window with the VNC screen.</li><li>to close the connection, kill the local vnc client.<br /></li><li>reconnect to the vnc server still running at CERN by restarting the vnc client (locally) and reissuing the "vncconfig -connect" command (on the remote machine at CERN).</li><li>to completely kill vnc, kill the local vnc client and kill Xvnc on the remote machine at CERN.<br /></li></ul>
<ul>
<li>on local machine,&nbsp; run "vncviewer -listen 5500" &lt;--- use whatever port number<br /></li>
<li>ssh lxplus, on lxplus, ssh alphadaq</li>
<li>on alphadaq, reset the vnc password: "/bin/rm .vnc/passwd
<li>on alphadaq, run "vncserver -geometry 1600x1000", then run "vncconfig -display localhost:1 -connect ladd00.triumf.ca:5500" &lt;--- ladd00 and 5500 are the host name and port number where we started vncviewer.</li>
<li>vncviewer should see the connection request and open a new graphics window with the VNC screen.</li>
<li>to close the connection, kill the local vnc client.<br /></li>
<li>reconnect to the vnc server still running at CERN by restarting the vnc client (locally) and reissuing the "vncconfig -connect" command (on the remote machine at CERN).</li>
<li>to completely kill vnc, kill the local vnc client and kill Xvnc on the remote machine at CERN.<br /></li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>On MacOS, do this:</p>
<p>On MacOS, do this:</p>
<ul><li>on local Mac, start the "chicken of vnc" application (UPDATE: use "chicken" app from&nbsp;http://sourceforge.net/projects/chicken/files)</li><li>under "Connection" menu, select "Listen for server", say "Start", note the port number (5500), you will use this instead of 9999 in the vncconfig example above.</li><li>find the Mac IP address (i.e. if on the Shaw network): start "preferences -&gt; network", remember the IP address, you will use it instead of the client hostname in the vncconfig example above.</li><li>login to the target machine, start the vncserver as described above</li><li>tell vncserver to connect to the Mac using vncconfig as described above, in the "-connect hostname:port" incantation, use the IP address and port number you remembered above.</li></ul>
<ul>
<li>on local Mac, start the "chicken of vnc" application (UPDATE: use "chicken" app from&nbsp;http://sourceforge.net/projects/chicken/files)</li>
<li>under "Connection" menu, select "Listen for server", say "Start", note the port number (5500), you will use this instead of 9999 in the vncconfig example above.</li>
<li>find the Mac IP address (i.e. if on the Shaw network): start "preferences -&gt; network", remember the IP address, you will use it instead of the client hostname in the vncconfig example above.</li>
<li>login to the target machine, start the vncserver as described above</li>
<li>tell vncserver to connect to the Mac using vncconfig as described above, in the "-connect hostname:port" incantation, use the IP address and port number you remembered above.</li>
</ul>
<div><span class="Apple-style-span"><br /></span></div>
<div><span class="Apple-style-span"><br /></span></div>
<div><span class="Apple-style-span">To connect from home using an ssh tunnel, do this:</span></div>
<div><span class="Apple-style-span">To connect from home using an ssh tunnel, do this:</span></div>

Revision as of 10:22, 9 October 2014

How to use VNC

 

To establish a VNC connection through the CERN firewall:

 

X11 applications (i.e. ROOT) are very slow when running at CERN behind the CERN firewall using multiple ssh tunnels (one ssh tunnel to lxplus, second ssh tunnel to the experiment computer running your ROOT application). VNC is one solution to this problem. Performance of X11 applications (i.e. ROOT) is greatly improved because they render graphics locally to the local "screen" of the local VNC server, all running at CERN. To see this "screen", you connect to it remotely using a vnc client. Because the CERN firewall prevents normal use of VNC where the vnc client connects to the server using a password, you use a "reverse" connection, where you start the vnc client on your desktop computer and ask the vnc server running at CERN to connect to it, as described below:

  • on local machine,  run "vncviewer -listen 5500" <--- use whatever port number
  • ssh lxplus, on lxplus, ssh alphadaq
  • on alphadaq, reset the vnc password: "/bin/rm .vnc/passwd
  • on alphadaq, run "vncserver -geometry 1600x1000", then run "vncconfig -display localhost:1 -connect ladd00.triumf.ca:5500" <--- ladd00 and 5500 are the host name and port number where we started vncviewer.
  • vncviewer should see the connection request and open a new graphics window with the VNC screen.
  • to close the connection, kill the local vnc client.
  • reconnect to the vnc server still running at CERN by restarting the vnc client (locally) and reissuing the "vncconfig -connect" command (on the remote machine at CERN).
  • to completely kill vnc, kill the local vnc client and kill Xvnc on the remote machine at CERN.

 

On MacOS, do this:

  • on local Mac, start the "chicken of vnc" application (UPDATE: use "chicken" app from http://sourceforge.net/projects/chicken/files)
  • under "Connection" menu, select "Listen for server", say "Start", note the port number (5500), you will use this instead of 9999 in the vncconfig example above.
  • find the Mac IP address (i.e. if on the Shaw network): start "preferences -> network", remember the IP address, you will use it instead of the client hostname in the vncconfig example above.
  • login to the target machine, start the vncserver as described above
  • tell vncserver to connect to the Mac using vncconfig as described above, in the "-connect hostname:port" incantation, use the IP address and port number you remembered above.

To connect from home using an ssh tunnel, do this:

NOTE: this will only work for local vnc connections. For remote vnc connections (Xvnc not running on the ssh gateway host), the sshd option "GatewayPorts yes" has to be set. This is disabled by default.

  • on home computer start the vnc viewer in the "listen for server" mode, as above. Take note of the port number (5500 in my case)
  • on home computer, run "ssh -R localhost:5500:localhost:5500 ladd00.triumf.ca", where 5500 is the vnc viewer port, ladd00 is the computer where we will run the vnc server. This establishes a reverse ssh tunnel (from ladd00 to home computer). Stay in this ssh window.
  • in the ssh connection to ladd00, run "vncserver", take note of the VNC display number (ladd00:5, in my case), then run "vncconfig -display localhost:5 -connect localhost:5500", where ":5" is the VNC display number, and "5500" is the vnc viewer port number.
  • a VNC viewer window should open connected to the vnc server on ladd00.

 

K.O.