Running Windows Phone 8 emulator on Mac

Since a few days I’m running a mac computer for my work. Why? Because I do a lot of mobile development. I started out with Android phone development, but now I’m expanding my skillset more and more into the iOS/Mac world. This requires apple hardware, so I got a mac computer to work on.

A mac is a great piece of compution hardware, however it also provides me with new challenges. I am after all a .NET developer. .NET doesn’t really run on Mac, except with Mono. There’s no Visual Studio on Mac and there’s no Windows Phone 8 emulator on Mac.

The only alternative you have for running Visual Studio and tools like that, is installing Windows on a VMware or parallels virtual machine. A great solution, since modern Mac computers have a lot of processing power on board. My Macbook runs a Core i7 2.7Ghz with a boatload of memory, so it shouldn’t be much of a problem.

So far so good you might guess. Just run Windows inside a VM with Visual Studio and you’re good to go for Windows Phone development. I would be if I was still running VS2010 with Windows Phone 7. The new Windows Phone 8 SDK requires some very specific hardware. It runs inside a hyper-v image. Which means it’s essentially a virtualized piece of hardware.

Running a virtualized piece of hardware inside a virtualized piece of hardware. Sounds interesting, doesn’t it? In this blogpost I will explain how you can run the Windows Phone 8 emulator on a VMWare virtual machine.

Step 1: Configure the virtual machine

The first step in making Windows Phone 8 work on a virtual machine, is the virtual machine itself. I am using VMWare fusion for this. It’s a good piece of software, that actually integrates your Windows VM more or less into your mac environment. I kind of like that.

Create a new virtual machine and configure it as you normally would for Windows 8. After you have created the new virtual machine, install Windows 8 from a CD or in my case I installed it from a ISO file I got from my TechNet subscription.

When Windows 8 is installed on your virtual machine you need to shut it down to configure it for running Hyper-V.

After you shutdown the VM, go to the Virtual Machine > Settings menu. From the menu, select the General settings icon. This gets you to the general settings menu of the machine.

Schermafbeelding 2013 04 06 om 08 50 05

From the OS menu, select the Hyper-V (Unsupported) setting. You can find it under Microsoft Windows in the drop down menu. After you’ve done that, you can select the Show all button to get back to the settings overview.

When you’re back in the settings overview, select the Processors & Memory icon. Make sure you have 2 processor cores assigned to the machine. The Windows Phone 8 emulator uses two cores. If you have less cores configured for the Virtual Machine, you will end up getting errors when the emulator is booting. It simply won’t start.

While on the Processors & Memory settings screen you need to set up the virtual machine for the Intel VT-X/EPT instructions. This enables Windows to use SLAT (Second Level Adress Translation) inside the Virtual Machine. You can enable this setting by expanding the advanced section and ticking the Enable hyper visor applications inside the virtual machine.

Schermafbeelding 2013 04 06 om 08 52 35

That’s all that is needed to make the Windows Phone 8 emulator work inside the virtual machine.

Step 2: Install the tools

The final step in getting your Windows Phone 8 development environment setup, is to install the following tools:

  • Enable the Hyper-V feature in Windows 8
  • Install Visual Studio 2012
  • Install the Windows Phone 8 SDK

If you don’t have a separate Visual Studio license, you can also go straight for the Windows Phone 8 SDK. This includes an express edition of Visual Studio.

Conclusion

So there it is, the guide on how to get the Windows Phone 8 SDK running inside your virtual machine. To prove it actually works, here’s a screenshot of my desktop with the emulator running.

Schermafbeelding 2013 04 06 om 09 15 18