You must add Windows registry entries on each Horizon desktop virtual machine where you want Horizon to run a start session script.
Prerequisites
- Verify that the path where you configured your start session scripts is accessible only to the SYSTEM account and local administrators. For more information, see Best Practices for Using Start Session Scripts.
- Make sure your start session scripts run quickly. If you set the
WaitScriptsOnStartSessionvalue in the Windows registry, your start session script must finish running before Horizon Agent can respond to the StartSession message that the connection broker sends. For more information, see Best Practices for Using Start Session Scripts.
Procedure
-
Log in to the Omnissa Horizon 8 desktop virtual machine.
-
At the command prompt, type
regeditto start the Windows Registry Editor. -
In the registry, navigate to
HKLM\SOFTWARE\Omnissa\Horizon\ScriptEvents. -
Add the path to the start session script to the registry.
-
In the navigation area, right-click
ScriptEvents, select New > Key, and create a key namedStartSession. -
In the navigation area, right-click
StartSession, select New > String Value, and create a string value that identifies the start session script to run, for example,SampleScript.To run more than one start session script, create a string value entry for each script under the
StartSessionkey. You cannot specify the order in which these scripts run. If the scripts must run in a particular order, invoke them from a single control script. -
In the topic area, right-click the entry for the new string value and select Modify.
-
In the Value data text box, type the command line that invokes the start session script and click OK.
Type the full path of the start session script and any files that it requires.
-
-
Add and activate a start session value in the registry.
-
Navigate to
HKLM\SOFTWARE\Omnissa\Horizon\Agent\Configuration. -
If the
Configurationkey does not exist, right-click Agent, select New > Key, and create the key. -
In the navigation area, right-click
Configuration, select New > DWORD (32 bit) Value, and typeRunScriptsOnStartSession. -
In the topic area, right-click the entry for the new DWORD value and select Modify.
-
In the Value data text box, type 1 to activate start session scripting and click OK.
You can type 0 to deactivate this feature. The default value is 0.
-
To delay the StartSession response by Horizon Agent, add a second DWORD value to the
Configurationkey calledWaitScriptsOnStartSession.A
WaitScriptsOnStartSessiondata value of 1 causes Horizon Agent to delay sending a StartSession response and fail if the scripts do not complete. A value of 0 means that Horizon Agent does not wait for the scripts to complete or check script exit codes before sending the StartSession response. The default value is 0.
-
-
Set a registry value to specify timeout values in seconds rather than minutes to prevent scripts from timing out.
Setting this timeout value in seconds allows you to configure the View Script Host service timeout value in seconds. For example, if you set the View Script Host service timeout to 30 seconds, you can ensure that a start session script either finishes running or times out before a connection broker timeout occurs.
-
Navigate to
HKLM\SOFTWARE\Omnissa\Horizon\ScriptEvents. -
Add a DWORD value called
TimeoutsInMinutes. -
Set a data value of 0.
-
-
To activate the View Script Host service to time out the start session script, set a timeout value.
-
Navigate to
HKLM\SOFTWARE\Omnissa\Horizon\ScriptEvents\StartSession. -
In the topic area, right-click the
Default (@)key and select Modify. -
In the Value data text box, type the timeout value and click OK.
A value of 0 means that no timeout is set.
-
-
Exit the Registry Editor and restart the system.
Was this page helpful?