VMware Horizon View Client USB/Printing Services

560 views
Skip to first unread message

Mike Boylan

unread,
Jan 23, 2014, 4:14:20 PM1/23/14
to munk...@googlegroups.com
Does anyone use VMware view in their environment? If so, have you found a way to automatically start the printing & usb services via a postinstall_script after deployment of the horizon view client? There are scripts to initialize the kernel extensions and then start the services, but perhaps I'm not running the scripts in the right order, as I'm getting a message from the OS that the kernel extensions were improperly installed. Also, the scripts seem to start the services, but only for the duration of the client being open. I wonder if they can run all the time? I'm going to open a case with VMware to inquire about this, but I was curious if anyone had already figured it out?

Thanks! 

Mike Boylan
Systems Engineer
Enterprise Server Systems
Information Technology
Robert Morris University
E-mail: boy...@rmu.edu
Phone: 412-397-6921

MiqViq

unread,
Jan 24, 2014, 6:03:46 AM1/24/14
to munk...@googlegroups.com
I did some initial testing on this too.

Used this as postinstall:
<key>postinstall_script</key>
<string>#!/bin/sh
# Initialize VMware View USB services
"/Applications/VMware Horizon View Client.app/Contents/Library/InitUsbServices.tool" || exit 1

# Set prefs for future users
for USER_TEMPLATE in "/System/Library/User Template"/*; do
prefsdir="${USER_TEMPLATE}/Library/Preferences"
if [ ! -d "${prefsdir}" ]; then mkdir -p "${prefsdir}" &amp;&amp; chown 0 "${prefsdir}"; fi
defaults write "${prefsdir}/com.vmware.view" promptedUSBPrintingServicesInstall -bool YES 2&gt;/dev/null
done

# Set prefs for all current users                      
for usersdirlist in `find /Users/ -mindepth 1 -maxdepth 1 -type d | awk -F "/" '{print $NF}' | egrep -v '^Shared$|^Deleted'`
do
for user in `dscl . -list /Users UniqueID | awk '$2 &gt;= 501 { print $1; }' | grep ${usersdirlist}`
do
prefsdir="/Users/${user}/Library/Preferences"
if [ ! -d "${prefsdir}" ]; then mkdir -p "${prefsdir}" &amp;&amp; chown "${user}" "${prefsdir}"; fi
defaults write "${prefsdir}/com.vmware.view" promptedUSBPrintingServicesInstall -bool YES
chown "${user}" "${prefsdir}/com.vmware.view.plist"
done
done</string>

Seems that 'InitUsbServices.tool' does not do the necessary magic to get it running.

-MiqViq

Mike Boylan

unread,
Jan 24, 2014, 9:38:27 AM1/24/14
to munk...@googlegroups.com
MiqViq,

Thanks for the response. I also discovered that preference key yesterday and put it into MCX so that students aren't prompted in the labs. But, I'm still going to open a case with VMware. I'll post back if I get any useful information.

Mike Boylan
Systems Engineer
Enterprise Server Systems
Information Technology
Robert Morris University
E-mail: boy...@rmu.edu
Phone: 412-397-6921


--
You received this message because you are subscribed to the Google Groups "munki-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

MiqViq

unread,
Aug 21, 2014, 2:29:31 AM8/21/14
to munk...@googlegroups.com
Hi, how are you distributing VMware Horizon View Client and how are you enabling USB support on it?

I found out that there may be a solution for this:


Any success stories to share?

-MiqViq

Patrick Fergus

unread,
Aug 24, 2014, 9:28:33 AM8/24/14
to munk...@googlegroups.com
MiqViq--Mike has moved on from RMU so you might not hear from him.

I was recently working on getting VMware Horizon View 3.0 into munki--this
postinstall_script causes the USB and printer sharing to show as enabled
in the VMware Horizon View client GUI. I haven't vetted it, but thought
I'd share what I have:

###
#!/bin/sh

#Set the rights of the USB kexts and support files so they may be loaded
by unprivileged users
/Applications/VMware\ Horizon\ View\
Client.app/Contents/Library/InitUsbServices.tool

#Install ThinPrint Client
/Applications/VMware\ Horizon\ View\
Client.app/Contents/Library/thnuclnt/thnusetup.sh --install
/Applications/VMware\ Horizon\ View\ Client.app/Contents/Library/thnuclnt

###


Note unlike the VMware Communities forum post, I'm not repackaging
VMware's package. I'm just using the pkg as-is.

- Patrick


On 8/21/14, 1:29 AM, "MiqViq" <miq...@gmail.com> wrote:

>Hi, how are you distributing VMware Horizon View Client and how are you
>enabling USB support on it?
>
>
>I found out that there may be a solution for this:
>
>
>https://communities.vmware.com/message/2411043
>
>
>Any success stories to share?
>
>
>-MiqViq
>
>
>On Friday, January 24, 2014 4:38:27 PM UTC+2, Mike Boylan wrote:
>
>MiqViq,
>
>
>Thanks for the response. I also discovered that preference key yesterday
>and put it into MCX so that students aren't prompted in the labs. But,
>I'm still going to open a case with VMware. I'll post
> back if I get any useful information.
>
>
>Mike Boylan
>Systems Engineer
>Enterprise Server Systems
>Information Technology
>Robert Morris University
>E-mail: boy...@rmu.edu <javascript:>
>Phone: 412-397-6921
>Fax: 412-397-6940
>
> <http://www.rmu.edu>
> <http://www.rmu.edu>
>
>
>
>
>
>
>
>
>
>
>--
>You received this message because you are subscribed to the Google Groups
>"munki-dev" group.
>To unsubscribe from this group and stop receiving emails from it, send an
>email to
>
>munki-dev+...@googlegroups.com <javascript:>.
>For more options, visit
>https://groups.google.com/groups/opt_out
><https://groups.google.com/groups/opt_out>.
>
>
>
>
>
>
>
>
>
>--
>You received this message because you are subscribed to the Google Groups
>"munki-dev" group.
>To unsubscribe from this group and stop receiving emails from it, send an
>email to
>munki-dev+...@googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.

This electronic message, including any attachments, may contain proprietary, confidential or privileged information for the sole use of the intended recipient(s). You are hereby notified that any unauthorized disclosure, copying, distribution, or use of this message is prohibited. If you have received this message in error, please immediately notify the sender by reply e-mail and delete it.

MiqViq

unread,
Aug 24, 2014, 12:01:39 PM8/24/14
to munk...@googlegroups.com
Thanks,

I was doing some testing with the same postinstall actions with a custom created pkg.

I found out that repackaging the app (I was using pkgbuild) will break it somehow.
Probably pkgbuild strips some special permissions from the tools included inside app bundle...

So I guess the next test will be using Munki’s copy_from_dmg and postinstall script.

It would be nice that VMware Horizon View Client would not ask admin privileges on launch.

- MiqViq

Patrick Fergus

unread,
Aug 24, 2014, 3:13:28 PM8/24/14
to munk...@googlegroups.com
Some thoughts:

- Possibly some part of the pkgbuild process damages the xattrs or corrupts the thnusetup.sh and InitUsbServices.tool scripts themselves. If I remove the com.apple.cs.CodeRequirements, com.apple.cs.CodeSignature, and com.apple.cs.CodeDirectory (and com.apple.quarantine) xattrs from those scripts, Horizon Client reports "The file is invalid" and "Please download the official product." when trying to activate those services. Pretty reasonable to check for code signatures before executing a shell script with elevated privileges and refuse to run if the scripts aren't properly signed.

- Munki supports drag and drop installations, including postinstall_script-ing the USB sharing and printer redirection. Was there an additional reason beyond exploring getting those services running to repackage Horizon Client?

- Although Horizon Client asks for administrative privileges on launch, they're not required to use the application (although USB sharing and printer redirection features are not available). VMware is balancing between convenience (drag and drop installation that doesn't require admin rights) and extra features (USB sharing and printer redirection that does require admin rights) by asking for admin rights upon first launch.

- Patrick
________________________________________
From: munk...@googlegroups.com <munk...@googlegroups.com> on behalf of MiqViq <miq...@gmail.com>
Sent: Sunday, August 24, 2014 11:02 AM
To: munk...@googlegroups.com
Subject: Re: [munki-dev] Re: VMware Horizon View Client USB/Printing Services

Thanks,

I was doing some testing with the same postinstall actions with a custom created pkg.

I found out that repackaging the app (I was using pkgbuild) will break it somehow.
Probably pkgbuild strips some special permissions from the tools included inside app bundle...

So I guess the next test will be using Munki's copy_from_dmg and postinstall script.

It would be nice that VMware Horizon View Client would not ask admin privileges on launch.

- MiqViq

MiqViq

unread,
Aug 24, 2014, 3:29:37 PM8/24/14
to munk...@googlegroups.com

On 24.8.2014, at 22.13, Patrick Fergus <Patrick...@meredith.com> wrote:

> Some thoughts:
>
> - Possibly some part of the pkgbuild process damages the xattrs or corrupts the thnusetup.sh and InitUsbServices.tool scripts themselves. If I remove the com.apple.cs.CodeRequirements, com.apple.cs.CodeSignature, and com.apple.cs.CodeDirectory (and com.apple.quarantine) xattrs from those scripts, Horizon Client reports "The file is invalid" and "Please download the official product." when trying to activate those services. Pretty reasonable to check for code signatures before executing a shell script with elevated privileges and refuse to run if the scripts aren't properly signed.
>
Yes, this was my experience too when launching the app that was repackaged.


> - Munki supports drag and drop installations, including postinstall_script-ing the USB sharing and printer redirection. Was there an additional reason beyond exploring getting those services running to repackage Horizon Client?
>
Just testing some automated updating and packaging.
Users with deployment systems that require an installer pkg possibly could wrap the disk image within a custom pkg and duplicate the copy_from_dmg functionality in Munki with a postinstall script in pkg.


> - Although Horizon Client asks for administrative privileges on launch, they're not required to use the application (although USB sharing and printer redirection features are not available). VMware is balancing between convenience (drag and drop installation that doesn't require admin rights) and extra features (USB sharing and printer redirection that does require admin rights) by asking for admin rights upon first launch.
>
This is now sidetracking a little but I have to ask:
If I run those commands after install are admin rights still required when user launches the app for the first time?
If I run those commands after install are admin rights still required when user wants to use USB sharing or Printer redirect?

-MiqViq

> - Patrick
> ________________________________________
> From: munk...@googlegroups.com <munk...@googlegroups.com> on behalf of MiqViq <miq...@gmail.com>
> Sent: Sunday, August 24, 2014 11:02 AM
> To: munk...@googlegroups.com
> Subject: Re: [munki-dev] Re: VMware Horizon View Client USB/Printing Services
>
> Thanks,
>
> I was doing some testing with the same postinstall actions with a custom created pkg.
>
> I found out that repackaging the app (I was using pkgbuild) will break it somehow.
> Probably pkgbuild strips some special permissions from the tools included inside app bundle...
>
> So I guess the next test will be using Munki's copy_from_dmg and postinstall script.
>
> It would be nice that VMware Horizon View Client would not ask admin privileges on launch.
>
> - MiqViq
> This electronic message, including any attachments, may contain proprietary, confidential or privileged information for the sole use of the intended recipient(s). You are hereby notified that any unauthorized disclosure, copying, distribution, or use of this message is prohibited. If you have received this message in error, please immediately notify the sender by reply e-mail and delete it.
>

Patrick Fergus

unread,
Aug 24, 2014, 4:22:10 PM8/24/14
to munk...@googlegroups.com
>> - Although Horizon Client asks for administrative
>> privileges on launch, they're not required to use the
>> application (although USB sharing and printer redirection
>> features are not available). VMware is balancing between
>> convenience (drag and drop installation that doesn't
>> require admin rights) and extra features (USB sharing and
>> printer redirection that does require admin rights) by
>> asking for admin rights upon first launch.
>>
>This is now sidetracking a little but I have to ask: If I
>run those commands after install are admin rights still
>required when user launches the app for the first time?

In my testing if the thnusetup.sh and InitUsbServices.tool scripts are run as described in my earlier email, the admin password prompt does not appear.

> If I run those commands after install are admin rights
>still required when user wants to use USB sharing or
>Printer redirect?

In my testing the View Horizon GUI menu options for printing changes from "Start Printing Services" to "Printing Enabled" and from "Start Remote USB Services" to a list of options for handling USB devices. Unfortunately I was pulled away before I could test the functionality of either of these. Give a Munki copy_from_dmg + postinstall_script (from my earlier email) a try and reply with your testing results.

> Just testing some automated updating and packaging. Users
> with deployment systems that require an installer pkg
> possibly could wrap the disk image within a custom pkg and
> duplicate the copy_from_dmg functionality in Munki with a
> postinstall script in pkg.

Assuming the testing above is successful, other deployment systems (assuming they could handle a pkg) would probably be best served with a payload-free pkg that runs the thnusetup.sh and InitUsbServices.tool scripts after the Horizon View pkg is installed.

- Patrick
________________________________________
From: munk...@googlegroups.com <munk...@googlegroups.com> on behalf of MiqViq <miq...@gmail.com>
Sent: Sunday, August 24, 2014 2:30 PM
To: munk...@googlegroups.com
Subject: Re: [munki-dev] Re: VMware Horizon View Client USB/Printing Services

On 24.8.2014, at 22.13, Patrick Fergus <Patrick...@meredith.com> wrote:

> Some thoughts:
>
> - Possibly some part of the pkgbuild process damages the xattrs or corrupts the thnusetup.sh and InitUsbServices.tool scripts themselves. If I remove the com.apple.cs.CodeRequirements, com.apple.cs.CodeSignature, and com.apple.cs.CodeDirectory (and com.apple.quarantine) xattrs from those scripts, Horizon Client reports "The file is invalid" and "Please download the official product." when trying to activate those services. Pretty reasonable to check for code signatures before executing a shell script with elevated privileges and refuse to run if the scripts aren't properly signed.
>
Yes, this was my experience too when launching the app that was repackaged.


> - Munki supports drag and drop installations, including postinstall_script-ing the USB sharing and printer redirection. Was there an additional reason beyond exploring getting those services running to repackage Horizon Client?
>
Just testing some automated updating and packaging.
Users with deployment systems that require an installer pkg possibly could wrap the disk image within a custom pkg and duplicate the copy_from_dmg functionality in Munki with a postinstall script in pkg.


> - Although Horizon Client asks for administrative privileges on launch, they're not required to use the application (although USB sharing and printer redirection features are not available). VMware is balancing between convenience (drag and drop installation that doesn't require admin rights) and extra features (USB sharing and printer redirection that does require admin rights) by asking for admin rights upon first launch.
>
This is now sidetracking a little but I have to ask:
If I run those commands after install are admin rights still required when user launches the app for the first time?
If I run those commands after install are admin rights still required when user wants to use USB sharing or Printer redirect?

-MiqViq

MiqViq

unread,
Aug 25, 2014, 12:51:10 AM8/25/14
to munk...@googlegroups.com
Thanks for your valuable info.

I will do some testing of my own and report the results in a few days.

- MiqViq
Reply all
Reply to author
Forward
0 new messages