Windows Phone 8 Emulator in a Windows 8 VHD
This article explains how to setup a Windows Phone 8 emulator inside a Windows 8 virtual hard disk. This may be useful if you wish to try out the Windows Phone 8 SDK on a recent PC running Windows 7.
Article Metadata
Compatibility
Article
Overview
The Windows Phone 8 SDK cannot be installed and run directly in Windows 7. If you have a Windows 7 machine and don't want to upgrade to Windows 8 then it is possible (albeit unsupported) to boot Windows 8 onto the real hardware from an image in a virtual drive and still use the Emulator.
This article shows how!
Summary
First follow the instructions in Scott Hanselman's blog entry, which explain how to install and boot Windows 8 off a Virtual Hard Disk (VHD) - note that the instructions are written for the preview release, but do work for the release version of the Windows 8 with an ISO burned on a DVD (64-bit). On completion you can use both Windows 7 and Windows 8 Pro on the same PC as multiple boots at the startup. Other than a VHD file in your hard disk, there are no additional programs to be installed in your Windows 7. Most PCs bought in recent years have the capability to do so without adding memory or software.
The next step is to check if the hypervisor is enabled in Windows 8. In the Start screen, type Control to get to the Control Panel. Under Program and Features, click Turn Windows features on or off. If Hyper-V is not checked and is not greyed out, make sure it is checked. Restart the computer.
Download the Windows Phone 8 SDK and install it. Test the emulator with a quick app. Without a physical phone, this is a good way to kick some tires. The system I setup was on a Lenono IdeaPad Y570 (Intel Core i7) with Windows 7 64-bit Home Premium. Deleting the VHD and delete the boot entry with BCDEdit, you have your original system.


Contents
Hamishwillee - Subedited - thanks for this article
Hi Pengguang Wu
Thanks for competing in the competition. I have just subedited the article to improve the English and wiki style a little (to some extent this was personal taste). The most important change was the warning up the top - Microsoft explicitly don't support this use case so it is important to make that very clear to users "use at your own risk".
A couple of issues:
Thank you for this. I'm not sure it will suit everyone, but its good to describe the option as long as its limitations are documented.
Regards
Hamishhamishwillee 02:50, 8 November 2012 (EET)
Pengguang Wu - Reply to your comments
Hi Mamish,
To address your issues specifically;
- The entry is only for a subset of PCs capable of hyper-v in a client OS bought recently such as Windows 7 and for people who are comfortable with setting up multiple booting systems. It is not intended for everyone (neither are other articles). If you intend to upgrade to Win8, this entry does not apply. On the other hand, if you just want to kick tires, this entry shows one way to do it without additional monetary cost other than your curiosity and time. You do not have to sacrifice your current paid OS to do so. You can download a trial version of Windows 8 and try things out and I am sure if you can get any support in the first place. What I stated in the original version of the entry is that earlier version of the emulators(WP7) do not work inside a vm (tried myself and heard many times). I did not say this in a general term. When I got the WP8 sdk, I tried this and the emulator worked inside a Windows 8 VHD. Hence I entered this article. - The link in the article has very specific steps for setting up a Windows 8 VHD. I cannot do better than that. - If someone can setup a VHD, step2 is just a few clicks away. - The warning you added looks bizarre to me. The initial deployment is always slower if the emulator is not running yet. I have VS2010 and WP7 emulator in Win7. When I deployed a WP7 app (already in the store) in VS2012 to a WP8 emulator in two languages, I did not notice much difference. - I modified the sentence to use BCDEdit or similar programs for adding or removing boot entries. Again this depends on the comfort level of a person in dealing with command lines. - I do not know other way to run a Win8 VHD in a client OS. Other virtualization programs have different file extensions. I am just happy that the WP8 emulator works inside a Win8 VHD.
This is just an experiment with n=1. Thanks, PengguangPengguang Wu 17:53, 8 November 2012 (EET)
Pengguang Wu - Comment on Nokia editor's addition of warning
After coming back from a MS hackathon on Friday, I had to do a system restore due to some networking issues. After the restore, I retested the WP8 emulator. The emulator stayed in the initialization mode waiting for Godot. Closing the emulator caused errors similar to the ones the Admin editor of this site added. I still had the app from the hackathon but lost another one installed after the restore date. Repairing the SDK resolved the issue. If the sdk is damaged the emulator will not run properly regardless of the hardware. Ironic for a company spends so much doing reaching out to developers.Pengguang Wu 04:47, 11 November 2012 (EET)
Hamishwillee - Thanks for your clarification
Hi Pengguang
I do (and did) understand your points - I was offering some suggestions that would make this more "generally" useful - it is completely your choice not to do so. In line with that I've tidied this up to be more like your original intent.
With respect to the warning, the issue I was trying to convey is that Microsoft say the startup is even slower than you would expect for slower first time boot in this use case. As I don't know why they expect that I've removed that part of the warning (which isn't very helpful anyway). The warning is now accurate and simple.
I don't see why this is ironic. The Emulator is part of the SDK - if you break it I wouldn't expect it to work. Perhaps I'm missing something.
Thanks for taking the time to explain this for me. As I said, this certainly is an option for some users.
regards
Hamishhamishwillee 06:35, 13 November 2012 (EET)