I'm currently running a group of c3.large Windows Server 2012 instances on Amazon EC2.

The project we're working on is a little different, we have a Node.js script running that periodically polls for jobs via a messaging queue. Each job opens a .jar file to open a user interface on the windows desktop. Our .jar file then performs a series of actions (which involves taking screenshots of the current window), terminates, then the Node.js uploads the results to MongoDb and Amazon S3. The Java application (.jar) requires a desktop session to be active in order to function properly (so I don't think a Service would be much use) - kind of like how automated UI testing would require an active desktop.

The infrastructure works great! However, one big issue is the desktop environment. Upon launching a new instance via the EC2 management console, the desktop environment doesn't exist until I manually start a remote desktop connection from my local machine (thus creating the desktop for our software to run). This isn't practical for scalability reasons, ideally I would like to be able to programatically start/stop instances according to demand.

I've tried a number of things; including <powershell> commands in the EC2 user-data, using a VNC server and tweaked a couple of settings within the Windows machine itself... all to no avail.

Does anybody know of a technique/setting where by a desktop environment is created upon launch of an EC2 Windows Server 2012 instance?


You should be able to configure the machine for automatic logon. The console session will then be logged in with the credentials you specify each time the machine boots.

See Launching multiple ec2 windows servers with auto logon from a custom AMI for an example of how to configure such a thing. Basically, you are just using the Auto logon registry values, but with some workarounds to use them while still syspreping a host.

  • Thanks! I did try auto login registry vars, but that didn't work. But with any luck, the additional setup might work. Jan 26 '14 at 21:35
  • Worked with excellent results! Thank you for the heads up! Jan 26 '14 at 23:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.