Using commands, scripts, and the Virtual Browser

You can use Manual shortcuts and lab actions to allow lab end users to execute commands or scripts in their Skytap environment or access resources through the Course Manager Virtual Browser. You can use lifecycle scripts to allow Course Manager to execute a script in a lab end user’s Skytap environment when it is provisioned or torn down.

Contents

Using command shortcuts and actions

Use a command Manual shortcut or lab action to allow lab end users to execute an interactive or system command in their VM by clicking a shortcut or action in the Learning Console. Commands can be used to open a file in a VM, run an application in a VM, or check the state of a VM to confirm that a user has performed specific tasks. You can block lab end users from moving forward in a Manual until they execute or successfully execute a command.

Notes

  • For lab end users to be able to execute interactive commands in a VM in their Skytap environment:
    • The CMHelper app must be installed on the VM.

      For more information about installing CMHelper, see Installing CMHelper on a VM.

    • The VM must be connected to an automatic network, and outbound Internet access must be enabled in the environment.

      For more information about creating Skytap templates for lab environments, see Preparing a template.

  • For lab end users to be able to execute system commands in a VM in their Skytap environment:
    • The CMSysHelper app must be installed on the VM.

      For more information about installing CMSysHelper, see Installing CMSysHelper on a VM.

    • The VM must be connected to an automatic network, and outbound Internet access must be enabled in the environment.

      For more information about creating Skytap templates for lab environments, see Preparing a template.

  • You can prevent lab end users from clicking command shortcuts and actions if the required CMHelper or CMSysHelper isn’t available by enabling CMHelper and CMSysHelper presence tracking. This setting can be enabled by default using your account settings or for an individual course, event, or on-demand lab using Course Manager tags. CMHelper and CMSysHelper presence tracking should be enabled only if:
    • CMHelper version 1.1.9 or newer is in use for interactive commands.
    • CMSysHelper version 1.0.2 or newer is in use for system commands.
  • CMHelper version 1.1.9 or newer and CMSysHelper version 1.0.2 or newer keep VMs active while commands are running.
  • When a lab end user interacts with command shortcuts and actions, Course Manager displays this activity on the lab end user’s Activity page, the event Activity Summary page, and Course Manager reports.

Choosing between interactive and system commands

Interactive commands
  • Can be executed only by lab end users who are signed in to the target VM.
  • Can interact with a user session in the target VM.
  • Can be executed only when the CMHelper app is running on the target VM. CMHelper runs as a process in a user session, with the privileges of that user.
  • Can’t be executed in VMs that don’t have a graphical user interface.
System commands
  • Can be executed by lab end users regardless of whether they are signed in to the target VM.
  • Can’t interact with a user session in the target VM.
  • Can be executed only when the CMSysHelper app is running on the target VM. CMSysHelper runs as an OS service, with privileges at the system level.
  • Can be executed in VMs regardless of whether they have a graphical user interface.

Using script shortcuts, script actions, and lifecycle scripts

Use scripts to make changes to an end user’s Skytap environment, check the state of a VM in an environment to confirm that a user has performed specific tasks, or provision or tear down remote resources in another cloud. Scripts can access metadata attributes that apply to an end user through the Course Manager control endpoint. Scripts are executed in the Course Manager Script Host VM, and Course Manager automatically adds this VM to a lab end user’s Skytap environment when the VM is needed. You can configure settings related to the Script Host. Once you add script packages to a course, you can add script shortcuts, script actions, and lifecycle scripts to the course.

Script settings

You can configure two settings related to Script Host consumption control:

  • Script Host RAM and vCPU settings – Set the RAM and vCPUs for Script Host VMs that are automatically added to environments by Course Manager.
  • Script Host idle suspend – Automatically suspend Script Host VMs that have been idle for a period of time.

    Script Host idle suspend can be enabled by default using your account settings or for an individual course, event, or on-demand lab using Course Manager tags.

Script shortcuts, script actions, and lifecycle scripts

