NICE DCV licensing: How to deploy the RLM License Server

NICE DCV licensing

NICE DCV Server licensing is based Reprise LM (RLM). RLM manages the number of concurrent NICE DCV sessions which are licensed by the installed license key.

You can download the RLM binaries here: http://www.reprisesoftware.com/admin/software-licensing-download.php. After accepting the license different RLM bundles are offered from links similar to this https://www.reprisesoftware.com/license_admin_kits/x64_l1.admin.tar.gz or https://www.reprisesoftware.com/license_admin_kits/rlm.v14.0BL2-x64_w3.admin.exe.

You can get more information about how to administer a RLM server at:

No license is required for the client component, called NICE DCV Endstation. The RLM license server has some similarities to FlexLM.

Deploying DCV demo license keys

Demo licenses are distributed as text files that look similar to the following sample:

LICENSE nice dcv 2019 25-apr-2017 uncounted hostid=ANY _ck=6d1efc7767
sig="60Q04580RS382GU11CVB69C36TSYCQQJNKNW79QY08AG11SVARK5TPEM464UQ1J
7T0ADB87GM07CP"

Demo licenses expire after 30 days from the date they were generated (reading the license you can easily get the expiration date) and are not bound to a specific host (hostid=ANY).

The NICE DCV installer will ask you to provide the license file at installation time.

