Using VNC with Mosaic

This is a brief introduction describing how we use VNC (Virtual Network Computing) to display the various windows which control use of the NOAO Mosaic imager, specifically Mosaic II at CTIO. The advantage of this is that support staff (both on the mountain and downtown) can monitor the use of the instrument, actually SEEING in real time any errors that appear.

Normal Operation

If the Mosaic has been up and running, the user should only have to click on the icons "Start_DCA", "Ximtool", and "Arcon". These buttons run the scriptsstart_dca_a8start_disp_a8, and start_a0, which are found in the/ua80/mosaic/bin directory. The scripts start up the servers, if necessary, and then the VNC viewers.

These icons and/or scripts should bring up three VNC viewer windows (one for Arcon Acquisition, with a blue background, one for the DCA, with a green background, and one for the real-time display, also with a green background) on ctioa8. Once these come up, use the menus (right mouse button inside VNC window) to start up Arcon in the blue window, the DCA in the DCA window, and ximtool in the real-time display.

NOTE: The multiple Xview warnings which come up in the ARCON Acquisition window are harmless... we're just missing a font for the large countdown timer.

The following images show what should be the result of the instructions above. Click on either for a larger view.

 vnca0_sm.jpg  vnca8dca_sm.jpg  vnca8xim.jpg

If pressing the icons produces no result, or the VNC clients start up but the menus appear inaccessible, you will probably have to kill the servers and restart them manually, as follows.

Manual Operation

On ctioa8, open an xgterm or xterm window. All of the following commands below (where it says "type...") should be typed into this window.

If the ctioa0 server is giving you trouble, type

1. rsh ctioa0 "source .login; vncserver -kill :9"
2. rsh ctioa0 "source .login; vncserver :9 -cc 3 -alwaysshared -geometry 1060x800"

This should start the vncserver on ctioa0 and output the following text:

New 'X' desktop is ctioa0:9

Starting applications specified in /arc/mosaic/.vnc/xstartup
Log file is /arc/mosaic/.vnc/ctioa0:9.log


If line 2 generates an error message about a file in /tmp, remove the file (rsh ctioa0 "rm /tmp/file_name") and try line 2 again.

Clicking the "Arcon" button should now bring up the Arcon VNC viewer. If you would rather start the viewer manually , too, then type

  • vncviewer ctioa0:9 -passwd /ua80/mosaic/.vnc/passwd &

The VNC viewer window should come up, and something like the following output should show up in the xgterm where you typed vncviewer.

[1] ####
VNC server supports protocol version 3.3 (viewer 3.3)
VNC authentication succeeded
Desktop name "mosaic's X desktop (ctioa0:9)"
Connected to VNC server, using protocol version 3.3
VNC server default format:
     8 bits per pixel.
     Colour map (not true colour).
Using default colormap and translating from BGR233. Pixel format:
     8 bits per pixel.
     True colour: max red 7 green 7 blue 3, shift red 0 green 3 blue 6
Got 237 exact BGR233 colours out of 256
Using 1 existing shared colours

In this xgterm window, you can now hit ctrl-X and type "bg" to put the vncviewer in background.

If the DCA VNC viewer is giving trouble, type

1. vncserver -kill :9
2. vncserver :9 -cc 3 -alwaysshared -geometry 700x700

This should start the vncserver on ctioa8 and output the following text:

New 'X' desktop is ctioa8:9

Starting applications specified in /ua80/mosaic/.vnc/xstartup
Log file is /ua80/mosaic/.vnc/ctioa8:9.log

Again, if starting the server produces an error message refering to a file in /tmp, remove the appropriate file in /tmp and repeat step 2.

Clicking the Start_DCA button should now bring up the VNC viewer. If you would rather start the viewer manually, type

  • vncviewer ctioa8:9 -passwd /ua80/mosaic/.vnc/passwd &

The VNC viewer window should come up, and something like the following output should show up in the xgterm where you typed vncviewer.

