
Download Windows 7 from a VHD image
Last time we created a VHD image with Window 7 for Virtual PC . It is clear that in a virtual environment, of course, there are advantages, but nevertheless, I would like everything to work faster ...
In the case of Window 7, I would also like to see it in all its glory, at least with the aero-interface running.
Next, we will talk about how to boot from the received VHD image along with the installed base system. That is, to work with the system, you will not need a separate partition and you will not need to demolish the existing system, Win 7 will still be stored inside the VHD file, but at the same time it will be launched in a real environment.
Note: this method, by default, works in Windows 7 and Windows Server 2008 R2, I will tell you how to make it work under Vista (see point 1).
0. If you created a virtual image (VHD-file) as an image with a dynamic size, be assured that you have free space in the system at the maximum size for this image.
1. First of all, we need two files: bootmgr (a new boot manager that can load from VHD) and bcdedit.exe (a new version of the program for editing boot entries).
The first one can be taken from the installation disk, the second one can be taken from the installed Windows 7 system (for example, to be pulled out of the VHD image on hand). Or you can just download from here (skydrive) :)
Next, you have to rewritefile c: \ bootmgr . The file c: \ windows \ system32 \ bcdedit.exe , in principle, can not be overwritten (just run from another location). Just in case, I recommend keeping the old versions.
Note: for rewriting, I may need full ownership of the files.
2. Open the console (cmd) with admin rights, just in case, make a copy of the current entries and create a new entry along the way:
bcdedit / copy {current} / d “Windows 7”
The command will return the GUID of the newly created entry.
3. Next, you need to register the address with the VHD-disk to load
bcdedit / set {GUID} device vhd = [c:] \ vhd \ win7b.vhd
bcdedit / set {GUID} osdevice vhd = [c:] \ vhd \ win7b.vhd
4. If you want the added system to be the last in the list of OS at boot, you need to run the following command
bcdedit / displayorder {GUID} / addlast
The record with the corresponding GUID is moved to the end (in this way you can achieve any desired order).
5. If you want to change the name of the system at boot, you need to run the following command
bcdedit / set {GUID} description “Windows 7 - VHD”
6. To force automatic detection of a disk in Windows through the appropriate level of abstraction - Hardware Abstraction Layer - you should run the following command
bcdedit / set detecthal on
Done! You can reboot. After loading, Windows 7 will begin to install the necessary drivers for your real hardware. Will ask to reboot. After that, you can work normally. With Aero!


If you look at the disks present in the system, you will see that in addition to the 16 GB virtual disk (circled in orange), from which Win7 is actually loaded, there is also a second partition of the 200 MB virtual disk for system files and a real (!) Hard The disk installed on the computer. If you open a real disk and see where the system image file is located


You may find that the file size has increased to 16 GB. The thing is that our VHD-image was automatically converted to a fixed-size image, that is, it took the maximum possible 16 GB. This speeds up the system.
It is also worth noting that this image can still be downloaded via Virtual PC.
In the case of Window 7, I would also like to see it in all its glory, at least with the aero-interface running.
Next, we will talk about how to boot from the received VHD image along with the installed base system. That is, to work with the system, you will not need a separate partition and you will not need to demolish the existing system, Win 7 will still be stored inside the VHD file, but at the same time it will be launched in a real environment.
Note: this method, by default, works in Windows 7 and Windows Server 2008 R2, I will tell you how to make it work under Vista (see point 1).
0. If you created a virtual image (VHD-file) as an image with a dynamic size, be assured that you have free space in the system at the maximum size for this image.
1. First of all, we need two files: bootmgr (a new boot manager that can load from VHD) and bcdedit.exe (a new version of the program for editing boot entries).
The first one can be taken from the installation disk, the second one can be taken from the installed Windows 7 system (for example, to be pulled out of the VHD image on hand). Or you can just download from here (skydrive) :)
Next, you have to rewritefile c: \ bootmgr . The file c: \ windows \ system32 \ bcdedit.exe , in principle, can not be overwritten (just run from another location). Just in case, I recommend keeping the old versions.
Note: for rewriting, I may need full ownership of the files.
2. Open the console (cmd) with admin rights, just in case, make a copy of the current entries and create a new entry along the way:
bcdedit / copy {current} / d “Windows 7”
The command will return the GUID of the newly created entry.
3. Next, you need to register the address with the VHD-disk to load
bcdedit / set {GUID} device vhd = [c:] \ vhd \ win7b.vhd
bcdedit / set {GUID} osdevice vhd = [c:] \ vhd \ win7b.vhd
4. If you want the added system to be the last in the list of OS at boot, you need to run the following command
bcdedit / displayorder {GUID} / addlast
The record with the corresponding GUID is moved to the end (in this way you can achieve any desired order).
5. If you want to change the name of the system at boot, you need to run the following command
bcdedit / set {GUID} description “Windows 7 - VHD”
6. To force automatic detection of a disk in Windows through the appropriate level of abstraction - Hardware Abstraction Layer - you should run the following command
bcdedit / set
Done! You can reboot. After loading, Windows 7 will begin to install the necessary drivers for your real hardware. Will ask to reboot. After that, you can work normally. With Aero!


If you look at the disks present in the system, you will see that in addition to the 16 GB virtual disk (circled in orange), from which Win7 is actually loaded, there is also a second partition of the 200 MB virtual disk for system files and a real (!) Hard The disk installed on the computer. If you open a real disk and see where the system image file is located


You may find that the file size has increased to 16 GB. The thing is that our VHD-image was automatically converted to a fixed-size image, that is, it took the maximum possible 16 GB. This speeds up the system.
It is also worth noting that this image can still be downloaded via Virtual PC.