If you already installed NICE DCV on your application host, to install a demo license, you simply need to rename the license file you received from NICE to license.lic and copy it to the following directory:

  • On Linux: /etc/dcv/license.lic (Default; can be changed in the DCV configuration file /etc/dcv/dcv.conf
  • On Windows: <Program Files>\NICE\dcv\license\

To replace an old demo license with a new one, you can simply replace the old license.lic file with a new one.

Demo licenses must be installed on each DCV Application Host individually. They should not be used with the RLM License Server.

If you need to use a license server to distribute licenses check the next section “Installing a NICE DCV production license” and contact NI SP Support at our contact form to obtain a valid production license.

Deploying floating license keys

NICE DCV production licenses are floating and are managed by a license server. Such licenses allow the user to run the server component of NICE DCV on any machine that can access the license server. Licenses are counted in terms of concurrent remote desktops.

Production licenses are distributed as text files that look similar to the following sample:

HOST MyHost abcdabcdabcd 5053
ISV nice 
LICENSE nice dcv 2019 permanent 5 share=hi _ck=6cda023b55 sig="60P0451
2YCXT2UT2YDTE84926TJVXQXQUP78V0022G969R9P8AVABM03CSAWNX3NSTRCNP6BV4"

The license file specifies:

(HOST line): the license server host name ("MyHost"), the rlmhostid identifier which is typically the MAC address ("abcdabcdabcd") and the TCP port ("5053") to use.

(LICENSE line): supported software feature ("dcv") major version ("2019"), expiration date ("permanent" means no expiration) and maximum number of concurrent desktops ("5").

You must edit the license file with a common text editor to modify the HOST line:

  • specify the FQDN host name (replace “MyHost”): this host name must be resolved by the DNS used by the DCV Server node
  • optionally change the TCP port number (“5053”)

Notice that only the host name (“MyHost”) and the TCP port number can be changed without corrupting the signature of the license, which would make the license file invalid.

Please note that when ordering a new license for NICE DCV you might receive a “parked” license which states a preliminary delivery. Please follow the instructions in the email you received to provide the information for the final license.

Installing the license server

This section describes how to install and configure the RLM License Server to distribute NICE DCV production licenses to Application Servers.

In case you already have an RLM Server you can skip this section and check section Installing nice.set file in an existing license server.

Contact NI SP support if you need instructions on how to configure your RLM server in High Availability mode.

Pre-installation Setup

  • Before installing, identify a server computer that will be able to host the RLM server. Supported Platforms: Linux and Windows (XP or later). Virtual Machines are not allowed (contact NI SP support in case you need to run the license server on a Virtual Machine).
  • This server computer needs to be on your internal company network and must be reachable by all the computers in your organization that may need to check out licenses. In particular it must be reachable by all DCV application servers, but does not need to be reachable by DCV end stations. 
  • The license server should not be turned off. You will not be able to start new applications using DCV until the license server is restarted.
  • The load imposed on the server by RLM is extremely light, meaning a dedicated server is not required.
  • Once this server has been chosen it can be used by other products that use RLM as well.
  • Before installing the license file you need to modify the HOST line by replacing the MyHost placehoder with the real hostname of the RLM server.

Linux installation

You can install a stand-alone RLM Server following these instructions:

  1. Log in as root user
  2. Create a new group and user named rlm. This user can be any valid user/service account, but should NOT be root.
groupadd -r rlm
useradd -r -g rlm -d "/opt/nice/rlm" -s /sbin/nologin -c "RLM License Server" rlm

Create the /opt/nice folder and run the command to extract the files of the downloaded RLM server:

mkdir -p /opt/nice/rlm/license
tar xvf x64_l1.admin.tar.gz -C /opt/nice/rlm/ --strip-components 1

The rlm directory will be unpacked. Make sure the rlm user owns the /opt/nice/rlm directory and files:

chown -R rlm:rlm /opt/nice/rlm

Copy the license file license.lic to the /opt/nice/rlm/license/ folder:

cp license.lic /opt/nice/rlm/license/ 

Copy the /usr/share/dcv/license/nice.set (part of the DCV server installation) to /opt/nice/rlm:

cp /usr/share/dcv/license/nice.set /opt/nice/rlm/

Create a RLM server service. Open /opt/nice/rlm/dcv-rlm with your preferred editor and insert the following script (you can download the script here as well):

#!/bin/sh
# chkconfig: 35 99 01
# description: The Reprise License Manager daemon.
# processname: dcv-rlm

### BEGIN INIT INFO
# Provides: dcv-rlm
# Required-Start: $local_fs $remote_fs $syslog
# Required-Stop: $local_fs $remote_fs $syslog
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: The Reprise License Manager daemon.
# Description: A service that runs the Reprise License Manager daemon.
### END INIT INFO

# user used to run the daemon
RLM_USER="rlm"
# root of rlm installation
RLM_ROOT="/opt/nice/rlm"
# license directory (license files should have .lic extension)
RLM_LICENSE_DIR="/opt/nice/rlm/license"
# log file
RLM_LOG_FILE="/var/log/rlm.log"
_getpid() {
    pidof -o $$ -o $PPID -o %PPID -x "$1"
}
start() {
    echo -n "Starting rlm: "
    touch ${RLM_LOG_FILE}
    chown "${RLM_USER}" ${RLM_LOG_FILE}
    su -p -s /bin/sh "${RLM_USER}" -c "${RLM_ROOT}/rlm -c ${RLM_LICENSE_DIR} \
     -nows -dlog +${RLM_LOG_FILE} &amp;"
    if [ $? -ne 0 ]; then
 echo "FAILED"
 return 1
    fi
    echo "OK"
}
stop() {
    echo -n "Stopping rlm: "
    pid=`_getpid ${RLM_ROOT}/rlm`
    if [ -n "$pid" ]; then
 kill $pid >/dev/null 2>&amp;1
 sleep 3
 if [ -d "/proc/$pid" ] ; then
     echo "FAILED"
     return 1
 fi
    fi
    echo "OK"
}
status() {
    pid=`_getpid ${RLM_ROOT}/rlm`
    if [ -z "$pid" ]; then
 echo "rlm is stopped"
 return 3
    fi
    echo "rlm (pid $pid) is running..."
    return 0
}
restart() {
    stop
    start
}
case "$1" in
    start)
 start
 ;;
    stop)
 stop
 ;;
    status)
 status
 ;;
    restart)
 restart
 ;;
    *)
 echo $"Usage: $0 {start|stop|status|restart}"
 exit 1
esac
exit $?
# ex:ts=4:et:

Now we are ready to deploy and activate our RLM server startup script:

chmod +x /opt/nice/rlm/dcv-rlm 
cp -a /opt/nice/rlm/dcv-rlm /etc/init.d/
chkconfig --add dcv-rlm

Start the RLM Server:

service dcv-rlm start

The RLM server logs are in /var/log/rlm.log file. You should see a line similar to

date_time (nice) Server started on license1 (hostid: host_id) for: dcv dcv-gl

Your server will now start automatically on boot.

For maximum security, the dcv-rlm script disables the RLM web interface with the “-nows” option.