[1] ####
VNC server supports protocol version 3.3 (viewer 3.3)
VNC authentication succeeded
Desktop name "mosaic's X desktop (ctioa8:9)"
Connected to VNC server, using protocol version 3.3
VNC server default format:
      8 bits per pixel.
      Colour map (not true colour).
Using default colormap and translating from BGR233. Pixel format:
     8 bits per pixel.
     True colour: max red 7 green 7 blue 3, shift red 0 green 3 blue 6
Got 237 exact BGR233 colours out of 256
Using 1 existing shared colours
Same machine: preferring raw encoding

In this xgterm window, you can now hit ctrl-X and type "bg" to put the vncviewer in background.

If the real-time display VNC viewer is giving you trouble, type

1. vncserver -kill :8
2. vncserver :8 -cc 3 -alwaysshared -geometry 700x700

This should start the vncserver on ctioa0 and output the following text:

New 'X' desktop is ctioa8:8

Starting applications specified in /ua80/mosaic/.vnc/xstartup
Log file is /ua80/mosaic/.vnc/ctioa8:8.log

Again, if starting the server produces an error message, remove the appropriate file in /tmp and repeat step 2.

Clicking the Start_DCA button should now bring up the VNC viewer. If you would rather start the viewer manually, type

  • vncviewer ctioa8:8 -passwd /ua80/mosaic/.vnc/passwd &

The VNC viewer window should come up, and something like the following output should show up in the xgterm where you typed vncviewer.

[1] ####
VNC server supports protocol version 3.3 (viewer 3.3)
VNC authentication succeeded
Desktop name "mosaic's X desktop (ctioa8:8)"
Connected to VNC server, using protocol version 3.3
VNC server default format:
      8 bits per pixel.
      Colour map (not true colour).
Using default colormap and translating from BGR233. Pixel format:
      8 bits per pixel.
      True colour: max red 7 green 7 blue 3, shift red 0 green 3 blue 6
Got 237 exact BGR233 colours out of 256
Using 1 existing shared colours
Same machine: preferring raw encoding

In this xgterm window, you can now hit ctrl-X and type "bg" to put the vncviewer in background.


Additional Notes

Sometimes VNC doesn't gracefully let go of the X display it is using (sometimes for a few minutes, sometimes longer). If, for example, one of the VNC servers crashes (which I've never seen happen), and the user immediately tries to restart it, one may get an error saying that VNC is running on :9, even though it isn't. Such an error might look like

mosaic@ctioa8% startvnc_a0
A VNC server is already running as :9
[1] 3328
vncviewer: ConnectToTcpAddr: connect: Connection refused
Unable to connect to VNC server

[1]      Exit 1           vncviewer ctioa0:9 -passwd /ua82/mosaic/.vnc/passwd

To get around this problem, first try waiting about 2-3 minutes before running startvnc again. This should be enough time to allow the socket to be released. If this fails, try going through the manual startup and substitute another number, for example 8, whereever you see 9 in the above manual example. This will start up the VNC sessions on X display :8, but otherwise should be the same.

IF ALL ELSE FAILS: You can bypass VNC completely and start up the windows directly. To do this...

  • Open an xgterm on ctioa8
  • ssh ctioa0 and log in
  • type ArconReStart.ow at the ctioa0 prompt

This should bring up the normal Arcon windows directly on the ctioa8 display. To exit this Arcon session, go back to the xgterm with the ctioa0 prompt and type

  • ArconExit

This should kill all of the Arcon windows on ctioa8.

Connecting from other machines

To connect from other machines, you must (of course) have the VNC viewer application installed. This should be installed on most workstations, and can be downloaded for PCs and Macs from the VNC Homepage.

To view a Mosaic session, simply use the VNC viewer application to connect to ctioa0:9 (for the data acquisition windows) or ctioa8:9 (for the DCA windows). You must know the password to enter. NOTE!! You should ALWAYS enter as VIEWONLY unless you are trying to remotely help the observer. If you do not know how to do this, DON'T CONNECT!

 

Please send comments and questions to: Chris Smith: csmithATctio.noao.edu
Last updated: 29 November 2002 by Chris Smith

Updated on June 4, 2021, 9:32 am