Need Help. Can't capture .wim image of Windows 11 in Hyper-V

Hemmelman, Keith 131 Reputation points
2021-10-19T15:43:26.703+00:00

I'm afraid I'm stumped and really could use some help.

I'm attempting to build a Windows 11 Enterprise reference image in a Hyper-V virtual machine and "capture" a .wim image of that to be used for deployment in our environment. (It's the capture part that isn't working.)

I've done this many dozens of times with Windows 10, but Windows 11 isn't working.

  • I create a VM in Hyper-V, but for Windows 11 Enterprise requires you to use a "Generation 2" type of VM, with 'Secure Boot' and 'TPM' and at least '2' CPU threads assigned, which I've never used before. I've always only ever used Generation 1 VM's before when building and capturing Windows 10 images. (Is this part of the issue?)
  • I install the Windows 11 Enterprise, software, etc., make some custom settings in the OS, etc.
  • I sysprep and finalize/shutdown Windows.
  • At this point I assign a WinPE bootable ISO to the 'DVD' drive in the VM. This WinPE (ISO) boot disk is created in Microsoft Deployment Toolkit (MDT) and runs a simple Task Sequence that uses the DISM tool to "capture" a .wim image file of the target OS.
  • It gets to the step of "capturing" the image, but simply exits without actually doing anything.

FYI - This same exact WinPE (ISO) boot disk & Task Sequence to capture an image of the Hyper-V virtual machine works perfectly fine to capture .wim image files of my Windows 10 VM's in Hyper-V. (But these are all "generation 1" style of VM's.)

It acts like it can't find any OS to capture.

In the past with Windows 10, if I boot my VM with WinPE and I open a Command Prompt, there is always a disk drive of "C:" available that is the Windows Operating System drive that I want to capture.

But when I boot the Windows 11 VM the same way and open a Command Prompt, there are NO drive letters attached to the OS. (I've checked all 26 drive letters!) So of course DISM has no way of capturing anything because there is no drive letter to assign to the "/capturedir" parameter of DISM, (i.e. - **/capturedir:C:**). Thus, DISM can't capture an image because WinPE doesn't see the OS drive letter!

I don't understand what is causing this issue or how to overcome it to capture an image of my Windows 11 VM. I've tried changing some settings in the VM prior to booting into WinPE to capture, but nothing allows it to see the target OS drive that I want to capture.

How on earth do I install Windows 11 into a Hyper-VM and then 'capture' it as a .wim image file? Is there some other way to install Windows 11 in a Hyper-V virtual machine? (It's pretty straight forward with not that many options available and it refuses to install unless I use a generation 2 VM.)

I have no trouble with installing and capturing Windows 10 images with a generation 1 VM in Hyper-V. It has always just worked. But with Windows 11, I can't find a way to actually capture a .wim image of the VM.

Any help would greatly be appreciated.

Thank you.

Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
11,797 questions
{count} votes

9 answers

Sort by: Most helpful
  1. Ryu-Jp1977 6 Reputation points
    2021-11-14T15:56:21.84+00:00

    Hi @Hemmelman, Keith ,

    I'm same situation without Hyper-V. I cannot see a volume that would like to capture. My enviroment is,
    DELL latitude 5310
    Windows 11 Pro

    However I could see capture volume in dispart tool. Therefore I added drive letter by diskpart, then I could capture by dism.exe.

    For example,
    diskpart
    list disk
    select disk 0
    list volume
    select volume 0
    assign letter=D

    Thanks

    1 person found this answer helpful.
    0 comments No comments

  2. Hemmelman, Keith 131 Reputation points
    2021-10-19T16:53:57.57+00:00

    I just tested installing Windows 10 into a Generation 2 Hyper-V VM. When I boot to my WinPE (ISO) Boot Disk and open a Command Prompt, I can see the "C:" drive for the operating system just fine, so just the fact of it being a 'Generation 2' VM does not seem to be the underlying problem.

    Only if I install Windows 11 in Hyper-V it seems I cannot see the C: drive from a Command Prompt in the WinPE environment and therefore I have no way to capture a .wim image using DISM!

    I'm quite confused on how to fix this so I can use DISM in the WinPE environment to capture an image of Windows 11 installed into a Hyper-V virtual machine.

    Can someone else attempt to do this to see if it works for you?

    Simply install Windows 11 into a Hyper-V virtual machine. Then boot that Hyper-V machine to a WinPE ISO, or you can even boot to the Windows 11 ISO itself like you are doing another install and click 'Next' on the first install screen and then select "Repair your computer" - "Troubleshoot" - "Command Prompt".

    Then once at the Command Prompt would you be able to run DISM and capture the "C:" drive? In other words, so you see the Windows 11 operating system you installed on the Hyper-V machine as drive letter "C:"? (Or any other drive letter for that matter!)

    This works fine if I install Windows 10 Enterprise in both a Hyper-V 'Generation 1' or 'Generation 2' VM. When booting to WinPE (or Windows 10/11 ISO) and opening a Command Prompt, the "C:" drive is right there visible and is your installed OS, thus allowing you to capture it with DISM or in my case, using a MDT Task Sequence which essentially uses DISM to capture drive "C:".


  3. Limitless Technology 39,901 Reputation points
    2021-10-20T09:11:08.05+00:00

    Hello @Hemmelman, Keith ,

    Thank you for your question.

    Look, as this is a configuration problem related to Windows 11, I recommend that you post your question on the windows 11 forum, this way you will receive a more adequate answer.

    To do this, just access the link below and select the option "Ask a question" from the top menu and then describe the entire problem, including images:

    https://answers.microsoft.com/en-us/windows/forum/windows_11?sort=LastReplyDate&dir=Desc&tab=All&status=all&mod=&modAge=&advFil=&postedAfter=&postedBefore=&threadType=all&isFilterExpanded=false&page=1

    ---------------------------------------------------------------------------------------------------------------------------------

    If the answer is helpful, please vote positively and accept as an answer.

    0 comments No comments

  4. Hemmelman, Keith 131 Reputation points
    2021-10-20T14:55:11.547+00:00

    Thanks Limitless. I went ahead and posted on that area too.

    In the event someone see this thread, I've done a bit more testing on physical computers this time and am not using Hyper-V.

    Computer 1 - Had Windows 10 Enterprise on it and was "upgraded" to Windows 11 Enterprise.

    • I boot to a WinPE USB thumb drive and the hard drive is visible. I see a drive "C:" from a Command Prompt and therefore DISM would be able to capture an image of that drive.

    Computer 2 - Had Windows 11 installed from scratch.

    • I boot to a WinPE USB thumb drive and the hard drive is NOT visible!

    So it seems the underlying problem is not tied to just a Hyper-V virtual machine as this problem is occurring on a physical computer.

    0 comments No comments

  5. theopolis 1 Reputation point
    2021-10-21T12:58:07.303+00:00

    I looked at the MS doc, it doesn't say Gen 2 is required and I copy and pasted below what they req.

    However I am having issues sysprep'ing in a Gen 1 but using the disc from the MCT that I had to convert the esd to a wim.

    https://learn.microsoft.com/en-us/windows/deployment/deploy-windows-mdt/create-a-windows-11-reference-image

    Create a new virtual machine with the following settings:
    Name: REFW11X64-001
    Store the virtual machine in a different location: C:\VM
    **Generation 1

    Memory: 1024 MB
    Network: Must be able to connect to \MDT01\MDTBuildLab$
    Hard disk: 60 GB (dynamic disk)
    Install OS with image file: C:\ISO\MDT Build Lab x86.iso**

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.