Difference between revisions of "Using a VNC Server/Client"

From Hall A Wiki
Jump to: navigation, search
(Setting up PuTTY)
Line 5: Line 5:
  
 
* VNC client (lets you view the remote screen): [http://www.uvnc.com/download/ UltraVNC]
 
* VNC client (lets you view the remote screen): [http://www.uvnc.com/download/ UltraVNC]
** UltraVNC comes in a zip file.  Open it and drag the executable inside to your desktop next to putty.
+
** UltraVNC comes in a zip file.  Open it and drag the executable inside to your desktop next to PuTTY.
  
* putty (lets the client talk to the remote machine through the firewall):  [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY].
+
* PuTTY (lets the client talk to the remote machine through the firewall):  [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY].
 
** You want to save the '''putty.exe''' to your Desktop.
 
** You want to save the '''putty.exe''' to your Desktop.
  
Line 14: Line 14:
  
 
  <font color=red>
 
  <font color=red>
  NOTE: The ''putty'' screenshots below are old.  Do not copy them blindly, be sure to read the notes in each section.
+
  NOTE: The ''PuTTY'' screenshots below only examples.  Do '''not''' copy them blindly, be sure to read the notes in each section.
      Replace <username> with your JLab username (no quotes or angle brackets)
+
 
  </font>
 
  </font>
  
Line 22: Line 21:
 
=== Step 1: Tunnel between your machine and JLab ===
 
=== Step 1: Tunnel between your machine and JLab ===
  
Run '''putty''' and create a ''Step 1'' configuration.
+
Run '''PuTTY''' and create a ''Step 1'' configuration.
  
 
==== Configure host name of remote machine ====
 
==== Configure host name of remote machine ====
Line 37: Line 36:
 
* Click on the '''+''' next to '''SSH''' in the list on the left, then select '''Tunnels'''.   
 
* Click on the '''+''' next to '''SSH''' in the list on the left, then select '''Tunnels'''.   
 
* Set '''Source port''' to '''2300''' + the last 2 digits of your phone number.
 
* Set '''Source port''' to '''2300''' + the last 2 digits of your phone number.
** Note: the '''port''' in this step just needs to be unique for each person connecting.  If your phone number ends with '''4321''' then set the port to '''2321'''
+
** Note: the '''port''' in this step just needs to be unique for each person connecting.  The 'phone number' thing is just a way to make a number likely to be unique to you.  For example, if your phone number ends with '''43<u>21</u>''' then set the port to '''23<u>21</u>'''
 
* Set '''Destination''' to '''hacweb14:22'''
 
* Set '''Destination''' to '''hacweb14:22'''
 
* <font color=red>''Then click on the '''Add''' button.''</font>
 
* <font color=red>''Then click on the '''Add''' button.''</font>
Line 48: Line 47:
 
=== Step 2:  Tunnel between your machine and '''hacuser@hacweb14''' ===
 
=== Step 2:  Tunnel between your machine and '''hacuser@hacweb14''' ===
  
Run '''putty''' a second time and create a ''Step 2'' configuration.
+
Run '''PuTTY''' a second time and create a ''Step 2'' configuration.
  
 
==== Configure host name of remote machine ====
 
==== Configure host name of remote machine ====
Line 72: Line 71:
 
[[Image:puttystart.png|center|PuTTY's config, main ]]
 
[[Image:puttystart.png|center|PuTTY's config, main ]]
  
=== Open the session ===
+
== Setting up the Tunnel using your settings ==
* Select '''hacuser@hacweb14''' from the Saved Sessions list and click '''Load'''.
+
* Run PuTTY and select '''Step 1''' from the Saved Sessions list and click '''Load'''.
* Click on the '''Open''' button at the bottom of the dialog box.  A black terminal will open and prompt you for the usual '''hacuser''' password.  Type it in and you should get a normal shell prompt.
+
** Click on the '''Open''' button at the bottom of the dialog box.  A black terminal will open and prompt you to login to the '''hallgw''' machine.  You will use ''your'' CUE password here.  Type it in and you should get a normal shell prompt '''[username@hallgw1]~%'''
* You can now minimize this window (<i>do NOT</i> quit PuTTY) and setup UltraVNC.
+
** You can now minimize this window (<i>do NOT</i> quit PuTTY).
 +
* Run PuTTY a 2nd time and select '''Step 2''' from the Saved Sessions list and click '''Load'''.
 +
** Click on the '''Open''' button at the bottom of the dialog box.  A black terminal will open and prompt you to login to the '''hacweb14''' machine.  You will use the '''hacuser''' password here.  Type it in and you should get a normal shell prompt '''[hacuser@hacweb14]#'''
 +
** You can now minimize this window (<i>do NOT</i> quit PuTTY) and move on to running the VNC client (''ie.'' UltraVNC)
 
[[Image:puttyshell.png|center|PuTTY's shell ]]
 
[[Image:puttyshell.png|center|PuTTY's shell ]]
  
==== Using these sessions in the future ====
+
== Running UltraVNC ==
You only have to create the above configurations once.  Next time, you just have to do this:
+
 
+
# Run putty, select 'hacuser@jlab Step 1', and click 'Load', then 'Open' login, then minimize that putty window (leave it running)
+
# Run putty, select 'hacuser@jlab Step 2', and click 'Load', then 'Open' login, then minimize that putty window (leave it running)
+
# Run UltraVNC and hit Connect (it'll use the default settings you saved earlier)
+
 
+
== Setting up UltraVNC ==
+
  
 
====  Run '''vncviewer.exe''' ====
 
====  Run '''vncviewer.exe''' ====
Line 96: Line 91:
 
* Enter the '''hacuser''' password in the appropriate box and hit return.
 
* Enter the '''hacuser''' password in the appropriate box and hit return.
 
[[Image:vncauth.png|center|UltraVNC auth and status windows]]
 
[[Image:vncauth.png|center|UltraVNC auth and status windows]]
* You should be rewarded with the hacuser X session.
+
* You should be rewarded with the hacuser window session.
 
* '''NOTE''': If you get a black screen with yet another password prompt, it means the screen saver software has kicked in.  Just type in the 'hacuser' password again and you'll be good to go.
 
* '''NOTE''': If you get a black screen with yet another password prompt, it means the screen saver software has kicked in.  Just type in the 'hacuser' password again and you'll be good to go.
 
[[Image:vncwindow.png|center|UltraVNC Session]]
 
[[Image:vncwindow.png|center|UltraVNC Session]]
Line 106: Line 101:
 
running and updating in the background.  You can reconnect to the VNC session
 
running and updating in the background.  You can reconnect to the VNC session
 
anytime from (nearly) any machine.
 
anytime from (nearly) any machine.
 +
 +
== To Summarize ==
 +
 +
After setting up the PuTTY configurations, you can do the following:
 +
 +
# Run PuTTY, select 'Step 1', and click 'Load', then 'Open', login, then minimize that PuTTY window (leave it running)
 +
# Run PuTTY, select 'Step 2', and click 'Load', then 'Open', login, then minimize that PuTTY window (leave it running)
 +
# Run UltraVNC and hit Connect (it'll use the default settings you saved earlier)
  
 
= Instructions for Linux =
 
= Instructions for Linux =

Revision as of 20:09, 30 October 2019

Instructions for Windows

Downloading the Software

You'll need two pieces of software:

UltraVNC and PuTTY icons on the Desktop
  • VNC client (lets you view the remote screen): UltraVNC
    • UltraVNC comes in a zip file. Open it and drag the executable inside to your desktop next to PuTTY.
  • PuTTY (lets the client talk to the remote machine through the firewall): PuTTY.
    • You want to save the putty.exe to your Desktop.


Setting up PuTTY


NOTE: The PuTTY screenshots below only examples.  Do not copy them blindly, be sure to read the notes in each section.

This is a 2-step process.

Step 1: Tunnel between your machine and JLab

Run PuTTY and create a Step 1 configuration.

Configure host name of remote machine

  • Set Host Name to hallgw.jlab.org
  • Set Saved Sessions field to Step 1
PuTTY's connect dialog

Configure user name

  • Select the Data entry under Connection in the left column.
  • Set Auto-login username field to your username.
PuTTY's config, username

Configure tunnel

  • Click on the + next to SSH in the list on the left, then select Tunnels.
  • Set Source port to 2300 + the last 2 digits of your phone number.
    • Note: the port in this step just needs to be unique for each person connecting. The 'phone number' thing is just a way to make a number likely to be unique to you. For example, if your phone number ends with 4321 then set the port to 2321
  • Set Destination to hacweb14:22
  • Then click on the Add button.
PuTTY's config, Tunnel Config

Save configuration

  • Select the Session entry in the left column (scroll up if you have to), and click on the Save button. This will save your settings for Step 1.
PuTTY's config, main

Step 2: Tunnel between your machine and hacuser@hacweb14

Run PuTTY a second time and create a Step 2 configuration.

Configure host name of remote machine

  • Set Host Name to localhost
  • Set Port to the Source port you chose in Step 1 above (ie. 2321 in the above example)
  • Set Saved Sessions field to Step 2
PuTTY's connect dialog

Configure user name

  • Select the Data entry under Connection in the left column.
  • Set Auto-login username field to hacuser
PuTTY's config, username

Configure tunnel

  • Click on the + next to SSH in the list on the left, then select Tunnels.
  • Set Source port to 5901
  • Set Destination to localhost:5901
  • Then click on the Add button.
PuTTY's config, Tunnel Config

Save configuration

  • Select the Session entry in the left column (scroll up if you have to), and click on the Save button. This will save your settings for Step 2.
PuTTY's config, main

Setting up the Tunnel using your settings

  • Run PuTTY and select Step 1 from the Saved Sessions list and click Load.
    • Click on the Open button at the bottom of the dialog box. A black terminal will open and prompt you to login to the hallgw machine. You will use your CUE password here. Type it in and you should get a normal shell prompt [username@hallgw1]~%
    • You can now minimize this window (do NOT quit PuTTY).
  • Run PuTTY a 2nd time and select Step 2 from the Saved Sessions list and click Load.
    • Click on the Open button at the bottom of the dialog box. A black terminal will open and prompt you to login to the hacweb14 machine. You will use the hacuser password here. Type it in and you should get a normal shell prompt [hacuser@hacweb14]#
    • You can now minimize this window (do NOT quit PuTTY) and move on to running the VNC client (ie. UltraVNC)
PuTTY's shell

Running UltraVNC

Run vncviewer.exe

  • Enter localhost:5901 in the "VNC Server:" field at the top.
  • Enable the Save connection settings as default at the bottom.
UltraVNC config window

Connect to the VNC session

  • Click on the Connect button and you should see a couple of windows pop up:
  • Enter the hacuser password in the appropriate box and hit return.
UltraVNC auth and status windows
  • You should be rewarded with the hacuser window session.
  • NOTE: If you get a black screen with yet another password prompt, it means the screen saver software has kicked in. Just type in the 'hacuser' password again and you'll be good to go.
UltraVNC Session

Quitting the VNC session

  • Be sure to close the UltraVNC window, not one of the windows running

inside the VNC session.

  • Any program/stripchart that you start inside the VNC session will keep

running and updating in the background. You can reconnect to the VNC session anytime from (nearly) any machine.

To Summarize

After setting up the PuTTY configurations, you can do the following:

  1. Run PuTTY, select 'Step 1', and click 'Load', then 'Open', login, then minimize that PuTTY window (leave it running)
  2. Run PuTTY, select 'Step 2', and click 'Load', then 'Open', login, then minimize that PuTTY window (leave it running)
  3. Run UltraVNC and hit Connect (it'll use the default settings you saved earlier)

Instructions for Linux

  • Type the following at a shell prompt (ie. in an xterm)
 vncviewer -Shared -via hacuser@hacweb14 :1
  • When prompted, enter the hacuser password (twice)
  • NOTE: If you get a black screen with yet another password prompt, it means the screen saver software has kicked in. Just type in the 'hacuser' password again and you'll be good to go.

Setting up the VNC Server

NOTE: This rarely needs to be done.  Once it is started it will stay running even after you disconnect.
      In general, the vncserver will only need to be restarted if the hacweb14 machine is rebooted.
  • Log in to hacuser@hacweb14
  • Start the vncserver by running:
 [hacuser@hacweb14]# vncserver -geometry 1900x1100 :1

Killing the VNC Server

This will quit the server and all applications that were running under that server.

 [hacuser@hacweb14]# vncserver -kill :1