Quickly create Windows virtual disk image cheats

  

Last year at Geek Week I learned a tool: VDI called WIM2VHD (Windows Image to Virtual Hard Disk), recently moved the experimental platform to hyper-v, and then remembered this tool. WIM2VHD has been around since the beginning of 2009, so you may have heard of it. If you haven't already, welcome to experience the rapid creation process of VHD.

Before you start, you need to download the Windows Automated Installation Kit for Windows 7. In fact, there are only two files in this 1.6G package: IMAGEX.EXE and BCDBOOT.EXE. If you Already, just put them in the same folder of WIM2VHD and the preparation is complete.

WIM2VHD is essentially a pointing device on the installation media. WSF scripts for WIM files (usually located in the Sources folder). Combined with various configuration parameters, it can be used during the actual installation of Windows. The WIM file (Windows image format) extracts various information and converts it into a VHD file format. The next step is to create a new virtual machine and assign the newly created VHD (or a copy of it) to the new virtual machine.

At runtime, WIM2VHD creates and loads VHD files for keeping all system files. At the end of the operation, it sets the VHD to a bootable format to form a removable Windows virtual machine.

Simple commands are as follows:

CSCRIPT WIM2VHD.WSF /WIM:D:\\Sources\\install.wim /SKU:ULTIMATE /VHD:C:\\Win7Image.vhd

This command is used on the installation media. The wim file, by comparing the SKU and the installation media, can lock the version of Windows and then notify the script where the VHD file is saved after it is completed.

In addition to this simple usage, you can add many other parameters. Because each VHD file is essentially created as a sysprepped image, the unattend script can be added to perform a fast run after the virtual machine is started.

You can also define the size of the VHD file, the type of disk (dynamic or fixed), and a list of patches that need to be completed at runtime. For details, please refer to the MSDN page of WIM2VHD.

Another function called /passthru can even skip the creation of VHD even when copying related files to the target drive and setting it to bootable. process. In theory, this also means that we can use WIM2VHD to create VMDK files. Although I have found a set of tools to do this, I still spend a lot of time exploring this area.

Generally, the whole process should be as follows:

1. Create a blank VMDK disk image

2. Create a partition on the image

3. Format Partition and mark it as active (WIM2VHD can only mark VHD volumes as active, not all detected physical disks)

4. Use VMware DiskMount as a standalone tool in Windows Drive loading

5, use WIM2VHD to complete disk preparation

6, uninstall VMDK and start virtual machine

The best result of my test is that the virtual machine can boot to the Microsoft interface. I get an error message "The Windows Boot Configuration Data file is missing required information." If anyone finds a solution for the VMDK file, I will give him an autographed Muppet Gabe (the April Fool's Day anchor character on Brian Madden TV) and post it here (SearchVirtualDesktop.com). Of course, if you are a XenServer or Hyper-V user, you can also try WIM2VHD - it will save you a lot of time.

Author: Gabe Knuth Translator: Li Zhexian

Copyright © Windows knowledge All Rights Reserved