The VNC viewer is an addon to open a VNC session within the Gateway web desktop. The combinaison between VNC viewer and remote terminal addons enable the opening of any graphical application within the Gateway web desktop directly. The following wiki explain the different scenarios to open xclock graphical application.

Before to proceed, the administrator of Gateway must install the 2 addons, vnc_viewer and remote_terminal. Follow the addon installation page.

To let a user to open graphical applications, he must be allowed to use both VNC viewer and remote terminal addons. Follow the users rights page.

Open an existing VNC session

Use VNC viewer to open an existing VNC session. The VNC session can be started by an external tool or within the remote terminal, using vnc_server command line.

Open a graphical application in the remote terminal

Use remote terminal with bash script to open a bash session

Use the specific command hpcg_xrun.sh to start a graphical application within a VNC session

$ which hpcg_xrun.sh
~/hpcgateway/utilities/hpcg_xrun.sh

$ hpcg_xrun.sh -- xclock
A VNC session has been started on port 5900
You can check logs in /home/hpcgadmin/.vnc/hpcg/rdsk.rnd01:0/hpcg_xrun.sh.log
Set the DISPLAY to :0 in a terminal to open windows in this VNC session
export DISPLAY=:0

$ export DISPLAY=:0
$ xeyes

You can see that once the VNC session is started, you can add other graphical tools (here xeyes) in the same VNC window if you export the DISPLAY environment variable as explained after the first launch.


Important: to close the VNC windows cleanly, it is important to close the graphical applications inside the VNC window, and not the VNC window itself.


Type hpcg_xrun.sh -h to get full information of the command options.

$ hpcg_xrun.sh -h

Usage: hpcg_xrun.sh [options] [vnc_options] -- command [command_options]
       hpcg_xrun.sh -list|-reconnect|-kill  [session]

Description:
    Start a VNC session with various options for windows management.
    List, reconnect, kill VNC session(s) that are still running.
    If command is defined, it is launched at the start in the VNC session.

Available options are:

    -h|--help|-?
        This help

    -geometry WxH
        Set screen 0's width and height
        Override HPCG_REMOTE_DESKTOP_GEOMETRY environment variable if set
        Default is 1024x768

    -desktop [kde|twm|mwm|fvwm|xfwm|xfce|gnome|gnome-wm|none]
        Set the the remote desktop to start with
        Override HPCG_REMOTE_DESKTOP environment variable if set
        Default is gnome-wm

    -close_on [cmd|wmg|vnc]
        Define when the VNC session is automatically closed and all processes are closed
        cmd: clean all processes when one exit the initial command started
        wmg: clean all processes when one exit the window manager
        vnc: clean all processes when one close the vnc windows (only available if -xvfb)
        Override HPCG_REMOTE_DESKTOP_CLOSE environment variable if set
        If a command is specified, the default is cmd, otherwise the default is wmg

    -forever
        By default, the VNC session is automatically closed when the parent shell is closed
        Use this option if you want to keep the VNC session, and reconnect it later
        Override HPCG_REMOTE_DESKTOP_FOREVER environment variable if set
        Default is false

    -password passphrase
        Use passphrase to connect to the VNC session
        Override HPCG_REMOTE_DESKTOP_PASSWORD environment variable if set
        If not specified, hpcg_xrun.sh generate a strong password and pass it to
        the VNC client for the connection.

    -noauth
        Disable VNC authentication method (set to none). This is a security hole.
        Override HPCG_REMOTE_DESKTOP_AUTH environment variable if set
        Default is vnc. hpcg_xrun.sh generate a strong password and pass it to
        the VNC client for the connection.

    -xvnc
       Use xvnc schema to start VNC session: Xvnc
       Override HPCG_REMOTE_DESKTOP_SCHEMA environment variable if set

    -xvfb
       Use xvfb schema to start VNC session: Xvfb, X11vnc
       Override HPCG_REMOTE_DESKTOP_SCHEMA environment variable if set

    -bg
        The VNC session is started in background
        hpcg_xrun.sh exit as soon as the VNC session is started
        Override HPCG_REMOTE_DESKTOP_MODE environment variable if set
        Default is bg

    -fg
        The VNC session is started in foreground
        hpcg_xrun.sh stay active while the VNC session is active
        Override HPCG_REMOTE_DESKTOP_MODE environment variable if set
        Default is bg

    -newtab
        Start the remote desktop in a new browser tab
        Override HPCG_REMOTE_DESKTOP_NEWTAB environment variable if set
        Default is false

    -auto_minimize
        Automatically minimize the remote terminal once the VNC session is started
        Override HPCG_REMOTE_TERMINAL_AUTO_MINIMIZE environment variable if set
        Default is false

    -auto_close
        Automatically close the remote terminal once the VNC session is started
        Override HPCG_REMOTE_TERMINAL_AUTO_CLOSE environment variable if set
        If this option is set, the VNC session is started in forever mode
        Default is false

    -list
        List VNC sessions that are running

    -reconnect [session]
        Reconnect to VNC session(s) that are running

    -kill session [session]
        Kill VNC session(s)

If command is empty, the program looks for HPCG_REMOTE_COMMAND environment variable if set

Open a graphical application directly from the desktop

Use remote terminal with specific script to directly open a graphical application directly from the desktop.

Follow the steps:

  • Open the admin dashboard addon
  • Create a new script to call hpcg_xrun.sh command with the graphical application to open
  • Add the tag “remote_terminal_33b27ccd” to the script
  • Open the remote terminal and select the newly created script, that will start hpcg_xrun.sh

Once you have started the graphical application, you can create a link to the desktop (top right button of the remote terminal).

Then you can directly open the graphical application from the web desktop.