VNC

From PHASTA Wiki
Revision as of 15:49, 8 July 2011 by Admin (talk | contribs)
Jump to: navigation, search

VNC is a tool which projects a GUI session over the network. If may be useful if you want to use GUI tools remotely when X forwarding performs poorly.

Warning: This is still being tested and should NOT be considered stable (portal0 may be rebooted without warning) Warning: The vnc password is transmitted in clear text over the network and should not be considered secure

Portal0 is designated to host VNC sessions.


You can start a session as follows:

 ssh jumpgate-phasta.colorado.edu
 ssh portal0
 source /etc/profile
 start_vnc.sh

And follow the directions

(You may want to remember your password and port number so that you can reuse your session)

When you are done, end your session by

 source /etc/profile
 stop_vnc.sh

OpenGL

Portal0 is equipped with a VirtualGL install which will allow you to use OpenGL programs (which do not use pthreads)

Simply wrap your OpenGL program with the "vglrun" command

 vlgrun glxgears

If you have access to another VirtualGL server you can connect to it first (Portal0 doesn't have a particularly fast graphics processor)

 vglconnect server
 vglrun glxgears


Note that VGL uses a number of threads. If you have trouble with vglrun crashing with a message about Thread::Start() make sure you haven't set your stack size too large (remove any ulimit -s or ulimit -n calls from your shell start scripts)

Clients

Portal0 uses TurboVNC from the VirtualGL project, available from http://www.virtualgl.org/Downloads/TurboVNC

Other VNC viewers will also work, such as TightVNC and RealVNC

View Only Mode

To share your desktop with another user in view only mode set a view only password by running

 vncpasswd

Have the other user connect in the same way you would but have them set their viewer to be in view only mode and use your view only password. Typically this is done as follows:

 vncviewer -viewonly

Windows

The PuTTY SSH client can handle ssh tunneling on Windows based machines. You can download it here: http://www.chiark.greenend.org.uk/~sgtatham/putty/

When you open putty, enter jumpgate.scorec.rpi.edu as in the Host Name box. Then click the + button next to SSH on the left pane (to expand the SSH tree node). Choose the Tunnels page. The start_vnc.sh script should tell you to run "ssh -L????:portal0:???? jumpgate.scorec.rpi.edu" on your machine. Enter the number between the -L and the first colon in the "Source port" box. Enter the rest in the Destination box (starting with portal0) and click the add button. Then click "Open" and login as normal. You will then be able to use a vncviewer as instructed by the script.

Example:

The script says: ssh -L5905:portal0:5900 jumpgate-phasta.colorado.edu enter 5905 in the Source port box enter portal0:5900 in the destination box.


Try using this viewer utility http://www.tightvnc.com/download/1.3.10/tightvnc-1.3.10_x86_viewer.zip

Web Based Viewer

If you can't or don't want to install a VNC viewer you can use a Java based one. You will need a JVM and a Java browser plugin. You will also need the port that the start_vnc script assigned you to be free on your local computer

Forward your session through jumpgate as before before, adding a second port, 580n. For example, if the script tells you to

ssh -L5905:portal0:5902 jumpgate-phasta.colorado.edu you should

 ssh -L5902:portal0:5902 -L5802:portal0:5802 jumpgate-phasta.colorado.edu

Then point your browser to http://localhost:5802 and log in with the password specified by the script when prompted. (Replace 2 with the value specified by the script)

Troubleshooting

If you have used vncserver (It doesn't matter which version) on a SCOREC machine before, you will need to clear your vnc settings for the script to work. You can do this by running rm -rf ~/.vnc

stop_vnc.sh may display some errors; this is normal.

If you have trouble deleting ~/.vnc send an email to Benjamin.A.Matthews@colorado.edu

If any of these commands fail, you may need to source /etc/profile to get the necessary environment variables (this should be fixed soon)

VirtualGL has trouble with some threaded programs. If your OpenGL program exhibits segmentation faults or other issues, this could be the problem. Check back for the solution later.

If the given password is rejected you can run stop_vnc.sh and restart to get a new one. Occasionally the random password generator may generate passwords which VNC doesn't like.

If VirtualGL complains about not being able to get a 24bit FB config either vglconnect to another VirtualGL enabled server or complain to Benjamin.A.Matthews@Colorado.edu

If your VNC connection is very slow, you might want to try changing the compression and encoding options. See your vncviewer's documentation or try this

 vncviewer -encodings tight -quality 6 -compresslevel 6

If you have trouble with text distortion try adding

 -nojpeg