In case you want to enable the web interface, edit the dcv-rlm script and remove the “-nows” option. If you decide to use the web interface make sure to configure its authentication and access control mechanisms properly.

In case of need you can change the following parameters directly in the /etc/init.d/dcv-rlm file:

# user used to run the daemon
RLM_USER="rlm"
# root of rlm installation included in NICE DCV
RLM_ROOT="/opt/nice/rlm"
# license directory (license files should have .lic extension)
RLM_LICENSE_DIR="/opt/nice/rlm/license"
# log file
RLM_LOG_FILE="/var/log/dcv-rlm.log"

The DCV server needs to know as well where to connect to the license server. This is configured in the dcv.conf file. Open the /etc/dcv/dcv.conf file with your favorite editor e.g.:

vim /etc/dcv/dcv.conf

And find the [license] section where you can adapt the license-file parameter replacing the existing path with the RLM server’s port and hostname (or IP address) in the 5053@RLM_server_hostname format:

license-file = "5053@RLM_server_hostname"

The port 5053 is the standard RLM port which can be adapted in the license.lic file deployed above and the dcv.conf file.

The RLMUtil program allows you to work with the RLM server. It is located at:

/opt/nice/rlm/rlmutil

Description of options:

Usage: rlmutil program <args>, -OR-
              program <args>
 where program is one of:
  rlmadduser rlmdebug   rlmdown
  rlmhostid  rlmnewlog  rlmremove
  rlmreread  rlmstat    rlmswitch
  rlmswitchr
 args are:
 -c license_file | port@host - to specify license
 -dat - use *.dat instead of *.lic for license file
 -h - print usage information and exit
 -q - don't prompt on rlmdown/rlmremove/rlmswitch(r)
      and don't check license checksums
 -v - print version and exit
 -z password - specify license password
  rlmadduser options-filename username password
  rlmdebug [product]
  rlmdown [isv] [RLM]
  rlmhostid -q [[-]32|disksn|ether|gc|host|ip|internet|rlmid1|user|uuid]
  rlmnewlog isv log-file-name
  rlmremove server_host port isv handle
  rlmreread [isv]
  rlmstat [-a] [-f] [-i [isv]] -I [-l [isv]] [-n [node]] [-p [product]] [-u [user]]
  rlmstat -avail [-b] [-i isv] [-p product]
  rlmswitch isv new-file
  rlmswitchr isv new-file

Using RLMUtil:

  • Find the hostid of the RLM server (which is the MAC address):
    /opt/nice/rlm/rlmutil rlmhostid
  • Reread the license in case there was a change or you are debugging:
    /opt/nice/rlm/rlmutil rlmreread -c /opt/nice/rlm/license/license.lic
  • Get the RLM server status:
    /opt/nice/rlm/rlmutil rlmstat -c /opt/nice/rlm/license/license.lic
  • Switch to new license file:
    /opt/nice/rlm/rlmutil rlmswitch nice new-license-file-with-path -c /opt/nice/rlm/license/license.lic

Windows installation – option 1

The DCV installer for Windows already deploys an RLM Server into the <Program Files>\NICE\RLM folder.

If you want to use one of the DCV nodes as license server you just need to configure it following these instructions:

  1. Create the folder <Program Files>\NICE\RLM\license
  2. Copy the license file (license.lic) inside the <Program Files>\NICE\RLM\license folder
  3. Open a Command Prompt (CMD.EXE) as an Administrator
  4. Install the RLM Server as a Windows Service:
cd "<Program Files>\NICE\RLM"
rlm.exe -nows -dlog "<Program Files>\NICE\RLM\rlm.log" -c "<Program Files>\NICE\RLM\license" -install_service -service_name dcv-rlm

Note the directory specified by the -c option MUST NOT end with a backslash “\”. Now start the RLM Server:

net start dcv-rlm

Windows installation – option 2

Alternatively, you can install a stand-alone RLM Server following these instructions:

  1. Obtain the nice-rlm.vXXX.exe file from the NICE distribution
  2. Create the folder C:\RLM
  3. Extract the nice-rlm.vXXX.exe file into C:\RLM
  4. Create the folder C:\RLM\license
  5. Copy the license file (license.lic) inside the C:\RLM\license folder
  6. Open a Command Prompt (CMD.EXE) as an Administrator
  7. Install the RLM Server as a Windows Service:
