There are a lot of components to VMware View that are really cool features. One of the coolest in my opinion is the ability to set up Location-Based Printing based on where the client device is located.
End users can use a workstation, thick client, or zero client Client device to connect to VM Desktops. A need your users have is the ability to print, beit documents, emails, etc. But, connecting a printer directly to each and every Client device is not practical, nor cost-efficient. So what is the solution? A concept that’s been in place in the IT world for years – network printing. But how does one configure a VM that is accessed by a Client to print to a network printer located near the Client device? VMware View Location-Based Printing (LBP) is the answer.
Overall, the steps needed to set up LBP aren’t entirely too difficult, but getting LBP to work properly can indeed be a headache. As such, I want to discuss some steps you can go through when LBP is not working properly for you. First, let’s start with the setup. Getting LBP set up correctly can cut your troubleshooting steps in half or reduce them fully altogether.
From a VM standpoint, there should be nothing further done that hasn’t already been done during the VM creation process. You need both VMware Tools & the VMware View Agent installed, installing VMware Tools first then the View Agent. One thing to keep in mind when initially preparing your “parent” VM used for View Pool deployment – it doesn’t matter when you install OS patches in the prep process, but there are a couple parts of the install process order that does need to be followed: 1. Install VMware Tools before VMware View Agent, and 2. make sure the VMware View Agent is installed before any version of Microsoft .NET Framework.
Next, the Group Policy Object (GPO) used to assign printer mappings neeeds to be set up, which is done by registering a DLL named TPVMGPoACmap.dll. To register the AutoConnect Map Additional Printers for VMware View GPO, browse to the install directory of your Connection Server to attain the DLL and copy it to the workstation you’ll be configuring the GPO on (install directory: C:\Program Files\VMware\VMware View\Server\extras\GroupPolicyFiles\ThinPrint\x64). Go to the Start menu > Run, and type: regsvr32 “C:\DirectoryLocationOfDLLFile\TPVMGPoACmap.dll”. Now we’re ready to configure LBP.
1. Depending on the printer needing to print to, attain the print driver from the printer vendor’s website. Or, if you have a print server set up, you may have the driver already saved to a directory on the server.
a. Copy or save the print driver to a directory on your Parent VM that will be used for your Pool of VMs using this particular printer.
b. Open Printers & Devices in Windows and select Add Printer to begin the wizard.
c. Choose to install a local printer and select a port (LPT1 is sufficient).
d. Browse to the printer driver location and select the proper driver file. If you get a message stating the driver is not “signed”, select Continue Anyways.
e. Use the default name chosen by the Add Printer Wizard, do not share the printer, then Finish.
After the installation, the printer driver is now properly installed. You can now delete the printer that was just created (it will be re-installed later). From a vSphere/View standpoint, you can now create your desktop Pool from this Parent VM. You can reference the View Administration Guide for procedures in creating the Pool.
2. Open Group Policy Management and browse to the AutoConnect GPO location: Computer Configuration > Software Settings > AutoConnect Map… GPO
3. Open the GPO and add only ONE of the first 4 mapping choices – IP Range, Client Name, MAC Address, or User/Group. For purposes of this post, I chose an IP Range.
4. The Default option (first column) should be selected if the printer to be mapped is to also be the Default printer for users.
5. The printer name is a “friendly” (or, alias if you will) that will be shown in the Printers & Devices area on the VM. This can be whatever you want it to be. If you have a print server, I recommend consistency and naming the printer as it is named on your print server.
6. Print Driver – this is a key part. The driver name must match EXACTLY as it is displayed under the Advanced tab of the printer properties of the printer on the print server. This means spaces and case-sensitivity of the name MUST be used. I have on more than one occasion mis-typed a name or left a letter or few out which caused the printer to not show in the VM Desktop Printers & Drivers panel.
7. Add the IP Port as is used by this printer on the print server. Once the information is added, select the ENABLED radio button on the top right corner of the GPO. See my Sample configuration below:
8. Add the GPO to the OU that you’ll be placing the Pool of VMs in. NOTE: your Client devices do not need to have this GPO mapped to them…only your VMs. Also, if you want to add another printer to the VM Pool, just add another row in the GPO and configure the same as the initial printer, changing the printer name, driver name, and printer port.
9. The last thing to configure here is to add your Client devices MAC Addresses to a DHCP Reservation on your DHCP server using the range of IPs for your Client devices as was configured in the IP Range of the GPO above.
You should now be able to power on your Client device, connect to a VM in your Pool, and after several moments see the printer added to the Printers & Devices panel in the VM. If your printer doesn’t show (shouldn’t take longer than a minute to populate), there are a few troubleshooting steps you can take:
– Check the Windows Firewall service in the VM used by the Client. Generally, if it is on, you may run into issues with your printer showing up. Unless you have a need to use the Windows Firewall, I recommend disabling it. If after you disable the firewall and log off/log back on to the VM your printer shows up, you’ll need to reconfigure your Parent VM then Recompose your VM Pool.
– Printer Driver. As I mentioned above, if the name you typed in your GPO does not match the driver name of the printer on your print server, your printer will not show up. Also, if the print driver that you installed on your Parent VM doesn’t match the print driver you have installed on your print server, your printer will not show up. You may need to reinstall the printer on your print server with the driver you used to install on your Parent VM.
– Verify your newly created Pool of VMs are in the OU you attached the AutoConnect GPO to.
– Lastly, while connected to a VM in the Pool, verify the TP AutoConnect and VMware View Agent Services are running. If they aren’t, you may have a corrupt View Agent install. The only way to resolve the issue is to follow the below process (the order listed MUST be followed):
a. On Parent VM, uninstall the View Agent
b. Uninstall VMware Tools
c. Uninstall any .NET Framework installs
d. Reinstall VMware Tools
e. Reinstall VMware View Agent
f. Reinstall any needed .NET Framework software
Following the above setup process & going through the Troubleshooting steps, you should be able to have the desired printer show for your VM Pool. If you have any comments to add, I welcome hearing your thoughts.
Shane (twitter: @coolsport00)