从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 (13)

  1. Anonymous says:

    是不是不要从VHD启动,直接删掉VHD文件即可?

  2. Anonymous says:

    VHD的Windows 7 可不可以访问物理硬盘上的数据,或者是VHD所在分区的其它分区?

  3. Anonymous says:

    对系统有要求的,目前是Windows 7和Windows Server 2008 R2。从VHD启动后,可以识别并且访问物理硬盘,就跟机器上面挂了多个硬盘的情况是一样的。

  4. Anonymous says:

    今天在Webcast上讲Windows 7的VHD Native Boot功能,为了方便听众动手操作,我把一些重要的资源列出如下: &#160; 一些重要的白皮书 Understanding Virtual

  5. Anonymous says:

    首先,我想指正一个说法,网上经常说Win 7 Native Boot VHD,更确切的说,应该是The Boot Loader Of Win 7 Native Boot VHD,重点突出,Win 7(包括2k8

  6. Anonymous says:

    发表了 Windows 7对VHD文件的内建支持 和 从VHD文件启动计算机 这两篇博客后,陆续收到不少技术爱好者的电子邮件询问这些功能的细节、技术实现和应用场景。在做了一些功课之后,我整理汇总了这篇文章,详细全面的讨论一下Windows

  7. Anonymous says:

    今天在Webcast上讲Windows 7的VHD Native Boot功能,为了方便听众动手操作,我把一些重要的资源列出如下: &#160; 一些重要的白皮书 Understanding Virtual

  8. Anonymous says:

    发表了 Windows 7对VHD文件的内建支持 和 从VHD文件启动计算机 这两篇博客后,陆续收到不少技术爱好者的电子邮件询问这些功能的细节、技术实现和应用场景。在做了一些功课之后,我整理汇总了这篇文章,详细全面的讨论一下Windows

  9. Anonymous says:

    最近发了一系列关于在Widows 7下使用VHD启动计算机的帖子( 帖子一 、 帖子二 、 帖子三 ),得到了网友们比较热烈的回应。大牛 Aviraj Ajgekar 在他的博客中又列出了在Vista

  10. yueyue says:

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

  11. Tony says:

    可不可以通过vhd的Windows 7去访问物理硬盘上的数据,或者是其它的分区?

  12. zhang says:

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

  13. illesley@163.com says:

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