Resolving COMOS Remote License Service (RLS) and Dongle Errors on Terminal Server
The COMOS Remote License Service (RLS) is the centralized license daemon that serves floating COMOS licenses (dongle-based) to clients connecting through a terminal server / Remote Desktop Session Host. When the RLS refuses to hand a license to a Comos.exe process running on the same machine, engineers typically see one of the following signatures in the RLS window or in the Comos.log:
-
LM_Error -2000(undocumented numeric code emitted by the license manager). licence server will be ignored because local license file-
No license for module '...' availablewhile the dongle is physically attached and the LED is on. -
ComosLicense*.xmlartifact silently shadows the network server.
This reference walks through the field-proven diagnostic path, driver reinstallation, license-type validation (SERVER vs. LOCAL), and the interaction with Microsoft Remote Desktop Services (RDS) / Terminal Server CAL enforcement that frequently masks the real cause.
1. Environment and Affected Versions
The fault pattern has been reproduced on the following configuration envelope:
| Component | Supported / Affected Versions | Notes |
|---|---|---|
| COMOS | 10.2.x, 10.3.x, 10.4.x, 10.5.x | Behavior of license lookup identical across releases; only the bin path differs. |
| Remote License Service (RLS) | Builds shipped with COMOS 10.2 and newer | Service name: ComosRLS on most setups. |
| Comos License Server (CLS) | Recommended for SERVER license type | Replaces RLS when serving floating licenses from a network share. |
| Dongle | SafeNet (SafeKey), WIBU-Systems CodeMeter, Siemens-native USB | WIBU required for COMOS 10.4 SP1 and later. |
| Driver | WIBU-SpO / CodeMeter Runtime 7.x; SafeNet HASP HL 5.x/6.x/7.x | Wrong driver = silent LM_Error -2000. |
| Terminal Server / RDS | Windows Server 2012 R2, 2016, 2019, 2022 | Session Host, not RD Virtualization Host. |
| Client OS | Windows 10 / 11 (21H2 and newer) | mstsc.exe 10.0+ for RDP 8.x. |
2. Root Cause Analysis of LM_Error -2000
The numeric LM_Error -2000 is not a documented public error code; it is an internal sentinel returned by the COMOS license manager (LMgr32) when one of the following pre-conditions is violated at session start-up:
- No FneKey matching the dongle is reachable on USB / network.
- A local
ComosLicense*.xmloverrides the network lookup, so the RLS is intentionally ignored. - The license type bound to the dongle is
LOCALand notSERVER, so it cannot be served by RLS / CLS. - The vendor driver (SafeNet HASP / WIBU CodeMeter) is missing, mismatched, or running under a session-0 service account that cannot see the USB stack forwarded to the user session.
- USB redirection through RDP is blocked by group policy, so the dongle is invisible inside the terminal-server session even though it is visible to the local host.
The RLS does not crash; it logs the negative acknowledgement and falls back to the next candidate provider in the lookup order:
-
ComosLicense*.xmlin%ComosInstall%\..\Config(always wins if present). - Local dongle via FneKey driver.
- Remote License Service on the configured network host.
- Comos License Server (CLS) for SERVER-type floating licenses.
Because step 1 silently pre-empts everything else, it is the single most common field cause of the failure.
3. Pre-Flight: Confirm the Dongle is Even Visible
Before touching the license server, prove the dongle is addressable from the terminal-server session. The fastest in-tool check is the bundled Dongle.exe utility that ships in the COMOS Bin directory.
- Open an RDP session to the Terminal Server and log on with the same Windows account that will run
Comos.exe. - Navigate to
%ComosInstall%\Bin\Dongle.exe(default:C:\Program Files\Siemens\COMOS\10.5.0\Bin). - Launch
Dongle.exeas Administrator. The window should display the Dongle ID (a 7- to 9-digit decimal) and the green Test button must return OK for every module listed. - If the ID field is blank and Test returns Failed, the vendor driver is the problem; jump to section 4.
- If the ID is shown but Test still fails, suspect a license-type mismatch (SERVER vs. LOCAL); jump to section 5.
For terminal-server environments you can also verify visibility from the underlying host console (not the RDP session) by running Dongle.exe locally. If the dongle is visible on the host console but not from inside the RDP session, USB redirection is the culprit.
3.1 Verifying USB Redirection over RDP
USB dongles can reach the terminal-server session through one of two paths:
-
Session-level redirection:
mstsc.exe /admindoes not support most redirection; use a normal RDP session and select Local Resources → More → Other supported RemoteFX USB device on the client. - Device-level redirection: Use a Digitrust / Digi AnywhereUSB or a hardware network-USB bridge so the dongle is a network device, not a USB one.
Inside the session, validate with PowerShell:
Get-PnpDevice | Where-Object { $_.InstanceId -match 'USB\\VID_' } | Select-Object Status,FriendlyName,InstanceId
If the SafeNet or WIBU device is not listed, USB redirection is disabled by Group Policy. The relevant policy is:
-
Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Device and Resource Redirection\Do not allow supported Plug and Play device redirection= Disabled -
Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Device and Resource Redirection\Do not allow video capture redirection= Disabled
4. Driver Reinstallation: The Single Most Effective Fix
The vendor-supplied driver must match the dongle generation AND the COMOS version. A wrong driver returns no error in the RLS window beyond LM_Error -2000.
4.1 Identify the Dongle Generation
| Generation | Vendor | Visual Cue | Required Driver |
|---|---|---|---|
| HASP HL 3.25 / 4.x | SafeNet (Gemalto) | Blue plastic shell, "HASP" text | Sentinel HASP HL Run-time 5.92+ |
| HASP SRM | SafeNet | Red shell, "SRM" text | Sentinel HASP SRM Run-time 7.80+ |
| CodeMeter (CmStick) | WIBU-Systems | Black slim stick with WIBU logo | CodeMeter Runtime 7.10+ (≥ 7.50 for COMOS 10.5) |
| CodeMeter Tera | WIBU-Systems | USB-A with metal sleeve | CodeMeter Runtime 7.50+ |
4.2 Clean Driver Reinstall (SafeNet)
- Stop
ComosRLS:net stop ComosRLS - Stop the SafeNet service:
net stop "Sentinel HASP License Manager"(older) ornet stop "Sentinel LDK License Manager"(newer). - Uninstall any pre-existing HASP / LDK run-time via Settings → Apps.
- Delete residual
hasplms.exefrom%ProgramFiles%\SafeNet\and%ProgramFiles%\Common Files\SafeNet Sentinel. - Reboot. Do not plug the dongle until prompted.
- Download the matching Sentinel HASP HL Run-time installer from the SafeNet / Thales release portal matching your dongle generation.
- Run the installer as Administrator. Plug the dongle when prompted.
- Reboot, log on to the terminal server, and re-run
Dongle.exe(see section 3).
4.3 Clean Driver Reinstall (WIBU-Systems CodeMeter)
- Stop
ComosRLS:net stop ComosRLS - Stop the CodeMeter service:
net stop CodeMeter - Uninstall the existing CodeMeter Runtime through Settings → Apps.
- Delete residual keys:
reg delete "HKLM\SOFTWARE\WIBU-SYSTEMS" /freg delete "HKLM\SOFTWARE\WOW6432Node\WIBU-SYSTEMS" /f - Reboot.
- Download the matching CodeMeter Runtime from the WIBU-Systems website (use 7.10+ for COMOS 10.2-10.3, 7.50+ for COMOS 10.4-10.5).
- Run the installer. Plug the dongle.
- Verify visibility with the CodeMeter WebAdmin tool at
https://localhost:22350— the dongle should appear in the container list with a non-empty license entry. - Re-run
Dongle.exeto confirm the test passes.
5. License Type Validation: SERVER vs. LOCAL
Every COMOS dongle is electronically stamped with a license type at provisioning time. The two relevant types are:
- LOCAL — License is bound to the workstation on which the dongle is physically attached. RLS / CLS will not serve it.
- SERVER — Floating license served by the Comos License Server (CLS) or the older Remote License Service (RLS) to any authorized client.
You can read the type directly from the dongle via:
- Open the Siemens License Management Tool installed alongside COMOS (Start → Siemens → License Management).
- Select the dongle in the left pane. The Type column shows
SERVERorLOCAL. - For SafeNet HASP dongles, an alternative is the
haspinfoCLI:"C:\Program Files\SafeNet\HASP HL\haspinfo.exe" -i— the lineType: SERVERconfirms a network-servable license.
If the type is LOCAL and the dongle is attached to the terminal server, only the terminal-server session can use the license. RLS will refuse the request and the client gets LM_Error -2000. In that case, swap the dongle for a SERVER-type license, or move the LOCAL dongle to the user's workstation and run COMOS from a client install that points back to the terminal server for everything except the license.
6. The Hidden ComosLicense*.xml Override
COMOS searches the Config directory of the install tree for any file matching the wildcard ComosLicense*.xml. If such a file exists, the license resolver uses it as the authoritative source and never consults the RLS / CLS. This behavior is by design (it allows licensing to be frozen for offline or test environments) but it has caused most of the field tickets described in this article.
6.1 Locate the File
- Open an elevated command prompt.
- Run:
dir /s /b "C:\Program Files\Siemens\COMOS\*ComosLicense*.xml" - Typical locations to check:
%ComosInstall%\Config%ProgramData%\Siemens\Automation\COMOS\Config-
%APPDATA%\Siemens\COMOS\Config(per-user)
6.2 Disable the Override
To re-enable RLS / CLS lookup, rename or move the offending file:
ren "C:\Program Files\Siemens\COMOS\10.5.0\Config\ComosLicense_Local.xml" ComosLicense_Local.xml.disabled
Then restart ComosRLS:
net stop ComosRLS & net start ComosRLS
Re-launch Comos.exe and confirm that the RLS window now shows a successful license grant instead of licence server will be ignored because local license file.
%ProgramData%\Siemens\COMOS\Logs\RLS.log by default. Search the file for the string will be ignored — the timestamp of that line tells you exactly when the override kicked in, which is invaluable when comparing against group-policy or scripted deployments that re-create the ComosLicense*.xml file on every logon.7. Remote Desktop Services / Terminal Server Licensing Interaction
A frequent confusion in the field is between two completely independent license systems that both run on a terminal server:
-
Microsoft RDS CALs — issued by the Remote Desktop Services license server. Without valid
Per UserorPer DeviceCALs, the RDS Session Host will issue a 120-day temporary license and then refuse new sessions. - COMOS application license — the dongle- or CLS-served COMOS seat. RLS / CLS are the only COMOS-side components that grant this.
The two are independent: an RDS CAL does not grant a COMOS seat, and a valid COMOS dongle does not unlock RDS session quota. If the terminal server is in its temporary-license grace period and the COMOS dongle is also in a fault state, both errors can appear simultaneously and obscure each other. Always validate RDS licensing first.
7.1 Verify the RDS License Server
- Open the Remote Desktop Licensing Manager (
licmgr.exe) on the license server. - Confirm the server is Activated. If it is Not Activated, the wizard will refuse to issue CALs. Activate against the Microsoft Clearinghouse as described in the Microsoft activation guide.
- Confirm the Session Host is pointing at this license server:
gpresult /r | findstr "LicenseServer"or check the RD Licensing tab intsconfig.msc. - Verify the CAL pack:
Per DeviceCALs are best for shift-work terminal servers;Per UserCALs for named-engineer access. Per Microsoft's terminal-server licensing reference, each client needs at least two licenses: a Windows NT Workstation license (in modern terms: a Windows client license) and an RDS CAL.
7.2 Common RDS Pitfalls That Mimic COMOS Errors
- Server 2022 CAL downgrade — Server 2022 RDS does not accept Server 2008 CALs. Re-issue CALs of the matching generation.
- Stale grace period — If the license server has been unreachable for > 120 days, sessions are rejected with a generic "out of memory" or "cannot load profile" error, which is easy to misread as a COMOS issue.
-
Workgroup vs. domain — A workgroup license server cannot be discovered by the Session Host; configure the registry value
LicenseServerunderHKLM\SYSTEM\CurrentControlSet\Services\TermService\Parameters\LicenseServersexplicitly.
8. Step-by-Step Resolution Procedure
Execute the following sequence on the terminal server. Each step has a measurable pass/fail criterion so you can stop the moment the failure is isolated.
- Validate RDS licensing using the steps in 7.1. Stop if the license server is not activated — fix that first.
-
Search for stray
ComosLicense*.xmlper section 6. Rename any matches. -
Stop RLS:
net stop ComosRLS. - Reinstall the dongle driver per section 4 (match dongle generation to driver major version).
- Reboot the terminal server (this re-enumerates the USB stack under session 0).
-
Run
Dongle.exeas Administrator in the RDP session. ID must populate, Test must return OK on every module. -
Confirm license type per section 5. If
LOCAL, you cannot serve it; obtain aSERVER-type license. -
Start RLS:
net start ComosRLS. Watch the window for a clean start sequence (noLM_Error -2000). -
Launch
Comos.exeand connect to the database. The error dialog from step 1 of the symptom list should no longer appear. -
Inspect the
client.datfile on the local drive. It should be updated with the current workstation name and session ID; if it has not changed, the RLS is still being bypassed.
9. Verification Checklist
| Check | Expected Result | Tool / Command |
|---|---|---|
| Dongle ID populated | 7-9 digit decimal | Dongle.exe |
| Dongle self-test | OK on every module |
Dongle.exe → Test |
| License type | SERVER for floating | Siemens License Management Tool |
| No stray XML | Zero hits for ComosLicense*.xml
|
dir /s /b per section 6.1 |
| RLS service state | Running, no errors | sc query ComosRLS |
| RLS log | No will be ignored entries |
%ProgramData%\Siemens\COMOS\Logs\RLS.log |
| Database connection | Successful login | COMOS client |
client.dat update |
New timestamp and workstation name | Compare to previous copy |
| RDS licensing | Activated, CALs available | Remote Desktop Licensing Manager |
| USB redirection | Dongle visible in session |
Get-PnpDevice per section 3.1 |
10. Troubleshooting Matrix
| Symptom | Likely Cause | Confirm With | Fix |
|---|---|---|---|
LM_Error -2000 in RLS log |
Missing / wrong driver |
Dongle.exe ID blank |
Reinstall driver per section 4 |
licence server will be ignored because local license file |
Stray ComosLicense*.xml
|
Search of Config tree | Rename file per section 6.2 |
| Dongle visible on host console, invisible in RDP | USB redirection blocked | Get-PnpDevice |
Adjust GPO per section 3.1 |
| Dongle visible, Test OK, but COMOS reports no license | License type LOCAL | Siemens License Management | Swap for SERVER-type license |
| RLS refuses to start | Port 22000 already in use | netstat -ano | findstr 22000 |
Stop conflicting service |
| Database connection error after license OK | RLS not restarted after XML removal | net start ComosRLS |
Restart RLS |
| 120-day RDS grace period banner | RDS license server not activated | licmgr.exe |
Activate per Microsoft docs |
| Error only for remote users, not console | Dongle not on network-USB bridge | Physical inspection | Deploy AnywhereUSB or move dongle to terminal server |
11. Field-Proven Hardening
Once the failure is resolved, harden the terminal server so the issue cannot reappear after the next patch cycle.
-
Lock down the
Configdirectory: deny the local Users group write permission on%ComosInstall%\Configso deployment scripts cannot silently drop aComosLicense*.xmlthere. - Pin the driver version in a GPO-managed device installation restriction rule so Windows Update cannot replace the SafeNet / CodeMeter runtime with an older revision.
- Centralize the dongle behind a network-USB bridge. This removes the dependency on per-session USB redirection and survives Windows feature updates.
-
Monitor the RLS log with a scheduled task that grep's for
will be ignoredandLM_Error -2000and emails the operations mailbox. Detection within minutes beats detection during the next engineering shift. - Document the license type (LOCAL vs. SERVER) in your asset register. A dongle swap without a license-type update is the single most common repeat-fault after a refresh.
12. When to Open a Siemens Support Ticket
If the matrix above is exhausted and the failure persists, escalate to Siemens Industry Online Support. The official ticket-creation procedure is documented in Siemens Support Entry 109474501. Include in the ticket:
- COMOS version and service pack.
- Dongle generation (HASP HL, HASP SRM, CodeMeter) and ID.
- Driver version installed (full version string, e.g.
Sentinel HASP HL Run-time 6.93.2.0). - RLS log file (
%ProgramData%\Siemens\COMOS\Logs\RLS.log) for the failed session. - Output of
Dongle.exeshowing the test result. - Result of the
dir /s /bsearch forComosLicense*.xml. - Screenshot of the License Management Tool showing the license type.
- Remote Desktop Licensing Manager screenshot confirming activation status.
Submitting all of the above in a single ticket reduces the mean time to resolution from days to hours, because the support engineer can rule out driver, license-type, and RDS issues without further round-trips.
FAQ
What does the LM_Error -2000 actually mean in COMOS?
It is an internal sentinel from the COMOS license manager indicating that no usable license provider was reachable. The most common trigger is a missing or mismatched vendor driver, a stray ComosLicense*.xml in the Config directory, or a LOCAL license type being served through RLS.
How do I find the offending ComosLicense*.xml file?
Run dir /s /b "C:\Program Files\Siemens\COMOS\*ComosLicense*.xml" from an elevated command prompt. Common locations are %ComosInstall%\Config, %ProgramData%\Siemens\Automation\COMOS\Config, and the per-user %APPDATA%\Siemens\COMOS\Config. Rename any match to .disabled and restart the RLS service.
Can a SafeNet HASP HL dongle be used on a Windows Server 2022 terminal server?
Yes, but you must use the Sentinel HASP HL Run-time version 5.92 or newer (preferably the 7.x branch) and verify the dongle is visible inside the RDP session through Get-PnpDevice. If the device is only visible on the host console, switch to a network-USB bridge or enable USB redirection in Group Policy.
What's the difference between RLS and CLS in COMOS licensing?
RLS (Remote License Service) is the older daemon and is being replaced by CLS (Comos License Server) for SERVER-type floating licenses. CLS adds central management, better logging, and is required for any installation serving more than 10 concurrent COMOS seats. RLS still works for small deployments and is the default for dongle-based single-server scenarios.
Does Microsoft RDS licensing affect COMOS licensing?
No — the two are independent. RDS licensing controls how many users can connect to the terminal server itself; COMOS licensing controls how many of those connected users can run COMOS modules. A terminal server can have full RDS CALs but no COMOS license, or vice versa. Always validate both independently, starting with RDS activation because an unactivated server will silently drop new sessions within 120 days.