WIM2VHD es una aplicacion de Microsoft que te permite crear de forma directa un disco vhd a partir de una imagen wim, bien generica o bien una imagen wim personalizada capturada por WDS o WinPE. El disco vhd es arrancable y tiene activado el OOBE para hacer la petición de settings iniciales de la maquina (usuario, nombre de maquina, etc). Estos settings se pueden contestar a mano o a través de un fichero de instalación desatendida.
Para poder utilizarlo necesitas un Windows 7 y WAIK instalado, no necesitas ningun tipo de instalacion tipo servidor.
La sintaxis del comando es la que sigue:
cscript wim2vhd.wsf. /wim:<wimPath> /sku:<sku> [/vhd:<vhdPath>] [/size:<vhdSizeInMb>] [/disktype:<dynamic|fixed>] [/unattend:<unattendxmlPath>] [/qfe:<qfe1,.,qfen>] [/hyperv:<true|false>] [/ref:<ref1,.,refn] [/dbg:<args>] [/passthru:<physicaldrive>])
WIM2VHD Parametros
Parameter
/wim:<wimPath> This is the path of the WIM file you use when creating
the VHD.
/sku:<skuName>|<skuIndex> The Stock-Keeping Unit (SKU) identifies the
operating system to use when creating the VHD (for example, “HomePremium”). You can so specify a number that you obtain by using ImageX to analyze the relevant WIM file.
/vhd:<vhdPath> (optional) This defines the path and the name of the VHD to be
created. If a file with this name already exists, it will be overwritten. If no VHD is specified, a VHD will be created in the current folder.
/size:<vhdSizeInMb> (optional) For Fixed disks, this is the size in megabytes of the VHD that will be created. For Dynamic disks, this is the maximum size in megabytes to which the VHD can grow if additional space is required. If you do not specify this
parameter, a default value of 40 GB is used.
/disktype:<dynamic|fixed> (optional) This specifies what kind of VHD should be created, dynamic or fixed. A Fixed disk allocates all of the necessary disk space for the VHD upon creation. A Dynamic disk only allocates the space required by files in the VHD at any given time and will grow as more space is required. The default value is Dynamic.
/unattend:<unattendxmlpath> (optional) This specifies the path to an Unattend.xml file that is used to automate the OOBE portion of Windows setup the first time the VHD is booted.
/qfe:<qfe1,.,qfen> (optional) This is a comma-separated list of Quick Fix Engineering
(QFE) or hotfix patches to apply to the VHD after the WIM is implemented.
/ref:<ref1,.,refn> (optional) This is a comma-separated list of WIM “pieces” (split files) to apply to the VHD. A WIM “piece” is the result of a split WIM, and typically has a .swm file extension. The first piece of the split WIM should be specified with the /wim switch. Subsequent pieces should be specified (in order) with /ref.
/dbg:<protocol>,<port/channel/target>[,<baudrate>].(optional) This configures debugging in the OS on the VHD. You can use your own custom WIM files in this process. However, be careful. Although Microsoft supports the underlying process, as documented in the Windows AIK, WIM2VHD is not supported at this time. You can copy files manually into the VHD, but there is no mechanism to do this with WIM2VHD.
Ejemplos WIM2VHD
Arrancais una consola en modo privilegiado y lo ejecutais:
cscript wim2vhd.wsf /win:x:mysourcesinstall.wim /sku: ultimate /unattend:C:answer_filesunattend.xml
Esta sentencia convierte la versión ultimate de la imagen install.wim al vhd y ademas el oobe lo responde con el fichero unattend.xml
Otro ejemplo:
cscript wim2vhd.wsf /wim:C:mystuffcustom.wim /sku:1 /VHD:C:mycustom.vhd
Instala la primera imagen de custom.wim a un vhd ubicado y con nombre C:mycustom.vhd
Descarga WIM2VHD