Skip to content

Scheduling GUI Apps

stagrlee edited this page Jan 13, 2013 · 7 revisions

Background

The standard way of managing windows apps with Rundeck is to invoke jobs over Windows Remote Management or "WinRM". Lots of rundeck users use WinRM with great success. Issues have come up with the approach on later patch releases of Windows 2008, Vista, 7, and Windows 8 due to Session 0 Isolation as jobs that require GUI interactivity or devices traditionally managed by the graphics system of Windows will fail when starting. This problem is effecting newer style cloud applications that leverage the amazing processing capability of the graphics cards. This Isolation issue will also effect automated jobs using powershell to automate GUI applications through the COM programmatic interface.

Solution Overview

There are several approaches to working around Session 0 Isolation posted in numerous blogs. This solution uses Rundeck installed locally on the Windows machine to manage (start/stop/status) the Windows application suffering from Session 0 isolation. A typical topology would implement a spoke and hub command distribution model where the local Windows Rundeck installation will be a spoke to central (hub) enterprise workflow Rundeck server(s). The hub Rundeck workflows would access the remote Rundeck installs through the Rundeck REST APIs. The Windows machine is configured to automatically login at bootup so that the graphics and GUI subsystem of windows are available to rundeck jobs.

Implementation

At time of writting this, no native windows packaging exists for Rundeck so setup for this solution will take some time. The outline is as follows

  1. Install Powershell if it isn't there already
  2. Install the Java Runtime Environment (JRE)
  3. Install the Rundeck launcher jar to $HOME/Documents/rerun
  4. Create a sheduled task to run Rundeck at login
  5. Create a test powershell script
  6. Set machine to auto login
  7. Create Rundeck job to invoke test powershell script
  8. Create firewall rule to open Rundeck's port 4440
  9. Optional setup
  10. Test solution

Install Powershell

This solution was developed on Windows 8 largely because the scheduling and configuration of Windows 8 is more complex than prior versions of Windows due to the inclusion of the tile based start screen (Metro) user interface. Windows 8 and Windows Server 2012 comes with Powershell 3.0. Older versions of Windows can install Windows Management Framework which will include either Powershell 3.0 or PowerShell 2.0. Either version should work.

PowerShell 3.0 with WMF Windows Management Framework 2.0

Workflow

Use the