Installing Windows Embedded Standard (Windows 7 Embedded) in a VHD file
One of the new capabilities of Windows 7 Embedded is to boot from a VHD file. This is a great possibility which can help a lot in case of deploying updates, running different version, or deploying the system in general as it’s again a simple file copy&pasty procedure on NTFS.
You can even install Windows 7 Embedded directly into a VHD so you don’t need to transfer it to a VHD manually – also you don’t need BCDEDIT as the setup will take care of this.
Before you start you need an formatted NTFS volume where the VHD will be located.
Installation
- Boot the target device from the Runtime DVD
- When the setup screen appears pres Shift+F10 – this will open a command prompt
- Run diskpart.exe
- Run the following commands to create a 5GB VHD
create vdisk file=c:Win7Emb.vhd maximum=5120
select vdisk file=c:Win7Emb.vhd
attach vdisk
exit
- close the command prompt and run through your Windows 7 Embedded installation
- select the VHD harddisk at the target drive selection
Cloning
The cloning process with VHDs it quite easy:
- format a new hdd with NTFS
- copy the whole content of the target drive where the VHD is located to the new harddisk
(make sure that you see all the system files – the bootmanager is hidden by default!)Example where C is the master drive and D is the new target drive:
robocopy C: D: /E
Imageupdates
If you have an update for your image you can easily copy the new VHD to the target harddisk, e.g.:
C:
— Win7Emb.vhd [Original Windows 7 Embedded]
— Win7Emb_v2.vhd [Updated Windows 7 Embedded Image]
Now you just need to install a new bootentry and set it as default.
bcdedit /copy {default} /d "Updated Windows 7 Embedded Image"
bcdedit /set {GUID} device vhd=[C:]Win7Emb_v2.vhd
bcdedit /set {GUID} osdevice vhd=[C:]Win7Emb_v2.vhd
bcdedit /default {GUID}
If something is wrong with the new image you can easily revert back.
Written by Wolfgang Unger
September 8, 2009 at 14:45
Posted in Windows 7 Embedded
2 Responses
Subscribe to comments with RSS.
Hi, cloning is not working for me this way.
I used robocopy with these parameters. Then i tried tool for cloning drives.
Results are same:
Widow won’t boot >>> BCD reports that the system can’t boot
It’s necessary to create new BCD this way (at least this one works for me):
1. Create new partition on disk (whatever disk USB flash drive works too) and mark as active
2. Format this new partiton FS=NTFS
3. Copy VHD file to this partiton
4. Attach this new copied VHD file in your Windows 7 and assign letter (this is probably done automatically)
5. Assume that your partition with VHD is F: and attached VHD on it is E:
– run cmd as administrator
– bcdboot E:\Windows /s F:
6. Detach VHD
7. Boot from your new HDD
Libor Braun Chaloupek
October 11, 2011 at 15:33
You are right – thank you for the addition. In case you have a separate 100MB partition that contains the bootmanager you need to run bcdboot /S to copy the bootmanager to the new target drive.
Wolfgang Unger
November 16, 2011 at 18:19