LPT and COM port settings are configurable via Studio in XenApp / XenDesktop 7.9 or newer. In versions 7.0 through 7.8, these settings were only configurable using the registry. For more information, see Port redirection policies in Citrix Documentation.
Client COM port mapping allows devices attached to the COM ports on the user's endpoint to be used during virtual sessions. These mappings can be used like any other network mappings.
For each COM port, a driver in the OS assigns a symbolic link name such as COM1, COM2, etc, which is then utilized by the applications to access the port.
While most PCs no longer have built-in serial (COM) ports, the ports are easy to add via USB converters.
Beware that even if a device can attach to the endpoint via USB directly does not mean it can be redirected via Generic USB Redirection. Some USB devices function as virtual COM ports, which applications can access in the same way as physical serial port. The OS can abstract COM ports and treat them like fileshares. Two common protocols for virtual COM are CDC ACM or MCT.
(When connected through RS-485 port Applications might not work at all. Get a RS-485-to-RS232 converter to use it as a COM port)
Applications suited for serial ports often involve sensors, controllers, old check readers, pads, etc.
Some USB virtual COM-port devices use vendor-specific drivers in place of the Windows-provided drivers (usbser.sys).
These drivers allow you to force the virtual COM port of the USB device so that it does not change even if connected to different USB sockets. This might be done from Device Manager / Ports (COM & LPT) / Properties, or from the Application itself, that controls the Device.
Warning: Some applications will only recognize the Device (e.g. signature pad) consistently if it is connected to COM1 or COM2 on the client workstation.
You can map client COM ports to a Citrix session in three ways:
For information about policies, see the XenDesktop or XenApp documentation in edocs.
Let us describe methods #1 and #2 from above:
For XenApp/XenDesktop 7.9 or higher, enable the "Client COM port redirection" and the "Auto connect client COM ports" Studio policies. Once applied, some info is available in HDX Monitor:
Or, If the "Auto connect client COM ports" is failing to map the port, you can do it manually or via logon scripts. Log on to VDA, and at a command prompt window, type:
NET USE COMX: \\CLIENT\COMZ:
or
NET USE COMX: \\CLIENT\CLIENTPORT:COMZ:
Where 'X' is the number of the COM port on the VDA (ports 1 through 9 are available for mapping), and 'Z' is the number of the client COM port you want to map.
To confirm that the operation was successful, type in a VDA command prompt: NET USE
The list that appears contains mapped drives, LPT ports, and mapped COM ports.
To use this COM port in a virtual desktop or application, install your user device Application and point it to the mapped COM Port name. For example, if you map COM1 on the client to COM3 on the server, install your COM port Device application in the VDA and point it to COM3 during the session.
Use this mapped COM port as you would a COM port on the user device.
Important: COM port mapping is not TAPI-compatible. TAPI devices cannot be mapped to client COM ports. The Windows Telephony Application Programming Interface (TAPI) defines a standard way for applications to control telephone functions for data, fax, and voice calls. TAPI manages signaling, including dialing, answering, and ending calls and supplemental services such as holding, transferring and conference calls.
Make sure you can access the device from the endpoint directly, bypassing Citrix (while the port is NOT mapped to the VDA, id est, you are not connected to a Citrix session). Follow any troubleshooting instructions that came with the device and verify it works locally first.
When a Device is connected to a Serial COM Port, a registry key is created on this hive.
This can also be queried from the command prompt by running
'chgport /query'.
If troubleshooting instructions for the device are not available, you may try opening a PUTTY session and selecting Session and in Serial Line select your COM Port.
Running "MODE" in a local command window might tell you the COM port in use, and the Baud/Parity/Data Bits/Stop Bits, which you will need to match in your Putty session.
If the PUTTY connection is successful, you may be able to press 'Enter' and see some type of feedback from the Device. Whatever characters you type may be repeated on the screen, or responded to.
If this step is not successful, you will not be able to access the device from a virtual session.
Now, map the local COM port to the VDA (either via Policies or via NET USE COMX: \\CLIENT\COMZ:) and repeat the same PUTTY procedures as above but this time from the VDA PUTTY.
If PUTTY fails with error "Unable to open connection to COM1. Unable to open serial port" then probably COM1 is in use by some other device.
Run 'chgport /query'. Is the built-in Windows serial driver on the VDA auto-assigning \Device\Serial0 to a COM1 port of your VDA? If so, you can correct this:
If now you do see it mapped, PUTTY is working but no data passing, it might be a race condition. Perhaps the application connects and opens the port before it is mapped, locking it from being mapped.
You could try one of the following:
START C:\Program Files\<Your Software Path>\<your_software.exe>
NET USE COM1 /delete
NET USE COM2 /delete
NET USE COM1: \\CLIENT\COM1:
NET USE COM2: \\CLIENT\COM2:MODE COM1: BAUD=1200
Process Monitor from Sysinternals is the tool for last resort; when running it on the VDA you should Find and Filter objects like 'COM3', picaser.sys, CdmRedirector, but especially around <your_app>.exe. Any errors might pop-up there as 'Access Denied' or similar.