Share This Post

Installing VMware View Agent in a Task Sequence

The VMware View agent is deployable as an MSI file and uses basic command line parameters.  However, I recently had significant difficulties with getting it to install within a ConfigMgr Task Sequence as part of an OS image deployment.  Despite that the agent could be installed manually using the parameters, in a TS the installer would fail (e.g. return a non-success exit code) and thus fail the TS.

Through investigation, the agent’s install log file (located in %windir%\temp\) stated error 1603 and a message that if failed due to a detected pending restart.  So in the TS, I added a pre-restart command prior to the install…..but that still did not solve the problem.  Several various other solutions were attempted, but all to no avail.

Eventually I found a VMware KB article which outlined the issue.  It was being caused by multiple registry keys – FileRenameOperations, Run, and RunOnce.  So I created  a quick batch script to

  1. Backup the reg keys to %windir%\temp
  2. Delete the reg keys
  3. Run the install
  4. Restore the reg keys
:: Backup problem registry keys for VMware Agent Install
reg.exe EXPORT "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" c:\windows\temp\hklmsession.reg /y
reg.exe EXPORT "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" c:\windows\temp\hklmrun.reg /y
reg.exe EXPORT "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" c:\windows\temp\hklmrunonce.reg /y

:: Delete problematic registry keys
reg.exe DELETE "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v PendingFileRenameOperations /f
reg.exe DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /va /f
reg.exe DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /va /f

:: Install VMware agent
xcopy "%~dp0VMware-viewagent-x86_64-5.0.1-640055.exe" c:\windows\temp /y
c:\windows\temp\VMware-viewagent-x86_64-5.0.1-640055.exe /s /v" /qn REBOOT=R"

:: Restore registry keys
reg.exe IMPORT c:\windows\temp\hklmsession.reg
reg.exe IMPORT c:\windows\temp\hklmrun.reg
reg.exe IMPORT c:\windows\temp\hklmrunonce.reg

del c:\windows\temp\hklm*.reg
exit

However, this still wasn’t good enough to solve the problem! The .msi needed to be copied locally to execute AND this needed to be run with 64-bit redirection disabled.  It was a mess to figure out and test, but I was able to eventually discover the right combination to have the agent automatically in a Task Sequence!

vmware_view_agent

Filed under: ConfigMgr 12, Scripting, Troubleshooting

Share This Post

Hello and thanks for reading my blog (http://t3chn1ck.wordpress.com)! My hope is that information I post is useful to others! If you found that a solution did help you, or if you have questions, feel free to drop a comment on the post. I primarily blog on my IT experiences with ConfigMgr and desktop engineering. I am a 10 year, seasoned professional with ConfigMgr and systems management. I co-facilitate and present for the local user group in Denver, am an active blogger on topics for ConfigMgr and systems management techniques, involved in forums for Microsoft and MyITForum, and have been a speaker for events such as BDNA's SCCM Guru Webcast Series (March 2012), the Microsoft Management Summit (April 2013), and BDNA's Microsoft Master Webcast Series (Jan. 2014).

2 Comments

  1. This process did not work with the 5.1.2 client. It failed to redirect the disposable files: “View Composer agent initialization state error (9): Failed to relocate disposable (waited 0 seconds)”. I finally traced the problem to the HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerBootExecute key. The agent install adds “SysWOW64vmware-svi-nga.exe” to the string, which is then erased by the restore of the Session Manager key.

    I used the following process to fix the issue:
    – Extracted the .msi using the /a switch (probably unnecessary).
    – Split the .bat file in two with a reboot between them.
    – Modified the process to only backup and restore PendingFileRenameOperations instead of the whold Session Manager subtree.

    Install.bat:
    powershell start-sleep -s 60

    :: Backup problem registry keys for VMware Agent Install
    powershell (get-itemproperty -Path ‘Registry::HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession Manager’ -Name PendingFileRenameOperations).PendingFileRenameOperations > c:windowstempPendingFileRenameOperations.txt
    reg.exe EXPORT “HKLMSYSTEMCurrentControlSetControlSession Manager” c:windowstemphklmsession.reg /y
    reg.exe EXPORT “HKLMSOFTWAREMicrosoftWindowsCurrentVersionRun” c:windowstemphklmrun.reg /y
    reg.exe EXPORT “HKLMSOFTWAREMicrosoftWindowsCurrentVersionRunOnce” c:windowstemphklmrunonce.reg /y

    :: Delete problematic registry keys
    reg.exe ADD “HKLMSYSTEMCurrentControlSetControlSession Manager” /v PendingFileRenameOperations /t REG_MULTI_SZ /d /f
    reg.exe DELETE “HKLMSOFTWAREMicrosoftWindowsCurrentVersionRun” /va /f
    reg.exe DELETE “HKLMSOFTWAREMicrosoftWindowsCurrentVersionRunOnce” /va /f

    :: Install VMware agent
    msiexec.exe /qb-! REBOOT=ReallySuppress /i “%~dp0VMware View Agent64.msi” /l*v c:windowstempvmviewagent.log

    Cleanup.bat:
    powershell start-sleep -s 60

    :: Restore registry keys
    powershell set-itemproperty -Path ‘Registry::HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession Manager’ -Name PendingFileRenameOperations -Value (get-content c:windowsTempPendingFileRenameOperations.txt)
    reg.exe IMPORT c:windowstemphklmrun.reg
    reg.exe IMPORT c:windowstemphklmrunonce.reg

    del c:windowstemphklm*.reg
    del c:windowstempvmviewagent.log
    del c:windowstempPendingFileRenameOperations.txt

    • The script works! Thank you for the post.

Leave a Reply