Getting Started With Virtual CEPC
Getting Started With Virtual CEPC
Getting Started With Virtual CEPC
Abstract
OEMs often use a software development board (SDB) to evaluate Windows Embedded
Compact or to develop new Windows Embedded Compact-based applications. However,
to use an SDB for your development platform, you must invest in additional hardware,
install and configure development tools specific to your SDB, and connect the hardware
to your host computer for testing and debugging your application.
When you use Windows Embedded Compact 7, you have the alternative of running
Windows Embedded Compact in an emulated software development board environment
called a virtual CEPC (vCEPC). A vCEPC eliminates the hardware expense and
configuration overhead of physical hardware so that you can begin developing with
Windows Embedded Compact quickly and inexpensively. In addition, you can use a
vCEPC to create, save, and test different emulated x86 hardware configurations without
having to swap and configure hard disk drives, memory, display controllers, network
adapters, and sound cards.
This article shows you how to set up a vCEPC and use it to develop and run a simple
Windows Embedded Compact application. A companion article, Advanced Virtual CEPC
(http://go.microsoft.com/fwlink/?LinkID=206041), explains the advanced features of
Virtual CEPC.
© 2011 Microsoft
Getting Started with Virtual CEPC 2
Introduction
When you use a virtual CEPC (vCEPC) for Windows Embedded Compact-based
development, you use Windows Virtual PC to emulate a Windows Embedded Compact
x86-based hardware platform in a virtual machine environment on your development
computer. A vCEPC uses Virtual PC to emulate a standard x86 hardware board (CEPC)
on any host computer running Windows 7, Windows Vista, or Windows XP.
In brief, this is what you do to configure and use a vCEPC for application development:
1. Create a Windows Embedded Compact OS design that supports a vCEPC.
2. Configure Windows Virtual PC to run the vCEPC virtual machine.
3. Boot your Windows Embedded Compact OS image in Virtual PC.
4. Create a Platform Builder subproject for your application.
5. Use Platform Builder to start and run your application on your vCEPC.
This article explains this process in detail. When you complete this process, you will be
able to load and boot your OS image in a vCEPC virtual machine on your development
host computer and run your application in this virtual machine. You can interact with
the vCEPC in the same way that you would interact with a physical development board,
using the vCEPC to develop, test, and debug Windows Embedded Compact applications.
Prerequisites
Virtual CEPC requires the following minimum software configurations.
Windows 7
• Windows 7 Enterprise, Windows 7 Ultimate, or Windows 7 Professional
• Windows Virtual PC
• Microsoft Visual Studio 2008
• Windows Embedded Compact 7
© 2011 Microsoft
Getting Started with Virtual CEPC 3
• Platform Builder
• x86 Architecture
For more information about Windows Embedded development and Platform Builder, see
the article Integrated Development Environment Build Process
(http://go.microsoft.com/fwlink/?LinkId=178104).
© 2011 Microsoft
Getting Started with Virtual CEPC 4
2. On the Board Support Packages page, under Select one or more BSPs, choose
Virtual PC: x86, and then click Next.
3. On the Design Templates page, you customize your OS design by selecting a
design template that best approximates the characteristics of the physical device
you want to emulate. The Enterprise Handheld template is a good starting point
to use with your vCEPC. To create an OS design based on the Enterprise
Handheld template, expand Enterprise Device, select Handheld, and then click
Next.
4. When the OS Design Wizard presents the Applications and Media page, select any
additional applications or services that you want to include in your OS design, and
then click Next.
5. On the Networking and Communications page, expand Local Area Network
(LAN) and select Wired Local Area Network. Click Next.
6. When the OS Design Wizard presents the OS Design Project Wizard Complete
page, clear the Build the following configuration after I click Finish check box
(if it is selected) so that you can build the OS design in a later step. Click Finish.
7. Platform Builder may present you with a notification window that explains security
warnings that are associated with certain catalog items that are included in your OS
design. Click Acknowledge to indicate that you have read and fully understand
these warnings.
© 2011 Microsoft
Getting Started with Virtual CEPC 5
© 2011 Microsoft
Getting Started with Virtual CEPC 6
disk booting, see “Booting from Virtual Floppy Disk” in the companion article Advanced
Virtual CEPC.
Because the steps for configuring the VHD and virtual machine are different for
Windows Virtual PC (for Windows 7) and Virtual PC 2007 (for Windows Vista and
Windows XP), choose the appropriate set of instructions for your version of Virtual PC.
Virtual PC 2007
If your computer is running Windows Vista or Windows XP, you use Virtual PC 2007 to
run your vCEPC. To configure Virtual PC 2007 to run a vCEPC, you use the New Virtual
Machine Wizard to create a new virtual machine, and then configure this virtual
machine to use the VHD image included with Windows Embedded Compact.
To configure Virtual PC 2007 to run a vCEPC
1. If you have not already done so, download and install Virtual PC 2007
(http://go.microsoft.com/fwlink/?LinkId=186183).
2. Start Virtual PC 2007. The Virtual PC Console and the New Virtual Machine
Wizard appear.
3. If the New Virtual Machine Wizard does not appear, click the File menu of the
Virtual PC Console, and then select New Virtual Machine Wizard.
4. When the Welcome to the New Virtual Machine Wizard page appears, click
Next.
5. On the Options page, select Create a virtual machine, and then click Next.
6. On the Virtual Machine Name and Location page, in the Name and Location
box, type a name for your virtual machine file. If you restrict this name to sixteen
characters or fewer, you can reuse this name later when you name your Platform
Builder target device. In the following examples, we use “VCEPC” for the virtual
machine name. The virtual machine file is automatically saved to the My Virtual
Machines folder. To save it to a different location, use the Browse button. Click
Next.
7. On the Operating System page, click the Operating System menu and click
Other. Click Next.
8. On the Memory page, you can adjust the amount of RAM that the virtual machine
will use or accept the default size of 128 MB. To accept the default size, click Using
the recommended RAM. Click Next.
Before you can boot an OS on your virtual machine, you must add a new or existing
VHD image. A VHD image is a .vhd file that is stored on your physical hard disk. The
VHD typically contains a boot loader and may contain an OS, applications, and data files
used by a vCEPC.
To create a vCEPC virtual machine with a virtual hard disk
1. After you click Next in step 8 above, the New Virtual Machine Wizard displays
the Virtual Hard Disk Options page. Under Do you want to use, select An
existing virtual hard disk. Click Next.
© 2011 Microsoft
Getting Started with Virtual CEPC 7
2. On the Virtual Hard Disk Location page, the wizard asks you for the location of
the existing VHD image. Under Virtual hard disk location, click Browse and
navigate to the following location.
C:\WINCE700\Platform\VirtualPC\VM\hd0_sample.vhd
3. Click Next.
4. After the Completing the New Virtual Machine Wizard page provides you with a
summary of the attributes for your virtual machine, click Finish to close the New
Virtual Machine Wizard and create this virtual machine.
When the wizard creates your virtual machine, the Virtual PC Console dialog box
displays the name of your virtual machine followed by “Not running” as shown in this
figure.
For now, leave this console window open. A later section explains how to start and
connect this virtual machine to Platform Builder for the purpose of downloading your OS
design boot image into Virtual PC 2007.
Windows Virtual PC
If your computer is running Windows 7, you use Windows Virtual PC to run your vCEPC.
To configure Windows Virtual PC to run a vCEPC, you create a new virtual machine and
configure this virtual machine to use the vCEPC hard disk image included with Windows
Embedded Compact.
To configure Windows Virtual PC to run a vCEPC
1. If you have not already done so, download and install Windows Virtual PC
(http://go.microsoft.com/fwlink/?LinkId=186188).
2. Start Windows Virtual PC. When Windows Virtual PC starts, it opens and displays
your Virtual Machines folder.
© 2011 Microsoft
Getting Started with Virtual CEPC 8
3. On the menu bar of the Virtual Machines folder window, click Create virtual
machine.
4. In the Create a virtual machine wizard, on the Specify a name and location for
this virtual machine page, do the following:
a. Type a name for your virtual machine in the Name box. If you restrict this name
to sixteen characters or fewer, you can reuse this name later when you name
your Platform Builder target device. In the following examples, we use “VCEPC”
for the virtual machine name.
b. In the Location box, you can accept the default location for your virtual
machine file or click Browse to navigate to a different location. The default
location is the Virtual Machines folder, which is located at
C:\Users\<user name>\AppData\Local\Microsoft\Windows Virtual PC\Virtual
Machines
c. Click Next.
5. On the Specify memory and networking options page, you can adjust the
amount of RAM that the virtual machine will use or you can accept the default size
of 512 MB. To change the amount of memory, type the number of megabytes in the
RAM box. Leave the Use computer network connections checkbox selected
and click Next.
Note Before you can boot an OS on your virtual machine, you must add a new or
existing VHD image. A VHD image is a .vhd file that is stored on your physical hard
disk. The VHD typically contains a boot loader and may also contain an OS,
applications, and data files used by your vCEPC.
6. On the Add a virtual hard disk page, do the following:
a. Select Use an existing virtual hard disk.
b. In the Location box, type the following path. Alternately, you can click Browse,
navigate to this location, and then click Open.
C:\WINCE700\Platform\VirtualPC\VM\hd0_sample.vhd
c. Click Create. If you chose the name “VCEPC” for your virtual machine, the file
VCEPC.vmcx appears in the Virtual Machines folder.
A later section explains how to start and connect this virtual machine to Platform
Builder for the purpose of downloading your OS design boot image into Virtual PC.
© 2011 Microsoft
Getting Started with Virtual CEPC 9
You can use the configuration menu to select a different boot source, change network
settings, change display settings, or modify debug port settings. For more information
about the configuration menu, see “Modifying Configuration Settings” in the companion
article Advanced Virtual CEPC (http://go.microsoft.com/fwlink/?LinkID=206041).
© 2011 Microsoft
Getting Started with Virtual CEPC 10
If the boot loader displays an error message after the last configuration menu prompt,
(instead of “Send DHCP Discover Message …”) then your boot loader could be
configured incorrectly. See “Troubleshooting” later in this article for a description of this
problem and a way to solve it.
If your computer is not connected to a network with a DHCP server, the boot loader will
be unable to acquire an IP address for communication with Platform Builder (see “DHCP
Time-Out” later in this article). In this case, you can configure your vCEPC to connect to
Platform Builder and boot without a network. See “Using Virtual CEPC Without a
Network” in the companion article Advanced Virtual CEPC).
BOOTME Stage
After the boot loader acquires an IP address from a DHCP server, it transmits
“BOOTME” messages on the network (see Figure 5). The boot loader broadcasts these
messages in an attempt to connect to your Platform Builder session for downloading
your OS image. The boot loader displays a series of status messages on the console as
it sends BOOTME messages on the network. For example:
Send BOOTME Message (device name PC-0003FF17EB16, attempt 1)
Send BOOTME Message (device name PC-0003FF17EB16, attempt 2)
Each line reveals the unique device name of your vCEPC on the network. Look for
“device name” in the console output to find the device name of your vCEPC. In the
preceding example console output, the device name is “PC-0003FF17EB16.” When you
attach Platform Builder to your vCEPC, you use this device name to tell Platform Builder
how to connect to your vCEPC session (see the section “Download Your Boot Image to
Virtual PC” later in this article for more on this process).
© 2011 Microsoft
Getting Started with Virtual CEPC 11
© 2011 Microsoft
Getting Started with Virtual CEPC 12
The Ethernet Download Settings box initially appears as shown in the following
figure. While the Ethernet Download Settings box is displayed, Platform Builder
listens for BOOTME messages on the local network. As described earlier, these
messages are connection requests that the vCEPC boot loader broadcasts on the
network in an attempt to connect to Platform Builder.
When Platform Builder receives a BOOTME message from a Virtual CEPC boot loader, it
prints the device name of that vCEPC in the Ethernet Download Settings box (the
© 2011 Microsoft
Getting Started with Virtual CEPC 13
device name is also called the “Target device boot name”) as shown in the next figure.
The device name uniquely identifies a Platform Builder target device on the network. If
there are other Virtual CEPCs (or CEPCs) on your network, you may see multiple device
names appear in the Ethernet Download Settings box.
You will connect your vCEPC to Platform Builder by clicking the device name for your
vCEPC after it appears in this box. Leave the Target Device Connectivity Options
and Ethernet Download Settings dialog boxes open as you proceed through the
remaining steps.
© 2011 Microsoft
Getting Started with Virtual CEPC 14
After you start Virtual CEPC, the boot loader progresses through each of its boot stages
as described in the section “The Virtual CEPC Boot Loader.” If the boot loader halts with
an error message, see the “Troubleshooting” section later in this article for information
about how to resolve the error.
© 2011 Microsoft
Getting Started with Virtual CEPC 15
4. Click OK.
5. Double-click your virtual machine file (for example, VCEPC.vmcx) to restart the boot
loader in a new Windows Virtual PC console.
The selected device name becomes highlighted with a red background in the
Ethernet Download Settings window and the boot name appears under Target
device boot name as shown.
© 2011 Microsoft
Getting Started with Virtual CEPC 16
3. Click Apply. You have now set up a communications link between Platform Builder
and your vCEPC.
4. Click Close in the Target Device Connectivity dialog box.
1. In Visual Studio, select your vCEPC in the Device list. For example, if you named
your vCEPC “VCEPC”, you will see VCEPC in this list. Note that this name is not the
same as the “device name” that is manufactured and displayed by the boot loader.
2. In Visual Studio, click Target and click Attach Device to initiate the boot image
download to the Virtual PC.
3. Verify that the download has started. When Platform Builder downloads your boot
image to the boot loader running in Virtual PC, it reports download progress in a
Device Status window as shown this figure.
The boot loader in the Virtual PC console also provides download status. For
example, you will see a percentage complete indication on the Virtual PC console as
shown in the following figure.
© 2011 Microsoft
Getting Started with Virtual CEPC 17
When the OS image download finishes, the boot loader boots your image in the Virtual
PC window, displaying the Windows Embedded Compact desktop in the Virtual PC
console as shown in Figure 15. Now you can interact with Windows Embedded Compact
7 in a virtual machine running on your development computer.
© 2011 Microsoft
Getting Started with Virtual CEPC 18
© 2011 Microsoft
Getting Started with Virtual CEPC 19
© 2011 Microsoft
Getting Started with Virtual CEPC 20
After you successfully create and build your initial subproject, you can add functionality
to create your application.
#include "stdafx.h"
In the following steps, you will replace this code template with sample application code
that retrieves the boot name of your vCEPC and displays this boot name in a small
window on your vCEPC desktop.
To create the MyBootName sample application
1. In the Solution Explorer pane, expand the MyBootName subproject that you
created earlier.
2. Locate the Source files folder and expand it to reveal the source file
MyBootName.cpp as shown here:
© 2011 Microsoft
Getting Started with Virtual CEPC 21
3. Double-click MyBootName.cpp to open it, then replace the contents of this file
with the following code sample:
#include "stdafx.h"
RegisterClass(&wc);
© 2011 Microsoft
Getting Started with Virtual CEPC 22
switch (message)
{
case WM_PAINT:
SystemParametersInfo (SPI_GETBOOTMENAME,
sizeof(szBootName), szBootName, 0);
hdc = BeginPaint(hWnd, &ps);
RECT rt;
GetClientRect(hWnd, &rt);
DrawText(hdc, szBootName,
_tcslen(szBootName), &rt, DT_CENTER);
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
4. Click the File menu and click Save All to save your changes.
© 2011 Microsoft
Getting Started with Virtual CEPC 23
1. Locate and right-click the MyBootName subproject that you created earlier, then
click Build.
2. Verify that there are no build errors in the output display window. For example, the
output window should display the following messages:
C:\WINCE700\OSDesigns\VCEPC\VCEPC\MyBootName\sources - 0 error(s), 0 warning(s)
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
After you successfully create and build MyBootName.exe, you can start it and see it run
on your vCEPC desktop.
To run MyBootName.exe on your vCEPC
1. If your vCEPC is not already booted and connected to Platform Builder, follow the
steps in the section, “Download and Boot Your OS Image” to start your vCEPC and
prepare it for running your application.
2. Click the Target menu in Platform Builder and select Run Programs, then select
MyBootName.exe.
3. Verify that your application starts and runs successfully. When MyBootName runs
successfully, it prints the boot name of your vCEPC in a small window as shown
here:
To stop MyBootName, right-click Boot Name on the vCEPC task bar and select Close.
© 2011 Microsoft
Getting Started with Virtual CEPC 24
As shown here, the Release folder is a network share – Platform Builder exports this
share from your host computer. If you are using “VCEPC” for the name of your OS
design, Platform Builder exports the following path on your host computer to create the
Release network share:
C:\WINCE700\OSDesigns\VCEPC\VCEPC\RelDir\VirtualPC_x86_Release
On your vCEPC, this shared folder is available at the path:
\Release
Note that this Windows Embedded Compact path is not prefixed with a drive letter.
You can use this shared folder to transfer files to and from your vCEPC. For example,
you can copy media files into this folder for testing media applications on your vCEPC,
or you may have output files generated by your application that you want to transfer
back to your host computer for examination.
In the previous example, you started your application from the Target menu in
Platform Builder. You can also run your application from the vCEPC command prompt,
which includes \Release in its PATH environment variable.
To run MyBootName from the command prompt on your vCEPC
1. Click Start on your vCEPC desktop, click Programs, and then Command Prompt.
2. Type MyBootName at the command prompt and press Enter.
This command starts MyBootName.exe from the \Release path on your vCEPC. When
you build your application in Platform Builder, the build process copies the final
executable to the VirtualPC_x86_Release folder on your host computer; therefore, this
executable is also available in the \Release path on your vCEPC. When you start
MyBootName.exe on your vCEPC, you are actually starting MyBootName.exe from the
VirtualPC_x86_Release folder on your host computer.
Troubleshooting
The following sections provide solutions to common problems that you may experience
while trying to get your vCEPC to boot and connect to Platform Builder.
© 2011 Microsoft
Getting Started with Virtual CEPC 25
No Bootable OS Found
When the boot loader starts, it displays the following error message if it is unable to
find an OS image to boot:
ERROR: No bootable OS found!
*** Setting to lower power state ***
*** HALT ***
This error typically occurs when you use the VHD image provided with Windows
Embedded Compact (which does not contain an OS image) and your boot source is
configured as a boot drive rather than a network device.
To remedy this problem, use the following steps to configure your Virtual CEPC boot
loader to boot from the network device so that it can load your OS design image from
Platform Builder.
To configure the boot loader to use the network as the boot source
1. Reboot your Virtual CEPC.
2. When you see the configuration menu prompts appear on the Virtual PC console,
press the space bar to open the configuration menu.
3. The boot loader presents a Main Menu of configuration options:
[1] Show Current Settings
[2] Select Boot Source
[3] Select KITL Device
[4] Network Settings
[5] Display Settings
[6] Debug Port Settings
[7] Save Settings
[0] Exit and Continue
© 2011 Microsoft
Getting Started with Virtual CEPC 26
Type 2 to select the network device shown. The network device, for example,
DEC21140, is not an actual physical device on your computer. It is a simulated
network adapter that the vCEPC uses for sharing the physical network adapter of
your host computer. After you select the network device, the boot loader confirms
your selection. For example:
Boot Device is set to DEC21140 at PCI bus 0 dev 10 fnc 0
5. On the Main Menu, type 1 to display the boot loader settings. The settings display
includes information about the boot source, the display, kernel independent
transport layer (KITL), dynamic host configuration protocol (DHCP), and the debug
port. For example:
Boot source: DEC21140 at PCI bus 0 dev 10 fnc 0
KITL device: DEC21140 at PCI bus 0 dev 10 fnc 0
KITL config: enabled, interrupt mode, VMINI enabled
DHCP: enabled
Display: 640 x 480 x 32 / Full Screen
Debug Port: COM1 38400 baud
Verify that the boot source is set to the network device rather than the boot drive.
In addition, verify that VMINI is enabled and that the network device is configured
for KITL as shown in this example. These settings are enabled by default so that the
vCEPC can access the network and so that you can use debugging tools and access
the vCEPC from your development computer.
6. Type 7 to save the settings so that you don’t have to change the boot source to the
virtual network device on every subsequent boot of the vCEPC.
7. Type 0 to exit and continue; this action begins the boot process.
If you do not want to boot your OS image over the network device from Platform
Builder, you can create a stand-alone VHD image that contains your OS design image
and a boot loader. For more about creating a stand-alone VHD image, see the
companion article Advanced Virtual CEPC
(http://go.microsoft.com/fwlink/?LinkID=206041).
DHCP Time-Out
The Virtual CEPC boot loader sends 26 DHCP discover messages before it aborts the
DHCP server discovery process. When this time-out occurs, you will see an error
message in the Virtual PC console similar to the following:
Send DHCP Discover Message (attempt 26)
ERROR: BootTransportPb: Failed get IP address from DHCP server!
ERROR: BootDownloadBin!ImageType: BootTransportRead Failed!
This error means that your host computer is not attached to a network or it is attached
to a network without a DHCP server. To use Virtual CEPC on a host computer without a
network connection or a DHCP server, see “Using Virtual CEPC Without a Network” in
the companion article Advanced Virtual CEPC
(http://go.microsoft.com/fwlink/?LinkID=206041).
© 2011 Microsoft
Getting Started with Virtual CEPC 27
Boot Time-Out
The vCEPC boot loader sends sixty “BOOTME” messages before it aborts the boot
process. When this time-out occurs, you will see an error message in the Virtual PC
console similar to the following:
Send BOOTME Message (device name PC-0003FFC67ACA, attempt 60)
ERROR: BootDownloadBin!ImageType: BootTransportRead Failed!
If you are unable to initiate the boot image download from Platform Builder before the
boot loader times out and prints this message, you can restart the vCEPC to retry the
boot loading process. See “Restarting the Boot Loader” earlier in this article for
information about restarting the vCEPC.
To remedy this problem, verify that you have selected the correct keyboard driver as
described in the section “Select a Virtual CEPC Keyboard Driver” and rebuild your OS
design.
Conclusion
You can configure and boot a virtual CEPC (vCEPC) for use as a Windows Embedded
Compact 7 development platform. To do so, you create a Platform Builder project and
OS design for the vCEPC, select catalog items and a keyboard driver for your vCEPC OS
design, and build an image that runs on the vCEPC. You also configure Virtual PC with a
virtual machine and a VHD image for Windows Embedded Compact 7. You connect
Platform Builder to your running Virtual PC session so that you can download your OS
image to Virtual PC and boot it in a virtual machine. With your vCEPC booted and
connected to Platform Builder, you can develop and build your application in a Platform
Builder subproject and run it on your vCEPC. You can also copy files to and from your
vCEPC through a folder that is shared between your vCEPC and your host computer.
© 2011 Microsoft
Getting Started with Virtual CEPC 28
With Virtual CEPC, you can develop, test, and debug Windows Embedded Compact
applications entirely on your development computer without having to purchase, install,
and configure special hardware.
Additional Resources
To learn more about Virtual PC, see the following links:
• Windows Virtual PC website (http://go.microsoft.com/fwlink/?LinkId=78095)
• Windows Virtual PC download page
(http://go.microsoft.com/fwlink/?LinkId=186188)
• Virtual PC 2007 download page (http://go.microsoft.com/fwlink/?LinkId=186183)
To learn more about Windows Embedded, see the following link:
• Windows Embedded website (http://go.microsoft.com/fwlink/?LinkId=183524)
© 2011 Microsoft
Getting Started with Virtual CEPC 29
Copyright
This document is provided “as-is”. Information and views expressed in this document,
including URL and other Internet Web site references, may change without notice. You
bear the risk of using it.
This document does not provide you with any legal rights to any intellectual property in
any Microsoft product. You may copy and use this document for your internal, reference
purposes.
© 2011 Microsoft. All rights reserved.
© 2011 Microsoft