Windows Phone 8 SDK on a Virtual Machine with Working Emulator
m (Hamishwillee - Fix typo)
m (Croozeus - - →Final Words)
|Line 228:||Line 228:|
== Final Words ==
== Final Words ==
So, I hope you liked this guide. I tried to be as simple as possible, and to include as many
So, I hope you liked this guide. I tried to be as simple as possible, and to include as many as I could, because a picture does worth a thousand words. Feedback and comments are very welcome.
Revision as of 10:15, 7 November 2012
This article explains how to create a Windows 8 Virtual Machine and install Windows Phone 8 SDK. It also explains how to enable Hyper-V and Windows Phone 8 emulator.
Note: This is a community entry in the Windows Phone 8 Wiki Competition 2012Q4.
One of the prerequisites of using Windows Phone 8 SDK is a machine with Windows 8 Pro and Hyper-V capability. Also it needs to be a 64bit edition. If you cannot upgrade your Windows 7 or earlier machine to a Windows 8 Pro edition, but you do have the necessary Hardware, then this guide will show you how to do just that, using VMWare Workstation Trial and Windows 8 Enterprise Developer Evaluation. This of course also works if you have VMWare Workstation licensed and Windows 8 Pro or Enterprise license.
If you don't need to run the emulator, you don't need Windows 8 Pro or Enterprise. For instance, if you have a developer unlocked device to deploy, you can install the SDK and work on your App and test on your device. This article will focus on setting up the emulator, so I decided to use the Windows 8 Enterprise Developer Evaluation. You can, of course, use a Windows 8 Pro or Windows 8 Enterprise licensed version, as long as it is 64bit.
You can also use this article as a reference to install Windows Phone 8 SDK without the emulator on a Windows 8 VM. In that case you can skip the instructions on editing manually the .VMX file and the HYPER-V setup.
What will you need
- 64 bits host operating system (This article was done with a Windows 7 64 bits)
- Strongly recommend at least 8GB of RAM for the host machine so that you can assign 4GB to the Virtual Machine
- 30-40gb of free space. At the end of this article, you will have a Virtual Machine that will have about 15GB in size. Reserve at least some space for it to grow.
You will also need the following softwares:
- Download Coreinfo tool. It helps in checking if your computer is capable of running Windows 8 with Hyper-V or not. Run the steps described below in "First Check – Does my computer support Windows 8 and Hyper-V?" section before downloading the remaining softwares so that you don't lose time if your computer is not supported.
- Download Windows 8 Developer Evaluation from here (be sure to download the 64bits version): http://msdn.microsoft.com/en-us/evalcenter/jj554510.aspx . You will need to register with your Windows Live ID so that you can also get a key for the evaluation. It will grant you 90 days of evaluation.
- Go to http://www.vmware.com/ and register at their website. After registering, download a trial of VMWare Workstation 9 or higher. This will grant you a 30 days license.
- Download Windows Phone 8 SDK from here: http://dev.windowsphone.com/en-us/downloadsdk You can do this after installing the VM so that you can download the tool from within it.
First Check – Does my computer support Windows 8 and Hyper-V?
The first step is to check if your computer supports Windows 8 Hyper-V or not. If it does support, you will be able to Install VMWare Workstation and enable it on the VM. Assuming that you have already downloaded the Coreinfo tool, the next steps are:
- Open the command prompt by clicking on start -> type CMD, then right-click "Command Prompt" and Run as administrator
- Go to the folder where you downloaded the tool to and type "coreinfo.exe –v"
Coreinfo v3.1 - Dump information on system CPU and memory topology
Copyright (C) 2008-2012 Mark Russinovich
Sysinternals - www.sysinternals.com
Intel(R) Core(TM) i7-2620M CPU @ 2.70GHz
Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
HYPERVISOR - Hypervisor is present
VMX * Supports Intel hardware-assisted virtualization
EPT * Supports Intel extended page tables (SLAT)
If you have a SLAT enabled CPU, you can proceed with this guide. If not, you may consider upgrading your hardware.
Install VMWare Workstation 9
After downloading VMWare Workstaion 9, install it on your machine. It is a simple procedure and you only have to follow the wizard.
One of the steps in the installation is to add the key which you got from your trial. Please make sure to have it with you before proceeding further:
Finally you are ready to create your first Virtual Machine.
Create the Virtual Machine
The first step is to select the option to create a new Virtual Machine on this screen
On the next screen make sure you select the Custom (Advanced) option. This is the best way to create your VM so that you will have full control over the settings:
And when it comes to hardware compatibility, select the highest option:
The next step is very important where you need to select the option that you will install the OS later. Do not try to install Windows 8 now otherwise the setup will fail. This is because with the Evaluation edition you don't have a KEY and for some reason VMWare tries to create an automated setup file which, later on, Windows 8 setup will fail to recognize.
Give a name to your VM:
Configure the CPU:
And configure memory. I would recommend at least 4GB. My machine has 8GB. If you can’t use 4GB use as much as you can.
For "Network Type", use NAT, so that your VM will share your network connection, and this means to share also the Internet connection. It is crucial that your VM has access to the Internet otherwise you won't be able to install the SDK:
I left the default I/O controller selected:
And now it is time to create a new Virtual HD:
Again I left the default type selected:
And I recommend at least 60GB. It is better to reserve more if you can. Also I prefer to keep my VM on a single file:
I store my Virtual HD on a external USB 2.0 or 3.0 hard drive. I found that having the Virtual HD on a separate disk would increase a lot the performance:
The next step is to customize the hardware. This is very important because we will need to tweak some of the default values:
Make sure you select the option “Virtualize Intel VT-x/EPT or ARM-V/RVI”. This is required to be able to run HYPER-V on your virtual machine.
It is now time to make some changes to the Virtual Machine configuration file before proceeding. Exit VMWare before making this change. If you try to install HYPER-V before doing this step, chances are that you will have problems running it. So to ensure that everything goes smoothly, go to the folder where you created your Virtual Machine and find the file with extension .VMX. In my case it was “Windows 8 x64.vmx”. Edit the file and add the text marked in red (hypervisor.cpuid.v0 = ”FALSE”):
Save the file. That is it. You are ready for the next and final step. For that you need to start VMWare Workstation again.
Install Windows 8 Virtual Machine
On the CD/DVD select the Windows 8 Enterprise Developer Evaluation ISO you downloaded earlier (or that you will download now):
Run your VM and follow the setup instructions for Windows 8. Once you run the Windows 8 for the first time, you will be asked to customize it. Follow the wizard to the end and when you have finally access to your Windows 8 installation, open the desktop and select the "Install Tools" option for VMWare:
A Virtual DVD drive will be mounted and Windows 8 may show you a message on the upper right corner with a message. Select that message or open Explorer with the Windows Key + E and find the DVD drive. Run the VMWare setup:
After performing the above steps, restart the Virtual Machine.
When you get Windows 8 VM up and running again, open Control Panel and select the option “Turn Windows features on or off”:
Then select the HYPER-V options:
Your are all set. Next step is to install the SDK. Go to the download page mentioned at the beginning of this page and run it:
The setup will start. Follow the wizard:
After the installation is complete you will need to register your copy of the SDK. Just follow the link "Register online" and follow the necessary steps.
At the end of the registration, you will be provided with a Key. Copy that key, save it for future reference and future installations and use it on the Product Key box:
Now to create your first Windows Phone 8 Project
Now to test if everything is working properly, open Visual Studio 2012 express and create a new Windows Phone Project:
Select the Windows Phone 8 as a target:
And you will get a new project similar to this:
Press F5 or the Green arrow to run the project. The emulator will start to load. Be patient because the first time can take a few long seconds:
If your app take a bit to load, don’t worry. It is normal. Just give it a few more seconds and it will come up:
Congratulations. You now have a fully working Windows 8 with Windows Phone 8 SDK and Windows Phone 8 emulator up and running.
So, I hope you liked this guide. I tried to be as simple as possible, and to include as many screenshots as I could, because a picture does worth a thousand words. Feedback and comments are very welcome.