VNC: RealVNC

Overview

RealVNC is a Virtual Network Computing (VNC) server which provides a securely authenticated and encrypted way for users to create and view a virtual desktop that persists even if no client is actually viewing it. As an example, let's say you are at an airport getting ready to fly to Texas for a conference, and you discover that you have a bug in your simulation code that causes it to crash after running for 6 hours. You want to run a visual debugger like TotalView on your simulation process and come back in 6 hours to find out what happened. You log into the czvnc cluster, run a RealVNC session, and connect to it. You launch TotalView inside the session, start your simulation, and then disconnect from the session and catch your flight. You can then reconnect to your VNC session from the comfort of your hotel in Texas and view TotalView's window, which has been happily updating the whole time. Science is saved!

The example above shows how RealVNC allows users to start a long-running GUI-based program on the cluster, which opens a main window, and then disconnect from the cluster without closing the main window and exiting the program. The user can then reconnect later to the virtual desktop to view any changes in their program. RealVNC at LLNL is straightforward to use, secure, highly performant, and compatible with multiple client viewers. However, its downside is that it does not support OpenGL programs such as VisIt. If you require OpenGL support, you will need to use NICE DCV.

The VNC nodes are intended to be a gateway to LC clusters. LC requests that users do not do heavy development work directly on the VNC nodes (i.e., parallel code builds), but rather ssh to an appropriate LC cluster to do so.

Environment

  • Machines: RealVNC is only installed on visualization cluster login nodes: czvnc.llnl.gov and rzvnc.llnl.gov.
  • Location: RealVNC is launched by connecting to port 5999 on the VNC nodes. See the Usage section below.
  • Settings: No special settings are necessary for RealVNC on the server.
  • File Systems:The VNC nodes mount the typical LC file systems, including home directories, parallel file systems, and workspaces.
  • Reduced Programming Environment: The VNC nodes are intended to provide a gateway to LC clusters and thus have a reduced development environment. Many packages found on clusters in /usr/tce, such as compilers and MPI builds, will not be made available on the VNC nodes. If there are packages that users would like LC to consider supporting on the VNC nodes, please send a request along with justification to the LC Hotline.

Usage Instructions

  1. Ensure the proper account(s). You must have an account on czvnc for the CZ or rzvnc for the RZ to use RealVNC. These accounts should automatically be enabled for users who have access to CZ and RZ systems, respectively. Please contact the LC Hotline if you do not have a czvnc or rzvnc in addition to your LC accounts.
  2. Download the client. Download and install the RealVNC client on your desktop. Other VNC clients are not supported. For LLNL Windows users, RealVNC is available through the LLNL LANDesk Software Portal.
  3. Connect to the remote host. Exactly how to do this depends on where you are connecting from:
    1. If you are connecting to the CZ
      The hostname for the VNC server on the CZ is czvnc.llnl.gov. To connect to czvnc.llnl.gov, you simply launch your VNC viewer and connect to czvnc.llnl.gov:5999. You will be automatically connected to a session.
      NOTE: Several users have reported graphical "glitches" on czvnc where some windows and menus in the default desktop environment suddenly appear as solid black regions when focused.  LC systems staff are working on a permanent solution, but in the mean time the following steps should correct any server-side display corruption:
      1. Press+to open a prompt for a command.
      2. Enter restart (or simply r) as the command and pressto reset the desktop and window manager without interrupting your session.
    2. If you are connecting to the RZ (Restricted Zone):
      The hostname for the VNC server on the RZ is rzvnc.llnl.gov. rzvnc.llnl.gov is not visible from outside of the RZ, including from desktops or over VPN. Before connecting, you need to create an ssh tunnel for the VNC connection, as described below.
      1. Create the VNC tunnel.
        The tunnel will listen on your local desktop and forward port 5999 through the RZ gateway, rzgw.llnl.gov, to rzvnc.llnl.gov. On your desktop, copy and paste this command into a console/Terminal window, after which you will have 180 seconds to connect (see next step below)

        ssh -Snone -f -l <USERNAME> -L 5999:rzvnc:5999 rzgw.llnl.gov sleep 180

        Check the output for any errors about not being able to forward ports. Your ssh tunnel is now connected. You have 180 seconds to connect! You can of course change this by changing the 180 to whatever you want in the command above.

        Windows users: Windows does not include SSH by default. Your can either install cygwin and use the above SSH command in that environment, or you can install PuTTY with plink.exe from the PuTTY website. For more information about plink, see this document. You will simply substitute "plink.exe" for "ssh" in the command above, and remove the -Snone -f piece, thus:

        plink -l <USERNAME> -L 5999:rzvnc:5999 rzgw.llnl.gov sleep 180

        Both plink and SSH on Windows worked well in our tests.

      2. Launch your VNC viewer and connect to localhost:5999.
  4. Changing Screen Resolution. You can use your desktop environment's built-in display controls to select your preferred resolution; if you need a custom resolution added the list, please submit a request via the LC Hotline. You change the resolution via the command line per the steps below.
    1. List available resolutions (based on this file) by typing the command xrandr in a terminal in your virtual desktop and note an integer id associated with various resolutions at the top of the output.
    2. Use xrandr -s <id> to dynamically change your window to the desired resolution.
  5. Disconnect from the VNC session. You can disconnect by closing the window, and your VNC session will persist so you can return to it later. Keep in mind that we only have a limited number of licenses, so please only do this if you need to. To close your session, log out from the virtual Linux desktop inside your VNC session. This will exit the VNC server. Note: Logging out automatically happens because of this line at the end of /etc/xstartup (If you make your own ~/.vnc/xstartup file, be sure to put this same command at the end of it, or your VNC session will not terminate properly.):
vncserver-virtual -kill $DISPLAY

Help

If you haven't looked through this RealVNC and NICE DCV tutorial, you should do that first.

The VNC nodes are intended to provide a gateway to LC clusters and thus have a reduced development environment. Many packages found on clusters in /usr/tce, such as compilers and MPI builds, will not be made available on the VNC nodes. If there are packages that users would like LC to consider supporting on the VNC nodes, please send a request along with justification to the LC Hotline.

Additional tips and tricks for using VNC at LC can be found on the CZ Confluence at https://lc.llnl.gov/confluence/display/LC/VNC+How-to+for+LC and on the RealVNC support page. Help is also available from the lc-hotline@llnl.gov, (925) 422-4531.

UCRL-MI-128467-REV-1