Composite USB Devices Step-by-Step
The goal:
ACME Inc. has requirements for specific peripheral devices to work with VDI. One of the devices is a Microsoft LifeCam Cinema Webcam. ACME’s vision is for when an end-user plugs-in a USB device the device should auto-connect to the users VDI session.
The challenge:
Microsoft LifeCam Cinema, a frequently used Webcam has difficulty working in the VDI environment. The device appears in the drop-down list from the Horizon View Client. When enabled the camera uses the Microsoft Webcam drivers that are installed in the image. This would be fine, and in fact a preferred method according to Microsoft. However, the Webcam doesn’t work in VDI using normal pass-through. If enable redirect for the Webcam, it switches to using the VMware Webcam drivers and it works fine in VDI. So how do we exclude a single device, accept all the others, and still have a functioning Webcam?
Solution Summary:
By enabling USB device splitting we are providing a dedicated channel for each device which also in-turn gives us better visibility of unique peripheral devices in the VDI environment.
- Import Horizon View templates into Active Directory
- Identify your VIDs/PIDs
- Enable Horizon View Client GPO policies
- Enable Horizon View Agent GPO policies
- Validation
Preparation Steps
Follow these steps at the domain level for the GPO that you will be placing in the View OU:
Open Microsoft Group Policy Editor (gpedit.msc)
- Modify or create a new GPO by executing a right-click on ‘Group Policy Objects’ (image1) and then select ‘New’.
- Give your GPO a name.
- Select ‘Ok’ to save your new GPO.
Image1:
Edit your GPO (Image2)
- Expand Group Policy Objects
- Select your GPO
- Select ‘Edit’
Image2:
Templates can be obtained by visiting vmware.com and downloading the latest Horizon GPO bundle (Image3).
Image3:
Importing Templates
- Expand Computer Configuration and Policies
- Expand Administrative Templates
- Right-click on ‘Administrative Templates’ and select ‘Add/Remove Templates…’ (Image4)
Image4:
Select templates to import and ‘Open’ (Image5)
- ‘vdm_agent.adm’
- ‘vdm_client.adm’
Image5:
That’s the preparation steps now let’s move onto the physical end-point (we will come back to configure the GPOs at later step.)
Physical Client Steps Required
Verify the USB Webcam is visible on the endpoint device by checking the Windows Device Manager on the physical end-point (Image6).
Image6:
Quick summary of VIDS and PIDS
USB devices are identified primarily by their vendor identification (VID) and product identification (PID). VIDs and PIDs are unique identifier numbers. A company that wishes to produce USB devices needs to register and pay for a VID. This ID is unique to that supplier. For example, Microsoft has a VID of 0x045E, and Apple has a VID of 0x05ac. Depending on how many products the company produces, they may have multiple VIDs within a single company. The product ID is a four-byte identifier that names the specific device. Coupled with the VID, the PID uniquely identifies a driver that the Operating System (OS) must load for a given device. Note that there may be multiple “products” that all use the same VID and PID if they all use the same device driver. You can see the VID and PID for a device if you look in the device manager. To do this, right-click a device and select Properties. Then click the Details tab and select Hardware Ids from the Property drop-down menu. You can see the VID and PID values reported. In the example below, this Microsoft Webcam has a VID of 045E and PID of 075D.
Locations to check for VID/PID beside device manager are in the View Client PCoIP logs (debug-XXX-XX-XX-XXXXXX.txt). (Image7)
Image7:
Steps to identify the Hardware ID for the USB device in question (Image8).
- Select ‘Device Manager’
- Select the device, i.e. ‘Microsoft LifeCam Cinema’ and select properties.
- Select the ‘Details’ tab
- In the properties pull-down, select ‘Hardware Ids’
- Write-down the Hardware Ids.
Image8:
Identify the ‘Device class guid’ for the USB device in question (Image9).
- Select ‘Device Manager’
- Select the device, i.e. ‘Microsoft LifeCam Cinema’ and properties.
- Select the ‘Details’ tab
- In the properties pull-down, select ‘Device class guid’
- Write-down the guid
Image9:
Wildcards in USB Device VIDs and PIDs
In USB configurations, you can use the ‘*’ wildcard to indicate unknown characters in the VID and PID specifications.
The standard VID-PID combination in a configuration looks like this:
vid-xxxx_pid-yyyy
With the number of characters for the VID and PID variable, which is not necessarily four digits long. To use a wildcard to specify USB devices from any vendor (here, the device type is 5593):
vid-*_pid-5593
To use a wildcard to specify all USB devices from one vendor (here, the vendor is FA11):
vid-FA11_pid-*
You can use multiple ‘*’s to indicate the exact number of unknown characters:
vid-0781_pid-55**
In this example, PIDs have four characters, all starting with ’55
Reference this link for more information on VIDS/PIDS formats. http://www.vmware.com/files/pdf/techpaper/vmware-horizon-view-usb-device-redirection.pdf
The following steps should be configured on the View Client GPO (vdm_client.adm).
Physical desktop GPO configuration steps needed (Image 10)
- Expand ‘User Configuration’
- Expand ‘Administrative Templates’
- Expand ‘Classic Administrative Templates (ADM)’, ‘VMware View Client Configuration’, and select ‘View USB Configuration’
- Select and enable, ‘Allow Auto Device Splitting’
Image10:
USB Auto-connect GPO configuration steps needed (Image 11)
- Expand ‘User Configuration’
- Expand ‘Administrative Templates’
- Expand ‘Classic Administrative Templates (ADM)’ and ‘VMware View Client Configuration’
- Select ‘Scripting definitions’
- Select and enable:
- ‘Connect all USB devices to the desktop on launch’
- ‘Connect USB devices to the desktop when they are plugged in’
Image11:
Guest OS Steps Required
The following steps should be configured on the View Agent GPO (vdm_agent.adm).
Guest desktop GPO configuration steps needed:
- Expand ‘User Configuration’
- Expand ‘Administrative Templates’
- Expand ‘Classic Administrative Templates (ADM)’ and ‘VMware View Agent Configuration’
- Select ‘View USB Configuration’
- Select ‘Exclude Vid/Pid Device’
- Enable policy
- Enter the VID/PID, i.e. ‘o:vid-045e_pid-075d’ in our example we are using an override agent modifier (Horizon Client uses the View Agent policy setting instead of the Horizon Client policy setting.)
Image12:
Validation
This is the final step of validation. When connecting to your VDI environment verify a few steps to see if all the changes you did above, worked.
We should see from the Horizon View Client pull-down for ‘Connect USB Device’ showing a similar image:
- Grey ‘Automatically Connect at Startup’
- Grey ‘Automatically Connect when Inserted’
- Additional USB devices
Note: You should NOT see the Microsoft Webcam (LifeCam) as we are excluding it from pass-through, but instead forcing a redirect connection of the camera to the VDI desktop which will use VMware’s native webcam drivers. (Image13)
Image13:
m and have it operate as normal inside your VDI session. Additionally, you should not see the Microsoft Webcam driver listed in the device chain. (Image14)
Image14:
You can also verify the policy is in effect by checking the Horizon View Agent logs on the guest OS. In this example we are looking at ‘log-2016-03-09.txt’ from DriveLetter:\ProgramData\VMware\VDM\logs location on the VDI desktop.
Image15: