Patrick Godwin's Blog-O-Rama!

Developers, developers, developers!

Poking around in the Windows 8 Simulator

Over the last few months, I’ve been playing around with some of the new WinRT/Metro Style APIs that are introduced in Windows 8 Developer Preview. The end to end developer experience resembles the one introduced with the Windows Phone 7 tools, including a tool for testing your code. One such tool is the “Simulator”

The Simulator is a tool that resembles the Windows Phone 7 Emulator, in both look and functionality:


It looks like a Windows Slate chassis, and includes emulation ability for touch gestures, mainly Pinch to Zoom and Rotate. While sideloading the App to debug on the local machine is fine and dandy, it’s nice to be able to test things like Orientation change and touch.

One thing that took me by surprise with the Simulator is in the way it functions. When using it, I expected a similar environment the Windows Phone 7 emulator, I was surprised. I opened up the Desktop “app” on the simulator, only to be greeted with this:


That’s a fully functioning version of my desktop… running inside of a simulator…. running on my desktop. Desk-ception? What on earth is going on here? There is no way we’re virtualizing a full instance of Windows just to test apps. So what is the simulator doing?

I decided to peek around, only to discover that the Simulator is creating a Remote Desktop Session on the local machine. It looks for some entries in HKEY_LOCAL_MACHINESoftwareMicrosoftWinSimulator (Or HKEY_LOCAL_MACHINESoftwareWow6432NodeMicrosoftWinSimulator if you’re on 64-Bit), namely the DWORD DisableChildSession. If that DWORD is set to 1, it will then look for the RemoteMachine value (string), UserName value (string), Domain (string), and the PathToPasswordFile value (string). Using these values, I’m sure you could point the simulator to another machine running Windows 8 for debugging.

It’s also worth noting that the Simulator has a dependency on WinRT. While it just appears to be a normal .NET Application, if you try to move it to any other versions of Windows, it will not run.

Go ahead and mess with those registry keys and see what kind of results you can get. I’m curious to see what the Beta build brings around CES. Perhaps there will be more goodies or secrets hidden.