cd C:\RLM
rlm.exe -nows -dlog C:\RLM\rlm.log -c C:\RLM\license -install_service -service_name dcv-rlm

The nice.set file can be found in the C:\Program Files\NICE\DCV\Server\license directory

Note the directory specified by the -c option MUST NOT end with a backslash “\”. Now start the RLM Server:

net start dcv-rlm

To check RLM is working fine:

  • Check the RLM log file: C:\RLM\rlm.log
  • Issue the following command:
    • C:\RLM\rlmstat -a -c [hostname]@5053

Configuring your firewall

Your firewall needs to be configured to let the license server accept TCP connections from all your NICE DCV application hosts. RLM uses two TCP ports to communicate:

  • one for the RLM License Server
  • one for the NICE ISV Server

The RLM License Server, by default, runs on TCP port 5053. This can be changed in the first line of your license.lic file

HOST MyHost abcdabcdabcd port

The NICE ISV server by default dynamically binds to a random high level port.

To specify a static port for the NICE ISV server, add port=port_number to the ISV line of your license.lic file

ISV nice port=port_number

where port_number is the TCP port you want the NICE ISV server to listen on.

The RLM license server web interface by default runs on TCP port 5054.

To open the port on a Linux RLM server you can apply the following commands:

sudo iptables-save
# open default RLM port 5053 in firewall
sudo firewall-cmd --zone=public --add-port=5053/tcp --permanent
sudo firewall-cmd --reload
sudo firewall-cmd --list-all
# sudo iptables-save | grep 8443

In case you are running the RLM server on a cloud server don’t forget to adapt the inbound networking rule as well.

Installing nice.set file in an existing RLM License Server

To use an existing RLM Server for DCV you need to add to the RLM License Server the NICE ISV vendor file nice.set

On Windows:

  1. Obtain the nice-rlm.vXXX.exe file from the NICE DCV distribution
  2. Create the folder C:\RLM
  3. Extract the nice-rlm.vXXX.exe file into C:\RLM
  4. Copy the nice.set file from C:\RLM to your RLM Server installation
  5. Restart the RLM Server

On Linux:

  1. Copy the /usr/share/dcv/license/nice.set (part of the DCV server installation) to your RLM Server installation:
cp /usr/share/dcv/license/nice.set (path_to_RLM_server_installation)

Setting up license server failover

High Availability strategy can be implemented running a second RLM server, that connects to the primary server and normally stays silent. In case the primary fails, it takes the role of license server. This procedure occurs transparently with respect to the applications: running sessions will continue to run, new sessions will checkout the license tokens from the same pool of licenses.

The failover license file looks different from the primary:

HOST myfailoverserver fedcbafedcba 5053
ISV nice  
LICENSE nice rlm_failover_server 1.0 permanent 1 hostid=00a0ed2b71ba
  _primary_server=5053@myprimaryserver _ck=f053fc302a sig="60PG450T2K25M8C
  RESXKQEWQMH5H9K33BGD2QG822M0AAGBN2QE2GTD3PRVQ25NU19GM9G2149M0"

Notice that it does not contain any token count, but just the address and port of the primary server.

See the attached document describing how to setup a failover license server.

Troubleshooting

  • If you get the error: “Unable to find ISV binary” on a Linux RLM server
    • You need to copy the ISV binary nice.set file inside the rlm directory.
      You can find the nice.set file under the /usr/share/dcv/license/ folder of the Linux DCV server. 

Configuring the DCV Server licensing to use the RLM Server

In the DCV Windows server the RLM license server is configured in the registry at

\HKEY_USERS\S-1-5-18\Software\GSettings\com\nicesoftware\dcv\license\license-file

which you can either configure via regedit or in the Powershell. In this case start Powershell as Administrator user and issue:

New-ItemProperty -Path "Microsoft.PowerShell.Core\Registry::\HKEY_USERS\S-1-5-18\Software\GSettings\com\nicesoftware\dcv\license\license-file" -Name parameter_name -PropertyType String -Value "5053@YOUR_RLM_HOSTNAME_OR_IP" -Force

In the DCV Linux server the RLM license server is configured in /etc/dcv/dcv.conf. Locate the [license] section and configure the license-file parameter as follows:

license-file = "5053@RLM_server_hostname_OR_IP"

(Partially based on a NICE support article)