Jaa


从VHD文件启动计算机

/*??????Aviraj Ajgekar???????????*/

????????Windows 7?VHD???????,????VHD??????????:-) ??????????????????????????

????,?????????????,????????????U?????????????????VHD???Windows 7????????????,?????????VHD????????

 

???????Windows 7????????????VHD???????,?????Windows 7????(Boot Loader)?????,??????BCDEdit???,?VHD???????????????????????

 

?????????????:

??,?????????????????????VHD?????????????????????VHD??,????????????:

1. ?Virtual PC??Hyper-V?????,????sysprep,????,???VHD?????Windows 7?Boot Loader???

2. ??ImageX??,??????????????(ImageX??)???VHD??

??????????,?Aviraj Ajgekar???????????

 

Adding the VHD Entry in Boot Menu and then Boot from VHD

??????VHD?????VHD?????????????,??????Windows 7?BCDEdit?????????????:

C:\>bcdedit /copy {current} /d "My New VHD Description"

Note: This will Return the GUID of the Loader Object that you will use to replace <guid> below
C:\>bcdedit /set <guid> device vhd=[driveletter:]\<directory>\<vhd filename>
C:\>bcdedit /set <guid> osdevice vhd=[driverletter:]\<directory>\<vhd filename>

Note: vhd=[driveletter:]\<directory>\<vhd filename> is the new syntax supported for BCDEdit.exe to locate VHD File and Bootmgr will locate the partition containing the VHD File to boot from.
C:\>bcdedit /set <guid> detecthal on

Note:

Following is the attached screenshot of the my machine. In this case I have Windows 7 as the default OS and I have added the VHD File in the Boot Entry.

bcd

Well just after that run the following command to test if your boot entry is successfully created using C:\>bcdedit /v

image

Similarly, if you want to add multiple VHDs into Boot entry you can use the following lines to the command prompt

C:\>bcdedit /copy {current} /d "New VHD Description"
C:\>bcdedit /set <guid> device vhd=[driveletter:]\<directory>\<vhd filename>
C:\>bcdedit /set <guid> osdevice vhd=[driverletter:]\<directory>\<vhd filename>
C:\>bcdedit /set <guid> detecthal on

Note:   detecthal is used to force windows to auto detect the Hardware Abstraction Layer.

If you want to delete any existing VHD entry from the Boot Menu you can always use the command C:\>bcdedit /delete <guid> /cleanup This deletes the specified operating system entry from the store and removes the entry from the display order.

Well, we are ready to Boot from VHD. Once you restart the computer you will see additional entry in Boot Menu along with the default Windows 7 or Windows Server 7 OS.

Here is the screenshot from newly booted Windows Server 2008 R2 Beta from VHD. I have installed Desktop Experience Pack and enabled Aero Glass.

win 7 server

????,?????????:?VHD???????,??????????????????????????VHD??,???????????????????????????????:

 

1. Windows 7??????Windows 7???????VHD?????????,???????????????,??VHD???????;??????Windows 7???????????VHD???????VHD???????,?Virtual PC??Hyper-V??????????Windows 7?????????????

2. ?VHD????,??????????????,????????????

3. ????????,??????????????,?????????VHD???????,?????????I/O????,???????????,????????????????????,????????????VHD???,????????????:

image

4. ???VHD???????Windows 7?,???????Windows 7???VHD??????VHD?????????

 

????????????????????,??????????????????????

Comments

  • Anonymous
    January 01, 2003
    是不是不要从VHD启动,直接删掉VHD文件即可?

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 19, 2009
    这个虚拟机必须是windows7或者08r2吗?我用vpc安装了2008,结果不能从vhd启动

  • Anonymous
    January 20, 2009
    The comment has been removed

  • Anonymous
    February 16, 2009
    可不可以这样简单的认为,这个vhd就相当于ram启动pe1.0时的那个winpe.is_,由于setupldr.bin对cab文件的支持,启动出现了一个x盘符的ram盘,

  • Anonymous
    December 04, 2010
    我使用运行在hyper-v里的windows server 2008 r2的vhd文件,照上面做过之后,重启进入windows2008 ,在输入Administrator的密码的时候,原来的密码不管用了.不能进入系统.这是为什么呢?