Once you add at least one script package to a course, you can add the following to the course:

  • Script Manual shortcuts – Allow lab end users to execute scripts by clicking a Manual shortcut in the Learning Console. You can block lab end users from moving forward in a Manual until they execute or successfully execute a script.

    Notes

  • Script lab actions – Allow lab end users to execute scripts by clicking a lab action in the Learning Console.

    Notes

  • Lifecycle scripts – Allow Course Manager to execute a script when a lab end user’s Skytap environment is provisioned or torn down.

    Notes

    • You can only add lifecycle scripts to Lab courses (the term Lab in the Course Manager interface is configurable for your account and may be replaced by another term such as Demo).
    • For more information about adding lifecycle scripts to a course, see Adding lifecycle scripts to a course.

Script Host automatic provisioning

  • When a course contains script Manual shortcuts, script lab actions, or lifecycle scripts and a lab environment is provisioned from the course, Course Manager automatically adds the Script Host VM to the end user’s environment based on the following guidelines:
    • If the course contains a provision lifecycle script, script Manual shortcuts, or script lab actions, Course Manager adds the Script Host to the end user’s environment during the provision process.

      If the course contains a provision lifecycle script but no script Manual shortcuts or lab actions, Course Manager removes the Script Host from the environment after the provision script is executed.

    • If the course contains a teardown lifecycle script and the end user’s environment doesn’t contain the Script Host at teardown, Course Manager adds the Script Host during the teardown process.
    • If the course contains script Manual shortcuts or script lab actions and the end user’s environment is reprovisioned, Course Manager adds the Script Host to the environment during the reprovision process.
    • If the end user executes a script Manual shortcut or script lab action and the Script Host isn’t present in their environment, Course Manager automatically adds it.
  • When Course Manager automatically adds the Script Host VM to a lab environment:
    • It uses the Script Host from the newest Script Host VM template in the Skytap public template library that is in the same region as the end user’s environment.

      Course Manager sets the RAM and vCPUs for the Script Host VM to the values specified in your account settings.

    • It ensures the Script Host is connected to an automatic network.

      Scripts can be executed in a lab end user’s Skytap environment only if outbound Internet access is enabled in the environment. For more information about creating Skytap templates for lab environments, see Preparing a template.

    • It excludes the Script Host VM from the end user’s Skytap sharing portal.
    • It places script packages that have been added to the course in the Script Host VM when it is first booted.

      If a script package is updated in the course, Course Manager automatically retrieves the updated version when the script is executed in the lab end user’s environment.

  • Course Manager automatically starts the Script Host VM if a script is executed when the Script Host isn’t available. Therefore, lab end users can click script shortcuts and script actions if the Script Host isn’t available, regardless of whether CMHelper and CMSysHelper presence tracking is enabled.

Using Virtual Browser shortcuts and actions

Use a Virtual Browser Manual shortcut or lab action to allow lab end users to access a resource through a browser, SSH, or VNC connection in the Course Manager Virtual Browser by clicking a shortcut or action in the Learning Console. Each Virtual Browser shortcut or action provides access to a specific destination through a URL, hostname, or IP address.

Notes

  • You can add a Virtual Browser Manual shortcut or lab action only if the Virtual Browser is enabled in your account settings.
  • For a lab end user to be able to use Virtual Browser shortcuts and actions:
    • The user’s Skytap environment must contain the Virtual Browser VM.

      You can find the Virtual Browser VM template in the Skytap public template library.

    • The Virtual Browser VM must be connected to an automatic network, and outbound Internet access must be enabled in the environment.

      For more information about creating Skytap templates for lab environments, see Preparing a template.

    • The name of the Virtual Browser VM in the user’s Skytap environment must contain the Virtual Browser VM name specified in your Course Manager account settings.

  • You can prevent lab end users from clicking Virtual Browser shortcuts and actions if the Virtual Browser isn’t available by enabling CMHelper and CMSysHelper presence tracking. This setting can be enabled by default using your account settings or for an individual course, event, or on-demand lab using Course Manager tags. CMHelper and CMSysHelper presence tracking should be enabled only if:
    • CMHelper version 1.1.9 or newer is in use for interactive commands.
    • CMSysHelper version 1.0.2 or newer is in use for system commands.
  • When a lab end user interacts with Virtual Browser shortcuts and actions, Course Manager displays this activity on the lab end user’s Activity page, the event Activity Summary page, and Course Manager reports.