-->

06/07/2014

Windows Phone Emulator Issues

One of the coolest thing about emulators is "No need to own devices to test".
Thats what i thought before i tried new "Windows 8.1 Phone Emulator" in Visual studio 2013.

But with no of issues i encounter in executing an emulator, i decided better share a post with all different error and one single resolution for most of the issues.

Root Cause: Windows Phone emulator requires Hyper-V components to be up and running on your Windows 8.1 machine / Virtual machine. Find all the requirements from here.


Error 1:  
The Windows Phone Emulator wasn't able to ensure the virtual machine was running: 
Something happened while starting a virtual machine: 'Emulator WVGA 512MB.ttmaltiparmak' failed to start. (Virtual machine ID ) 
The Virtual Machine Management Service failed to start the virtual machine 'Emulator WVGA 512MB' because one of the Hyper-V components is not running (Virtual machine ID ).



Error 2: 

Unable to start the Windows Phone Emulator

Windows Phone Emulator requires Hyper-V. Your computer is missing the following pre-requisites required to run Hyper-V:

- Second Level Address Translation


Error 3: 
You tried to enable the Hyper-V Components to get rid of the issue and what you find is . . .

"Hyper-V Platform is Grayed Out / Disabled"



There are so many issues revolving around this kind of Hyper-V issues stopping Emulators.

Now before jumping to any other resolutions, just think of 2 factors.

1. Does your machine support Hyper-V?

So, either you are running Windows 8 / 8.1 straight on a Machine or a Virtual machine, the hosting machine should have Hyper-V enabled.

Simply check that in SYSTEMINFO command.

This shows that Hyper-V is not enabled. This doesn't means its not capable of Hyper-V.
To check the capability of machine to enable Hyper-V:
1. Download CoreInfo tool from this link.
2. Save "CoreInfo.exe" it to local memory say "c:\Temp".
3. Create a simple batch file name it Check.bat.
4. Add the below text to batch file content
              c:\temp\CoreInfo.exe -v
               pause
5. Execute this batch file as Administrator.

Here is the output:

Now Look at factors "HYPERVISOR",  "VMX", and "EPT". This says my machine supports all these but the "-" (hyphen) says they are not enabled.

If they are enabled , there will be a "*" instead of "-".

2. How can i enable Hyper-V on my Machine/VM?

Now coming to enabling it, i am working on a Virtual machine hosting Windows 8.1 hosted by a Macbook Pro 2.8 GHz Core i7 machine.

So i need to fix this from a virtual machine perspective.
If you are trying to enable the Hyper-V on a core machine, go to BIOS and enable it.

So i am stressing again, my next steps will be applicable to Virtual machines running WIndows 8.1.

Step1: 
Go to the virtual machine hostig files, and you will find .vmx files.
Add the below configuration to the file at the end in next line. Save the vmx file.

hypervisor.cpuid.v0="FALSE"




Step 2: 
Now open the memory settings of Virtual machine and enable Hyper-V extensions.

Step 3: 
Open the Advanced settings of virtual machine and select Hyper-V engine as  VT-X with EPT (This also called as SLAT).


 Step 4:
Start the VM and now execute the Check.bat we created earlier as an administrator.
and here is the output now.

Now you can see that both Hardware virtualisation and SLAT component of machine got enabled "*" symbol instead of "-". Only thing is to manually enable all "Hyper-V" components.

Step 5:
Go to windows features and now you can find that "Hyper-V Platform" wan enabled, so check that feature, save and restart the VM.


Verification:
 Once VM is started,  Open Visual Studio 2013 as Administrator, create a Windows Phone App and run the Simulator.

Hence we addressed couple of Hyper-V issues in running the Mobile simulator.
This is where real fun starts ! Have fun ! Happy Coding !

No comments:

Post a Comment