Note: This article is organized from the Internet and translated from this blog
The benefits of vhd are described as follows:
For systems running on vhd, apart from Virtual Disks, they directly run on physical devices. As a result, the disk may cause 3% to 5% performance loss. In addition, it is no different from directly installing the system. Note that vhd stored on a USB mobile device is not supported now.
Another more detailed description is as follows:
Microsoft provides native support for Virtual Disk Files in vhd format in Windows 7. It is also reflected in the ability of the operating system to read, write, and manage vhd Virtual Disk Files as physical disks. Based on this feature, you can deploy Wim images of Windows 7 or Windows Server 2008 R2 to vhd Virtual Disk Files, then, the computer is directed to the operating system deployed in the vhd Virtual Disk File by adding a boot guide.
It is worth mentioning that, unlike virtual operating systems running on virtual hardware devices in other virtual machine software environments. The System Based on vhd virtual disk files directly accesses physical hardware devices. In addition to the performance loss caused by the lack of hard disk cache compared with the physical hard disk, in other aspects, there is almost no difference with the operating system installed on physical hardware. Users are concerned about opening aero glass special effects and video card game performance. In addition, in the vhd Virtual Disk System, the original partition content on the physical hard disk can also be accessed.
The following describes how to create a vhd file:
- You can directly use disk management in windows, for example:
- Another method is to directly use the command line:
Diskpart> Create vdisk file = "G:/virtualhd. vhd" Maximum = 20480 type = expandable <br/> 100 percent completed <br/> diskpart successfully created the Virtual Disk File.
Creating a vhd image is quite simple. Then you can mount the vhd image to Windows. There is no difference between graphical operations and creation, while the command line is like this:
Diskpart> select vdisk file = "G:/virtualhd. vhd "<br/> diskpart successfully selected the Virtual Disk File. <br/> diskpart> attach vdisk <br/> 100 percent completed <br/> diskpart successfully attached the Virtual Disk File.
The created vhd cannot be used, so you need to initialize it. For the graphic interface, Click Initialize disk at disk1. The command line needs to create a partition. In fact, vhd is equivalent to a new hard disk. So do what you want.
After completing this operation, add a Windows image to the image. Imagex is required here. This item is available in the AIK tool for Windows 7, but it is too big. I directly uploaded it to the disk tool in ulysess.ys168.com.
OK. Start preparation.
First, you need to have a system image or CD. I mounted my Windows Server 2008r2 evaluation version image to the virtual optical drive, and then used the imagex tool to view the WIM file information, mine is like this:
C:/> imagex.exe/info h:/sources/in <br/> stall. wim </P> <p> imagex tool for Windows <br/> copyright (c) Microsoft Corp. all rights reserved. <br/> Version: 6.1.7600.16385 </P> <p> Wim information: <br/> -------------- <br/> path: H:/sources/install. wim <br/> guid: {bd8f3a22-5987-478d-a780-2a56bd77993a} <br/> image count: 8 <br/> compression: LZX <br/> part number: 1/1 <br/> attributes: 0xc <br/> integrity info <br/> relative path junction </P> <p> available image choices: <br/> ---------------------- <br/> <Wim> <br/> <totalbytes> 2642792123 </totalbytes> <br/> <image Index = "1"> <br/> <dircount> 13389 </dircount> <br/> <filecount> 59557 </filecount> <br/> <totalbytes> 10124038438 </totalbytes> <br/> <creationtime> <br/> <pighpart> 0x01ca0446 </pighpart> <br/> <lowpart> 0x8e44dcaf </lowpart> <br/> </creationtime> <br/> <lastmodificationtime> <br /> <pighpart> 0x01ca045d </pighpart> <br/> <lowpart> 0xb28d4996 </lowpart> <br/> </lastmodificationtime> <br/> <Windows> <br/> <arch> 9 </arch> <br/> <productname> Microsoft Windows Operating System </productname> <br/> <editionid> serverstandard </editionid> <br/> <installationtype> server </installationtype> <br/> <Hal> acpiapic </pal> <br/> <producttype> servernt </producttype> <br/> <productsuite> Terminal server </productsuite> <br/> <ages> <br/> <language> en-US </language> <br/> <default> en-US </default> <br/> </ages> <br/> <version> <br/> <major> 6 </major> <br/> <minor> 1 </minor> <br/> <build> 7600 </build> <br/> <spbuild> 16385 </spbuild> <br/> <splevel> 0 </splevel> <br/> </version> <br/> <systemroot> Windows </systemroot> <br/> </Windows> <br/> <Name> Windows Server 2008 R2 serverstandard </Name> <br/> <description> Windows Server 2008 R2 serverstandard </description> <br/> <flags> serverstandard </flags> <br/> <pardlinkbytes> 3549519997 </pardlinkbytes> <br/> <displayname> Windows Server 2008 R2 Standard (full installation) </displaynae> <br/> <displaydescription> This option INSTALLThe complete installation of Windos server. this installation events des the entire user interface, and it supports <br/> all of the server roles. </displaydescription> <br/> </image> <br/> .... <br/> </Wim>
In fact, you only need to pay attention to the index and its version. I am using index 3 as the Enterprise Edition. So I used 3:
Imagex.exe/apply H:/sources/install. wim 3 I: // </P> <p> imagex tool for Windows <br/> copyright (c) Microsoft Corp. all rights reserved. <br/> Version: 6.1.7600.16385 </P> <p> [100%] Applying Progress </P> <p> successfully applied image. </P> <p> total elapsed time: 9 min 40 sec
Note: First, you must have the Administrator permission to execute this command. In addition, here 3 refers to install. in Wim, the index is 3, And I:/mounts the previously created vhd image to the I: drive letter.
If you are interested, you can use this tool to release install. Wim to your hard disk to install the system. It's easy. Just find a PE and start it.
After filling, you only need to use the bcdedit tool to set the startup.
C:/> bcdedit/copy {current}/D "Windows Server 2008 R2" <br/> the entry was successfully copied to {9997a1d8-6f32-11de-bb28-c70c97b2d429 }. </P> <p> C:/> bcdedit/set {9997a1d8-6f32-11de-bb28-c70c97b2d429} device vhd = [E:]/vhdwindow. vhd <br/> the operation completed successfully. </P> <p> C:/> bcdedit/set {9997a1d8-6f32-11de-bb28-c70c97b2d429} osdevice vhd = [E:]/vhdwindow. vhd <br/> the operation completed successfully. </P> <p> C:/> bcdedit/set {9997a1d8-6f32-11de-bb28-c70c97b2d429} detecthal on <br/> the operation completed successfully. </P> <p> C: /> bcdedit </P> <p> Windows Boot manager <br/> -------------------- <br/> identifier {bootmgr} <br/> device partition = C: <br/> description windows Boot manager <br/> locale en-US <br/> inherit {globalsettings} <br/> default {current} <br/> resumeobject {9997a1d4-6f32-11de-bb28-c70c97b2d429} <br/> displayorder {current} <br/> {9997a1d8-6f32-11de-bb28-c70c97b2d429} <br/> toolsdisplayorder {memdiag} <br/> timeout 30 </P> <p> Windows boot loader <br/> ------------------- <br/> identifier {current} <br/> device partition = C: <br/> path/Windows/system32/winload.exe <br/> description Windows 7 <br/> locale en-US <br/> inherit {bootloadersettings} <br/> recoverysequence {9997a1d6-6f32-11de-bb28-c70c97b2d429} <br/> recoveryenabled Yes <br/> osdevice partition = C: <br/> SYSTEMROOT/Windows <br/> resumeobject {drivers} <br/> NX optin </P> <p> Windows boot loader <br/> ----------------- <br/> identifier {9997a1d8-6f32-11de-bb28-c70c97b2d429} <br/> device vhd = [E:] /vhdwindow. vhd <br/> path/Windows/system32/winload.exe <br/> description Windows Server 2008 R2 <br/> locale en-US <br/> inherit {bootloadersettings} <br/> recoverysequence {9997a1d6-6f32-11de-bb28-c70c97b2d429} <br/> recoveryenabled Yes <br/> osdevice vhd = [E:] vhdwindow. vhd <br/> SYSTEMROOT/Windows <br/> resumeobject {9997a1d4-6f32-11de-bb28-c70c97b2d429} <br/> NX optin <br/> detecthal Yes </P> <p> C: /> <br/>
Note that the vhd = [E:]/vhdwindow. vhd in these settings is correct, and the drive letter must be framed in [].
OK. Everything is finished. Restart to see the effect.