You can configure which USB devices are redirected to a remote desktop.

You can configure USB policies for View Agent or Horizon Agent on the remote desktop, and for Horizon Client on the Mac client system, to achieve the following goals.

  • Restrict the types of USB devices that Horizon Client makes available for redirection.

  • Make View Agent or Horizon Agent prevent certain USB devices from being forwarded from a client computer.

  • Specify whether Horizon Client splits composite USB devices into separate components for redirection.

    Composite USB devices consist of a combination of two or more devices, such as a video input device and a storage device.

Configuration settings on the client might be merged with or overridden by corresponding policies set for View Agent or Horizon Agent on the remote desktop. For information about how USB settings on the client work together with View Agent or Horizon Agent USB policies, see the topics about using policies to control USB redirection in the Configuring Remote Desktop Features in Horizon 7 document.

Using Rules from a Previous Horizon Client Release

In previous Horizon Client releases, you had to use sudo to configure USB filtering and splitting rules. You can use the following procedure to move rules that use sudo to new rules that do not use sudo.

  1. On the Mac client, open Terminal (/Applications/Utilities/Terminal.app) and run the following command:

    sudo defaults export com.vmware.viewusb /tmp/usb.plist
  2. Open a Terminal window (press command+N) and run the following command:

    defaults import com.vmware.viewusb /tmp/usb.plist
  3. In the first Terminal window, run the following command:

    sudo rm -rf /tmp/usb.plist
  4. Close both Terminal windows.

You can now use defaults write com.vmware.viewusb property value to update the rules.

Syntax for Configuring USB Redirection

You can configure filtering and splitting rules to include USB devices, or to exclude USB devices from being redirected. On a Mac client, you configure USB functionality by using Terminal (/Applications/Utilities/Terminal.app) and running a command as root.

  • To list the rules:

    # defaults read domain

    For example:

    # defaults read com.vmware.viewusb
  • To remove a rule:

    # defaults delete domain property

    For example:

    # defaults delete com.vmware.viewusb ExcludeVidPid
  • To set or replace a filter rule:

    # defaults write domain property value

    For example:

    # defaults write com.vmware.viewusb ExcludeVidPid vid-1234_pid-5678
    Important:

    Some configuration parameters require the VID (vendor ID) and PID (product ID) for a USB device. To find the VID and PID, you can search on the Internet for the product name combined with vid and pid. Alternatively, you can look in the USB Log file after you plug in the USB device to the Mac client when Horizon Client is running. For more information, see Turn on Logging for USB Redirection.

  • To set or replace a splitting rule for a composite device:

    # defaults write domain property value

    For example:

    # defaults write com.vmware.viewusb AllowAutoDeviceSplitting true
    # defaults write com.vmware.viewusb SplitExcludeVidPid vid-03f0_Pid-2a12
    # defaults write com.vmware.viewusb SplitVidPid "'vid-0911_Pid-149a(exintf:03)'"
    # defaults write com.vmware.viewusb IncludeVidPid vid-0911_Pid-149a

    Composite USB devices consist of a combination of two or more devices, such as a video input device and a storage device. The first line in this example turns on automatic splitting of composite devices. The second line excludes the specified composite USB device (Vid-03f0_Pid-2a12) from splitting.

    The third line instructs Horizon Client to treat the components of a different composite device (Vid-0911_Pid-149a) as separate devices, but to exclude the component that has interface number 03 from being redirected. This component is kept local.

    Because this composite device includes a component that is ordinarily excluded by default, such as a mouse or keyboard, the fourth line is necessary so that the other components of the composite device Vid-0911_Pid-149a can be redirected to the remote desktop.

    The first three properties are splitting properties. The last property is a filtering property. Filtering properties are processed before splitting properties.

Excluding a USB Ethernet Device

You might want to exclude a USB Ethernet device from redirection. For example, if the Mac client uses a USB Ethernet device to connect the network for the Mac client to a remote desktop, and you redirect that USB Ethernet device, the Mac client loses its connection to both the network and the remote desktop.

To hide a device from the USB connection menu permanently, or if you have set the remote desktop to autoconnect USB devices, you can add an exception to exclude the Ethernet connection as follows.

defaults write com.vmware.viewusb ExcludeVidPid vid-xxxx_pid-yyyy

In this example, xxxx is the vendor ID and yyyy is the product ID of the USB Ethernet adapter.