Originally posted on: http://geekswithblogs.net/DougMoore/archive/2015/10/11/set-up-a-virtual-test-device-wec7-or-wec2013-on.aspx
The following links from Microsoft are close but not currently up-to-date with respect to Hyper-V and getting set up on a Windows 10 host computer / development system.
Set Up a Virtual Test Device (Compact 2013)
Use the Sample Virtual Device (Compact 2013)
Use Hyper-V to create a virtual machine (Compact 2013)
This blog entry will contain a short, concise, list of steps to set everything up on your development system.
Starting with the information contained in the links above, from Microsoft, and adding the information I found at Windows 10 Forum:
Hyper-V virtualization - Setup and Use in Windows 10
Below is a complete summary of the steps involved.
Turn on Hyper-V
1. Control Panel, Programs and Features, Turn Windows features on or off
2. Check Hyper-V (includes Hyper-V Management Tools and Hyper-V Platform)
3. Click OK
4. Hyper-V will install and you will be prompted to restart system.
5. Close all programs and restart system.
With the next steps we will be creating a single VM named CEPC.
This VM will be mounting the sample virtual hard disk supplied with the CEPC BSP found in Windows Embedded Compact 7.
There is a known issue with the sample virtual hard disk supplied with the CEPC BSP found in Windows Embedded Compact 2013, the bootloader settings cannot be saved.
This issue may be resolved in a future WEC2013 QFE but, in the meantime, the work around is to use the WEC7 sample virtual hard disk, with its CEPC bootloader, for loading and running and debugging both, WEC7 and WEC2013, OS images.
Since this one CEPC VM will end up working with both OS, WEC7 and WEC2013, there really is no reason for creating VMs with OS specific naming, a VM simply named CEPC will do.
The first thing we need to do is stage the CEPC sample virtual hard disk in our Hyper-V working directory.
We don’t want to use the sample virtual hard disk where it lives just in case Microsoft updates it in a future QFE.
The virtual hard disk file will be modified as we run the VM and use the file so we want to make ourselves a copy first, and use that copy.
For this exercise I will be using “C:\Virtual Machines\CEPC” as my base directory for this setup, but you can choose any location that suits you, just be consistent when using it as you follow the procedures below.
Stage Sample CEPC Virtual Hard Disk
1. Copy contents of folder:
WINCE700\platform\VirtualPC\VM
to:
C:\Virtual Machines\CEPC
a. Cevm.vmc
b. hd0_sample.vhd
c. vpc_bootce.vfd
Create Virtual Machine
1. Hyper-V Manager, New, Virtual Machine…
2. New Virtual Machine Wizard
a. Specify Name and Location:
i. Name: CEPC
(This one VM will work with WEC7 and WEC2013 so there is really no good reason for creating VM with OS specific naming.)
ii. Store the virtual machine in a different location: C:\Hyper-V
b. Specify Generation: Generation 1
(Do not select Generation 2 or you will not be able to select the CEPC sample virtual hard disk, which is of type VHD. Only VHDX virtual hard disk types are allowed to be used with Generation 2 Hyper-V VM.)
c. Assign Memory: Startup memory: 512 MB, Use Dynamic Memory for this virtual machine.
(Use of Dynamic Memory is required else WEC OS launch will fail.)
d. Configure Networking (skip, click Next, will set up later)
e. Create Virtual Hard Disk: Use an existing virtual hard disk: C:\Virtual Machines\CEPC\hd0_sample.vhd
f. Finish
If you run the CEPC VM at this point in the setup process you will see the bootloader prompting, and counting down, “Hit space to enter configuration menu 5…”, 4, 3, 2, 1.
Hit the space bar during these prompts to enter the bootloader menu.
If you hit 1 for, [1] Show Current Settings, you will see that Main: Boot source and KITL device both list “(NULL)” for their current values.
We need to create a virtual switch and set up the Legacy Network Adapter in our CEPC VM Settings in order to get the bootloader happy with its network adapter.
Create Virtual Switch
1. Hyper-V Manager, Virtual Switch Manager…
2. New virtual network switch, External, Create Virtual Switch
3. Name: SharedNetwork
4. External network: Intel(R) 82579LM Gigabit Network Connection
(or the wired network adapter found on your development system that has DHCP access)
5. Allow management operating system to share this network adapter
6. OK
7. Yes @ Pending change may disrupt network connectivity
Create Legacy Network Adapter in CEPC VM Settings
1. Hyper-V Manager, CEPC, Settings…
2. Select, Network Adapter (Not connected), in the Hardware listing in the panel on right-hand side of the Settings dialog
3. Click on the Remove button
(To, “Use a legacy network adapter instead of this network adapter to perform a network-based installation of the guest operating system or when integration services are not installed in the guest operating system.”)
4. Apply
5. Select, Add Hardware, in the Hardware listing in the panel on the right-hand side of the Settings dialog
6. Select, Legacy Network Adapter, and click on the Add button
7. Virtual switch: SharedNetwork
8. OK
If you run the CEPC VM at this point in the setup process you will see the bootloader prompting, and counting down, “Hit space to enter configuration menu 5…”, 4, 3, 2, 1.
Hit the space bar during these prompts to enter the bootloader menu.
If you hit 1 for, [1] Show Current Settings, you will see that Main: Boot source and KITL device both list “DEC21140 at PCI bus 0 dev 10 fnc 0” for their current values.
Our CEPC VM bootloader is happy with its network adapter.
Load and Launch WEC OS Image
1. Hyper-V Manager, CEPC, Connect…
2. Start
3. If this is the first time you’ve run this VM, hit the space bar during “Hit space to enter configuration menu” prompts to enter the bootloader menu and verify, set up, and save the following bootloader settings, else skip to step 8.
4. [4] Network Settings, [1] Current Settings
Network:
KITL state: enabled
KITEL mode: interrupt
DHCP: enabled
IP Address: 0.0.0.0
VMINI: enabled
5. [0] Exit and Continue
6. [7] Save Settings
(Should see: Selection: 7, Current settings has been saved)
7. [0] Exit and Continue (to boot from Platform Builder)
8. Should see DHCP Discover Message attempts, followed by DHCP assigning an IP address, followed by “BOOTME” messages
9. From WEC7 or WEC2013 Platform Builder, OS Design based on the WEC CEPC BSP, sysgened and fully built into an OS image, Attach Device
10. Should see, PC-00155D01A407, or something like that, select and click Apply
11. Download of OS image from Platform Builder to CEPC VM target should commence immediately.
Now you can debug and develop your WEC drivers and applications on your host PC using Visual Studio and/or Platform Builder with the CEPC VM you created.