Description
Convert-WindowsImage is the new version of WIM2VHD designed specifically for Windows 8. Completely rewritten in PowerShell, the Convert-WindowsImage command-line tool allows you to create sysprepped
VHD and VHDX images from any official build of Windows 7, Windows Server 2008 R2, Windows 8, and Windows Server 8.
Images created by Convert-WindowsImage will boot directly to the Out Of Box Experience, ready for your first-use customizations. You can also use these images for automation by supplying your own unattend.xml
file, making the possibilities limitless. Fresh squeezed, organically grown, free-range VHDs - just like Mom used to make - that work with Virtual PC (Windows 7 only), Virtual Server (Windows 7 only), Microsoft Hyper-V, or Windows' Native VHD-Boot functionality!
What's new in WIM2VHD for Windows 8?
- First, we should stop calling it "WIM2VHD". The WIM2VHD name has been discontinued with this version of the script. Because it's been completely rewritten in PowerShell, I opted to give it a more PowerShell-esque
name, that name being "Convert-WindowsImage". "WIM2VHD8" has been the working codename for the project during development.
- As mentioned earlier, Convert-WindowsImage has been
completely rewritten in PowerShell.
- Support for the new VHDX file format has been added!
- Support for creating VHD and VHDX images from
.ISO files has been added!
- A new (and completely optional) graphical user interface has been added, making the creation of VHD and VHDX images as simple as a few mouse clicks!
- Closer integration with the storage stack, so there's no more need to automate DISKPART.EXE and hope that it works!
- Fewer binary dependencies!
- WIM2VHD required the use of up to 8 external binaries, some of which were only available as part of the Windows AIK/OPK,
requiring a 1.7GB download just to get a few EXE files.
- Convert-WindowsImage requires the use of only
3 external binaries, all of which are included in-box with Windows 8.
System Requirements
- What OSes can I run Convert-WindowsImage on?
Convert-WindowsImage can
only be run on Windows 8 Consumer Preview, Windows 8 Release Preview, Windows Server 8 Beta, and Windows Server 2012 Release Candidate operating systems. Convert-WindowsImage cannot be run on Windows
7 or Windows Server 2008 R2. - What OSes can Convert-WindowsImage make VHDs and VHDXs of?
Convert-WindowsImage only supports creating VHD and VHDX images from Windows 7/R2 and Windows 8 installation media. Windows Vista/Windows Server 2008 and previous versions of Windows are not supported.
- Which OSes can I use VHDX files with?
The new VHDX file format can only be used with Windows 8/Server 2012, and the version of Hyper-V that ships with Windows 8/Server 2012. You can create a VHDX which has Windows 7 or Windows Server 2008 R2 installed in it, but they will only run
on Windows 8/Server 2012 Hyper-V.
Are there any changes from the way WIM2VHD worked?
Yes. Here's a list of WIM2VHD features that have not been implemented in Convert-WindowsImage.ps1.
- /QFE*
Provided support for hotfix installation into the VHD during creation.
- /REF
Provided support for multi-part WIM files.
- /MergeFolder*
Merged a specified folder structure into the root of the VHD.
- /SignDisk
Created a file with the creation date, time, and Convert-WindowsImage version used to create the VHD in the root of the VHD file system. This is now the default behavior, so the switch has been removed.
- /Trace
Displayed verbose output. This is now handled by the -Verbose switch.
- FastFixed is no longer a valid value for the -DiskType parameter.
- /CopyLocal
Copied all necessary EXEs to a single directory. No longer needed in Convert-WindowsImage.
- /Metadata
- /HyperV
- /ClassicMount
Specified that WIM2VHD should use drive letters instead of the NTFS mount points. This is now the default behavior, so the switch has been removed.
* These features may be implemented in a later release.
Are there any known issues?
In the initial release of Convert-WindowsImage.ps1, there was a bug which prevented the creation of Hyper-V Server VHD and VHDX files. This bug has since been fixed in the .1 revision which was released on 6/12/2012.
If you are not affected by this issue, there is no need for you to upgrade to the current release.
There are currently no known issues with this build of Convert-WindowsImage.ps1.
How do I use this thing?
Show the graphical user interface:
PowerShell
Edit|Remove
powershell
.\Convert-WindowsImage.ps1 -ShowUI
.\Convert-WindowsImage.ps1 -ShowUI
Create a VHD using all default settings from D:\sources\install.wim.
PowerShell
Edit|Remove
powershell
.\Convert-WindowsImage.ps1 -SourcePath D:\sources\install.wim
# Since no edition is being specified, the command will succeed if there is only one image in the specified WIM file. If there are multiple images, the command will fail and it will list the possible editions.
.\Convert-WindowsImage.ps1 -SourcePath D:\sources\install.wim
# Since no edition is being specified, the command will succeed if there is only one image in the specified WIM file. If there are multiple images, the command will fail and it will list the possible editions.
Create a VHD using all default settings from D:\sources\install.wim while specifying an edition.
PowerShell
Edit|Remove
powershell
.\Convert-WindowsImage.ps1 -SourcePath D:\sources\install.wim -Edition Professional
.\Convert-WindowsImage.ps1 -SourcePath D:\sources\install.wim -Edition Professional
Create a 60GB VHDX, using all default settings, from D:\Windows8RPx64.iso.
PowerShell
Edit|Remove
powershell
.\Convert-WindowsImage.ps1 -SourcePath D:\Windows8RPx64.iso -VHDFormat VHDX -SizeBytes 60GB
.\Convert-WindowsImage.ps1 -SourcePath D:\Windows8RPx64.iso -VHDFormat VHDX -SizeBytes 60GB
Create a 48TB VHDX from D:\WindowsRPx64.iso with a custom file name.
PowerShell
Edit|Remove
powershell
.\Convert-WindowsImage.ps1 -SourcePath D:\Windows8RPx64.iso -VHDFormat VHDX -SizeBytes 48TB -VHDPath .\MyCustomName.vhdx
.\Convert-WindowsImage.ps1 -SourcePath D:\Windows8RPx64.iso -VHDFormat VHDX -SizeBytes 48TB -VHDPath .\MyCustomName.vhdx
Use WIM2VHD-style argument names to create a 20GB fixed VHDX with a custom name and an unattend file from D:\foo.wim, and return the path to the created VHDX on the pipeline.
PowerShell
Edit|Remove
powershell
.\Convert-WindowsImage.ps1 -WIM D:\foo.wim -Size 20GB -DiskType Fixed -VHDFormat VHDX -Unattend D:\myUnattend.xml -VHD D:\scratch\foo.vhdx -passthru
.\Convert-WindowsImage.ps1 -WIM D:\foo.wim -Size 20GB -DiskType Fixed -VHDFormat VHDX -Unattend D:\myUnattend.xml -VHD D:\scratch\foo.vhdx -passthru
Enable serial debugging in the VHD, using COM2 at 19200bps.
PowerShell
Edit|Remove
powershell
"D:\foo.wim" | .\Convert-WindowsImage.ps1 -Edition Professional -EnableDebugger Serial -ComPort 2 -BaudRate 19200
"D:\foo.wim" | .\Convert-WindowsImage.ps1 -Edition Professional -EnableDebugger Serial -ComPort 2 -BaudRate 19200