While getting ready for an event that will be staged completely with WDS, I ran into issues capturing a VHD file to a WIM file using WDS. My guess is that the old Mac Mini I’m using is not keeping up so I needed a way to get that VHD to convert to a WIM file.
I found this thread that explains a couple of methods to do this, so here are my results on the first one.
The process is very simple, mount the VHD to a directory and then use the New-WindowsImage commandlet do its job.
Create the directory to where you would like to have the image mounted before you run the following command:
Mount-WindowsImage -ImagePath “C:\VMs\VHDs\Test WDS.vhdx” -Path C:\VHDMount -Index 1
Once that command runs, you’ll see the contents on c:\VHDMount:
Next, create a directory where you would like to store the Wim file (in my case C:\CapturedWims\) and run the following:
New-WindowsImage -CapturePath C:\VHDMount -Name Win8Test -ImagePath C:\CapturedWims\Win8.wim -Description “Windows 8 Clean” -Verify
Finally, unmount the image discarding any changes as none should have been made to the master VHD:
Dismount-WindowsImage -Path C:\VHDMount -Discard
Henrik Mai says:
there is a misstake in the last two lines.
You say “…unmount the image discarding any changes” and the commandline locks like “-save”. That doesn´t match!
I think the option must bee “-discard”?!
Christian Saborio says:
Thank you Henrik, you are absolutely correct. The post has been corrected to reflect this.