Tuesday, June 2, 2009

WES 2009, Virtual PC and Windows PE [Updated]

When experiencing Windows Embedded Standard, you need an x86 device to boot the OS. The first solution is to use a spare computer and deploy the Runtime image to the hard drive at every OS re-generation. Except if you are a skew driver fan, but mounting and unmounting the hard-drive to push the new binaries on the target, is quite painful after two or three manipulations. So another solution could be to use the current hard drive of your development computer, and reserve a partition for WES. In this case no screw driver is required, as the partition is visible directly under the OS of you development computer. The only restriction, in this case, is too reboot the development machine to get the WES OS booted. But this solution is also painful, as booting the development OS can take a while, and all development tools have to be reloaded. The ultimate solution is to use an x86 virtualizer, like Virtual PC or other. When using the virtualizer, the way to reboot the WES OS is by launching the virtualizer software.

Use a Virtual PC :
First you need to create a new virtual machine and a hard drive, you can find all the details in the Virtual PC blog.
Then you have to prepare the hard drive to receive the WES files. And for this, you have to create a partition.... and at this point you are locked, except if you have in your drawer, an old booting floppy disk and a floppy disk reader...
Microsoft is providing for IT's a Windows Automated Installation Kit, available for free from their website. This kit provides cool applications, called WinPE, and ways to easily have a booting CD-ROM iso that can be customised to integrate all the applications that can be useful to deploy an OS, like Windows XP, Vista, and WES.

Prepare your booting CD-ROM :
After downloading and installing the AIK package, launch Startup Menu->Microsoft Windows AIK->Windows PE Tools Command Prompt.
1) Initial Folder Creation
copype x86 [Destination_Folder_Path]

2) Add custom Files
Copy required custom files to the ISO folder in \ISO. Like bootsect.exe available in "Windows AIK\Tools\PETools\x86".

3) Build the customized ISO
oscdimg -n -b[path to etfsboot.com file]\efsboot.com [path to the ISO folder] [path and name of the iso to generate]


Boot the ISO :
When the iso image is generated, then you have to boot it under Virutual PC, by launching the Configuration done previously and going to the CD menu. Then attach the iso file, and Virutal PC should boot on the virutal CD-ROM drive.

Partitions creations :
When WinPE 2.0 boot up, it initialize a shell from where you can launch batch scripts or single comands. >e gonna use diskpart to create, format partition.
Launch dispart from the shell window (PERFORM ALL THOSE COMMANDS FROM THE VIRTUAL PC COMMAND WINDOW ONLY).


1) List the available disks :
list disk

2) Select the disk
select disk 0

3) Clean Up the disk
clean

4) Create a partition
create partition primary size=XXXXX

5) Assigne a letter to the partition
assign letter=C

6) Format the partition
format fs=ntfs quick

7) Activate the partition to be bootable by the Virutal PC BIOS
active

8) Exit diskpart
exit

Then you have to store the boot sector on the partition, diskpart provided with WinPE 2.0 store by default the Vista boot sector, that is not compatible with WES 2009.
9) Prepare boot sector
bootsect /NT52 C:
Note : bootsect.exe can be found in the AIK installation folder and pushed into the CD-ROM Iso

Push files to the target :
The hard drive is now ready to receive the WES runtime files, and the easy way to push those files from the development machine to the virtual hard drive is using the network and the sharing capabilities of Windows.
Share the folder used for the generation of the WES image on the development computer, and use netuse from the Virtual PC to access it.
Then use xcopy to get the files onto the virtual hard drive.

Conclusion :
Using the Virtual PC is fairly easy to get and experiment WES.

- Nicolas

1 comment:

Anonymous said...

You are fantastic