VNC: RealVNC

Outline

  1. Overview
  2. Usage Instructions
    1. Before connecting
    2. Connecting to a VNC session
    3. Troubleshooting connection issues
    4. Troubleshooting graphical issues
    5. Disconnecting from a VNC session
  3. Use Cases
  4. Environment
  5. Caveats
  6. Help

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 on an LC cluster (czvnc, rzvnc, or scfvnc). Once logged into this desktop via RealVNC's VNC Viewer, users are able to open a terminal and ssh to other LC machines. Connections to LC machines via VNC Viewer persist even if no client is actually viewing it.

    Usage Instructions

    Before connecting

    1. Ensure the proper account(s). All users should have accounts available on the czvnc cluster, and RZ and SCF users should also have their accounts active in those respective centers.
    2. Open the RealVNC client (NOTE You *must* use the RealVNC client to connect)
      1. On the OCF (CZ or RZ), you may install the RealVNC client from your LLNL workstation's software catalog for MacOS or Windows and via the LLNL YUM repository on Linux. Alternatively, you can download the RealVNC client and install it on your desktop. VNC clients not supplied by RealVNC will not work.
      2. On the SCF, the Windows and Linux iSRD workstations already have the RealVNC client installed. In Windows, you can find the "VNC Viewer" client in your normal application menu. In Linux, you can find the RealVNC "VNC Viewer" client by going to your desktop's application menu and looking under the "Internet" sub-menu. If you do not see it, you may need to reboot to load a newer image.
      3. Click on the VNC Viewer entry to open the client.

    Connecting to a VNC session

    1. After opening VNC Viewer, enter the host address and port into the address bar. The hostnames for our VNC servers on the CZ, RZ, and SCF are czvnc.llnl.gov, rzvnc.llnl.gov, and scfvnc.llnl.gov. The port for VNC servers is 5999.
      1.  For the CZ, 
        1. Enter czvnc.llnl.gov:5999 (if you have a LLNL RSA token).
        2. If you do not have a RSA token and are a Tri-Lab user, enter czvncsso.llnl.gov:5999.
      2. For the RZ, 
        1. Enter rzvnc.llnl.gov:5999 (for LLNL users connected to VPN)
        2. For users coming from outside LLNL or the ihpc network, you will first need to set up an SSH tunnel to forward your traffic. 
          1. Set up a tunnel through a server on an approved network (LLNL or LANL/SNL ihpc node). For example, from an SNL desktop, you might type:
            ssh -L 5999:rzvnc.llnl.gov:5999 ihpc
          2. Then launch your VNC viewer and connect to localhost:5999
      3. For the SCF, enter scfvnc.llnl.gov:5999
    2. After entering the host address and port, an authentication window will open. Make sure to populate the "User:" field with your LC username. For "Password:", enter your OTP from the appropriate zone:
      1. For the CZ, use your OCF pin and RSA token.
      2. For the RZ, use your OCF pin and RZ token.
      3. For the SCF, use your SCF pin and RSA token.

    3. You will now be connected to a session manager. If you have used one of our VNC servers before and have existing sessions, you should see the options Start server, Connect to server, Refresh session listing, and Kill server. (First time users and users with no pre-existing sessions will only see the options Start server, and Refresh session listing). NOTETri-lab users will bypass this session manager screen on the CZ and be taken to a remote desktop directly.
      1. To start a new VNC session, select Start server. The Server description field is optional and may be left blank or can be used to name your session for later identification/usage. Select Ok.
      2. To connect to an existing session, select the action Connect to server. Highlight the session ID to which you would like to connect and click Ok.
      3. If you believe you should have an existing session but it does not show up, click Refresh session listing to try to detect it.

                      
    4. Your remote desktop on a VNC server should now open.

    Troubleshooting connection issues

    1. The most common error messages we see when users try to Connect to server are "VNC server signature was mismatched" and "Failure to connect to server - check session logs for details". If you are seeing either of these error messages, the most likely scenario is that the session to which you are trying to connect no longer exists . Please try to start a new session via Start server
    2. The most common error users see when trying to Start server is "Failure to connect to server - check session logs for details". This may be caused by an issue on the VNC server/software side or by an issue with your account.
      1. Verify there's nothing wrong with your account:
        1. Check that your home directory usage is under quota.
        2. Check that your login files (.login, .login.linux, .profile, .profile.linux, .bashrc, .bash_profile, .cshrc, etc.) do not produce error messages on our VNC servers.
          1. For example, `module` commands like `module load` will not work on our VNC servers.
          2. ssh'ing to our VNC servers (czvnc, rzvnc, scfvnc) will allow you to see if your login files produce output/error messages there.
      2. A common error we're seeing is that users will sometimes fail to automatically connect to a newly created session, though the session is created. If you are seeing the error message "Failure to connect to server - check session logs for details" after trying to Start server, you will want to check your session listing to see if a new session has been added since running Start server and then try to manually connect to that session:
        1. Remove any broken/dead sessions that are still listed as options under your session listing. You can either
          1. Select Kill server, highlight the broken session, and hit Ok.
          2. Remove the *.pid files for broken sessions in your `$HOME/.vnc` directory and kill any associated processes associated with those sessions, visible under `ps -u <lc_username>` at the command line.
        2. Choose to Refresh session listing if necessary to ensure your broken/dead sessions no longer appear to be options to which you can connect.
        3. Start a new session by selecting Start server.
        4. After seeing the "Failure to connect..." error message again, choose Refresh session listing to show your recently created new session.
        5. Choose Connect to server, highlight the newly created session, and hit OK.

    NOTEThe most common reasons previously created sessions no longer exists include:

    1. Existing sessions will be cleared out after a reboot or update of any of the VNC nodes.
    2. Older/recently unused sessions may be killed if the VNC server is heavily taxed and failing to allow new connections.
    3. Bugs associated with VNC system overuse and user errors can sometimes cause VNC sessions to become corrupted.

    Troubleshooting graphical issues

    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.

    Disconnecting from a VNC session

    You may choose to disconnect from a VNC session that you intend to use again later or to completely terminate your VNC session.

    1. If you want your VNC session to persist so you can connect again later, simply close the VNC session window(s), and your VNC session will persist; next time you try to open a RealVNC session, it will automatically connect you to your existing session. 
    2. To completely terminate your VNC session, there are multiple options:
      1. The suggested way to terminate your session is to log out from the virtual Linux desktop inside your main VNC session window. This will differ depending on your chosen desktop, but for Gnome, click on the "power button" icon in the upper right of the virtual desktop, select your name, and then click on Log Out. This will exit the VNC server.
        • NOTE If you make your own ~/.vnc/xstartup file, you may need to put this same command at the end of it, or your VNC session will not terminate properly.):
          vncserver-virtual -kill $DISPLAY
      2. Alternatively, you may run the "Kill Server" option from the GUI menu after you have authenticated. Select "Kill Server" from the drop-down menu and then hit "OK".

    Setting screen resolution

    1. Manually setting resolution within an active VNC Session:
      1. Open a terminal in an active VNC session.
      2. Use the xrandr command to list supported resolutions.
        1. Type xrandr into the open terminal
      3. Select an appropriate resolution and use the -s flag when calling xrandr with the desired resolution.
        1. Example: xrandr -s 1920x1080
    2. Configuring autostart scripts to set desired resolution at VNC startup:
      1. Create the file ~/.config/autostart/xrandr.desktop (if it does not already exist)
      2. Add the following lines to the file and change the XXXXxYYYY to a supported resolution:
        1. [Desktop Entry]
          Name=Resolution Autoset 
          Comment=Automatically set resolution 
          Exec=bash -c "xrandr -s XXXXxYYYY" 
          Terminal=false 
          Type=Application
        2. NOTE Simply pasting the text above without modifying the 4th line containing XXXXxYYYY will cause VNC to not start properly. The line must have a supported resolution put in. Reference section A above to find supported resolutions.
      3. Example of a ~/.config/autostart/xrandr.desktop file using 1440x900 resolution:
        1. [Desktop Entry]
          Name=Resolution Autoset
          Comment=Automatically set resolution
          Exec=bash -c "xrandr -s 1440x900"
          Terminal=false
          Type=Application
          
        2. NOTE Nothing else aside from the text above needs to be in the xrandr.desktop file for VNC to startup. Adding # comment lines will cause the file to not be read correctly.
    3. NOTE Using the previous method by adding the `-geometry` flag to the ~/.vnc/config is no longer supported. That file must be removed before connecting in order to allow VNC to launch correctly.

    Use Cases

    A few examples of why LC users might choose to use RealVNC to connect to LC machines:

    1. To create a persistent interactive session. 
      As an example, let's say you have a several windows open to remote systems running interactive jobs but need to go home for the evening. After dinner you want to monitor your interactive jobs or perhaps open a Totalview debugger from the compute cluster. With RealVNC, you can set those windows and jobs up in a virtual desktop that is available anywhere you have network access to the server. You can simply log into the CZ or RZ vnc cluster, re-attach to your RealVNC session, and continue where you left off, with all windows remaining the same. RealVNC at LLNL is straightforward to use, secure, highly performant, and compatible with multiple client viewers.
    2. To ssh to LC machines.
      Many Windows users in particular find RealVNC's VNC Viewer as convenient alternative to Xwin32 and other ssh clients.
    3. To easily enable graphics on LC machines.
      Graphics are enabled on RealVNC by default, so users will not have to enable X11 forwarding in order to work with graphical user interfaces.

      Environment

      • Machines: RealVNC is only installed on dedicated VNC clusters, with one for each LC center: czvnc.llnl.gov, rzvnc.llnl.gov, and scfvnc.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.

      Caveats

      There are a couple caveats when using RealVNC software to connect to LC machines:

      • LC prohibits resource-intensive applications from running directly on the VNC server. To ensure a smooth experience for a large number of simultaneous users, users should use the RealVNC desktop only as a gateway to SSH to other systems, e.g. login nodes for SLIC or compute clusters. For this purpose, some common applications, such as Firefox or apps in /usr/tce, have been disabled. It is permitted to run GUI applications remotely from another system on the virtual desktop such as Firefox or Totalview.
      • RealVNC does not support some OpenGL programs. If you require OpenGL support, you will need to use NICE DCV. If you find that running VisIT in vncviewer is not adequate, we suggest you use the VisIT client-server interface.
      • LC does not guarantee persistent environments. Users will usually be able to connect to pre-existing sessions and find their virtual desktop (running on one of our vnc clusters) as they were left. However, sessions may be terminated at any time, for example due to maintenance or system overuse

      Help

      Please contact the LC Hotline (email lc-hotline@llnl.gov or call 2-4531) if you need help troubleshooting connection issues.

      The VNC nodes are intended to provide a gateway to LC clusters and thus have a reduced application environment. Many packages found on clusters such as compilers and MPI builds, are not 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.Al

      UCRL-MI-128467-REV-1