13.14. How to Enable the NumLock Key for All Sun Ray Sessions

The utkeylock command can modify the state of certain locking modifier keys on a user's keyboard. Currently, only the NumLock key is supported. This command may be useful to invoke during session creation to enable NumLock for users who expect NumLock to be on by default, which is typical for Windows PCs. By default, the NumLock key is disabled on a Sun Ray Client.


This configuration works for all kiosk sessions, but it does not work for sessions using the Gnome Display Manager through a regular session mode.

The following procedure describes how to enable the NumLock key for all Sun Ray sessions.

  1. Become superuser on the Sun Ray server.

  2. Change directory to the session initialization directory.

    • Oracle Solaris:

      # cd /usr/dt/config/Xsession.d
    • Oracle Linux:

      # cd /etc/X11/xinit/xinitrc.d
  3. Create one of the following customized scripts based on the result you want (the script is called 0050.utnumlock.sh in this procedure).

    • Enable the NumLock key when a session initializes.

      # Enable NumLock key for each session
      /opt/SUNWut/bin/utkeylock -n on 
    • Enable the NumLock key when a session initializes and on all subsequent connections through hotdesking.

      # Enable NumLock key on and make sure it stays on each time a user hotdesks  
      /opt/SUNWut/bin/utaction -i -c "/opt/SUNWut/bin/utkeylock -n on" & 

    The script name should have the 0050. prefix to make sure it is run at the appropriate time.


    For Oracle Linux, the script name must have the .sh extension, otherwise the script will not get sourced.

  4. Save the script and make the script executable for everyone.

    # chmod 775 0050.utnumlock.sh
  5. Start a new session, so the script gets sourced.