We just released Receiver for Mac 12.2 and the headline feature for the release is Generic USB Redirection. This is a feature that we’ve been getting more and more requests for recently and I’d like to take some time to describe it to you.

Generic USB Redirection is an HDX feature that allows you to use local USB devices connected to your Mac like they were connected directly to your remote session. This enables support for classes of devices that we don’t have specific support for like scanners, 3D mice and signature pads.

Optimized vs. Generic USB Devices

Before we take a deep dive into Generic USB Redirection in Receiver for Mac it’s important to understand the difference between optimized and generic USB devices. An optimized USB device is one that Receiver has specific support for, like the ability to redirect webcams via the HDX Multimedia virtual channel. A generic device is a USB device for which there is no specific support in Receiver.

By default, USB devices with optimized virtual channel support cannot be redirected via Generic USB Redirection unless specifically put into “Generic” mode. I’ll go over how this is done later in this post.

In general, you will get better performance for  USB devices in “Optimized” mode than in “Generic”. However, there may be cases where a USB device may not have full functionality in “Optimized” mode so it may be necessary to switch to “Generic” to gain full access to its features.

Enabling Generic USB Redirection

Generic USB Redirection will be enabled in Receiver for Mac as long as the it’s enabled on the server to which you are connecting. By default, Generic USB Redirection is disabled in XenDesktop but it can be enabled in Citrix Studio via the “Client USB device redirection” policy.

Redirecting USB Devices

The primary way to redirect a USB device into an HDX session is via the Devices menu. The Devices menu can be found in two locations in Receiver for Mac. The first is when clicking the new Devices button on the Desktop Toolbar:

DesktopToolbarDevicesMenu

There is also a USB Devices menu in the main Citrix Viewer menu:

MainMenuDevicesMenu

A generic USB device that is not currently redirected will appear as an enabled, unchecked menu item. A generic USB device that is currently redirected will appear as an enabled, checked menu item. An optimized USB device will appear as a disabled, checked item.

Redirecting a generic USB device is as simple as selecting the menu item for that device. The same goes for stopping redirection. Redirect an optimized USB device as a generic USB device requires selecting the “Manage Devices…” menu item to bring up the Devices preferences, which we will cover later in Configuring USB Redirection.

Once a USB device has been redirected to the remote session, it is no longer accessible to applications on your Mac. Only Receiver is capable of accessing the device. It’s also only possible to redirect a device to a single session at a time.

Notifications

When launching a session or when plugging a new USB device into your Mac with an existing session running, Receiver will display a notification if there are new generic USB devices that can be redirected into the session.

NewDeviceNotification

If you click on the notification, a sheet or dialog will be displayed listing the devices capable of being redirected.

NewDeviceSheet

To redirect one or more of the devices, select the devices that you wish to redirect and press the Connect button.

There are some things to note about the behavior of this notification:

  • It only applies to “Generic” devices. If a device has optimized virtual channel support, it will not cause the notification to appear nor will the device be listed in in the dialog.
  • When plugging a new device into your Mac with an existing session running, the notification will only appear if a Citrix Viewer instance is the foreground application.

Configuring USB Redirection

The Preferences window of Receiver for Mac has undergone some changes in the 12.2 release. As it relates to Generic USB Redirection, the Devices preference pane been reorganized. The drive mapping related settings have been moved into a new File Access preference pane and in their place now lives a USB section that allows for USB-specific configuration.

DevicesPrefs

The USB section contains a table of the currently connected USB devices, listing their device class, name, connection state, redirection state and virtual channel mode. This is a live listing and will automatically update as devices are added or removed.

From the device table, it’s possible to redirect or stop redirecting a device with the Redirect checkbox. You can also switch a device between “Generic” and “Optimized” mode via the dropdown in the Virtual Channel column.

One thing to be aware of, because it might be slightly confusing at first, is that the device table will only appear if the Preferences window is opened from Citrix Viewer. If you open it from Citrix Receiver or the menu bar icon, the table will not be there but the USB preferences below it will.

Under the device table are two preferences related to automatically redirecting devices. When enabled, the “When a session starts, connect devices automatically” preference means that any generic USB device that is not already redirected in another session will automatically be redirected into a newly launched session. Similarly, enabling the “When a new device is connected while a session is running, connect the device automatically” preference means that if plug a new generic USB device into your Mac while an active Citrix Viewer is the foreground application, that device will automatically be redirected into that foreground session.

USB Device Policy

It’s possible that customers may want to prohibit or allow certain types of devices from being redirected. To this end, Receiver for Mac supports two types of policy regarding what kinds of USB devices can be redirected.

The first is USB Client Policy. On Receiver for Mac, USB Client Policy is controlled by a text file located at /Library/Application Support/Citrix Receiver/usb.conf. The default USB Client Policy in Receiver for Mac looks like this:

# Policy file for USB remoting
#
# Lines are processed in order; the first match (ALLOW or DENY) is
# used.
#
# Syntax is an ordered list of case insensitive rules where # is line comment
# and each rule is (ALLOW | DENY) : ( match )*
# and each match is (class|subclass|prot|vid|pid|rel) = hex-number
# Maximum hex value for class/subclass/prot is FF, and for vid/pid/rel is FFFF

DENY: vid=17e9 # All DisplayLink USB displays
DENY: class=02 # Communications and CDC-Control
DENY: class=09 # Hub devices
ALLOW:vid=056a pid=0315 class=03 # Wacom Intuos tablet
ALLOW:vid=056a pid=0314 class=03 # Wacom Intuos tablet
ALLOW:vid=056a pid=00fb class=03 # Wacom DTU tablet
DENY: class=03 subclass=01 prot=01 # HID Boot keyboards
DENY: class=03 subclass=01 prot=02 # HID Boot mice
DENY: class=0a # CDC-Data
DENY: class=0b # Smartcard
DENY: class=e0 # Wireless controller
DENY: class=ef subclass=04 # Miscellaneous network devices
ALLOW: # Otherwise allow everything else

Receiver processes this file and uses it to determine if a particular USB device should be allowed to be redirected. Those of you that are familiar with Generic USB Redirection on Receiver for Windows or Receiver for Linux will notice that it follows the same rule format.

The second policy type is USB Server Policy. During session initialization, the server sends Receiver the USB Server Policy. Like the USB Client Policy, the USB Server Policy is processed and used to determine if a particular USB device can be redirected. USB Server Policy can be configured in Citrix Studio via the “Client USB device redirection rules” policy.

Request for Feedback

Generic USB Redirection has been available in Receiver for Windows and Receiver for Linux for some time and we’re happy to make it available in Receiver for Mac as well. Please do let us know what you think of the Generic USB Redirection feature in Receiver for Mac. We’re very interested to hear for you.

Also, please check out these other blogs related to the Receiver for Mac 12.2 release: