Azure Image Builder & Windows 11

%3CLINGO-SUB%20id%3D%22lingo-sub-2744962%22%20slang%3D%22en-US%22%3EAzure%20Image%20Builder%20%26amp%3B%20Windows%2011%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2744962%22%20slang%3D%22en-US%22%3E%3CP%3EHas%20anyone%20managed%20to%20get%20an%20image%20build%20working%20with%20AIB%20and%20Windows%2011%3F%20The%20image%20I%20get%20doesn't%20seem%20to%20work%20correctly%2C%20I%20can't%20get%20a%20bootable%20VM%20from%20it.%20There%20are%20a%20number%20of%20errors%20but%20Packer%20is%20quite%20noisy%20normally%20anyway%20so%20hard%20to%20tell%20if%20normal%20or%20not%2C%20it%20might%20be%20failing%20around%20Windows%20update%20%2F%20Sysprep%20area.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2832100%22%20slang%3D%22en-US%22%3ERe%3A%20Azure%20Image%20Builder%20%26amp%3B%20Windows%2011%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2832100%22%20slang%3D%22en-US%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F283436%22%20target%3D%22_blank%22%3E%40planetwilson%3C%2FA%3E%26nbsp%3B%2C%20I%20am%20also%20trying%20to%20get%20that%20to%20work...%20I%20believe%20the%20issue%20is%20with%20the%20vm%20generation.%3C%2FP%3E%3CP%3E%22...%2F...%20The%20following%20configuration%20requirements%20apply%20to%20VMs%20running%20Windows%2011.%3C%2FP%3E%3CUL%3E%3CLI%3EGeneration%3A%202%3CSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E*%3C%2FSTRONG%3E%3C%2FLI%3E%3CLI%3EStorage%3A%2064%20GB%20or%20greater%3C%2FLI%3E%3CLI%3ESecurity%3A%20Secure%20Boot%20capable%2C%20virtual%20TPM%20enabled%3C%2FLI%3E%3CLI%3EMemory%3A%204%20GB%20or%20greater%3C%2FLI%3E%3CLI%3EProcessor%3A%202%20or%20more%20virtual%20processors%20...%2F...%22%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fwhats-new%2Fwindows-11-requirements%23virtual-machine-support%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fwhats-new%2Fwindows-11-requirements%23virtual-machine-support%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CU%3ESo...We%20need%20gen%202%20vms%20to%20run%20windows%2011%3C%2FU%3E%2C%20and%20AIB%20only%20creates%20Gen1.%26nbsp%3B%20I%20believe%20that%20we%20will%20need%20to%20follow%20this%20workaround%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%22%20Image%20Builder%20currently%20only%20natively%20supports%20creating%20Hyper-V%20generation%20(Gen1)%201%20images%20to%20the%20Azure%20Shared%20Image%20Gallery%20(SIG)%20or%20Managed%20Image.%20If%20you%20want%20to%20create%20Gen2%20images%2C%20then%20you%20need%20to%20use%20a%20source%20Gen2%20image%2C%20and%20distribute%20to%20VHD.%20After%2C%20you%20will%20then%20need%20to%20create%20a%20Managed%20Image%20from%20the%20VHD%2C%20and%20inject%20it%20into%20the%20SIG%20as%20a%20Gen2%20image.%22%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Flinux%2Fimage-builder-json%23properties-source%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Flinux%2Fimage-builder-json%23properties-source%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2832967%22%20slang%3D%22en-US%22%3ERe%3A%20Azure%20Image%20Builder%20%26amp%3B%20Windows%2011%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2832967%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F65668%22%20target%3D%22_blank%22%3E%40Adri%C3%A1n%20Garc%C3%ADa%20Martinez%3C%2FA%3EHI%20yes%20-%20I%20already%20tried%20this%20approach%20but%20still%20didn't%20get%20it%20to%20work.%20The%20VM%20never%20comes%20back%20from%20a%20sysprep.%20I%20am%20not%20sure%20if%20this%20is%20a%20Win%2011%20Preview%20issue%20or%20not.%20As%20an%20aside%2C%20MS%20told%20me%20that%20they%20are%20looking%20at%20Gen%202%20support%20in%20AIB%20towards%20the%20end%20of%20this%20year.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2836079%22%20slang%3D%22en-US%22%3ERe%3A%20Azure%20Image%20Builder%20%26amp%3B%20Windows%2011%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2836079%22%20slang%3D%22en-US%22%3EI%20think%20I%20misunderstood%20the%20workaround%20myself%2C%20so%20I%20am%20going%20to%20retry%20now%20and%20will%20let%20you%20know%20if%20this%20works%20or%20not%20too...%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fdanielsollondon%2Fazvmimagebuilder%2Fissues%2F57%23issuecomment-684935782%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fdanielsollondon%2Fazvmimagebuilder%2Fissues%2F57%23issuecomment-684935782%3C%2FA%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F283436%22%20target%3D%22_blank%22%3E%40planetwilson%3C%2FA%3E%2C%20did%20you%20try%20to%20distribute%20to%20a%20VHD%20and%20then%20as%20a%20post%20deployment%20task%20get%20the%20VHD%20captured%20as%20a%20version%20to%20SIG%3F%3C%2FLINGO-BODY%3E
Occasional Contributor

Has anyone managed to get an image build working with AIB and Windows 11? The image I get doesn't seem to work correctly, I can't get a bootable VM from it. There are a number of errors but Packer is quite noisy normally anyway so hard to tell if normal or not, it might be failing around Windows update / Sysprep area.

4 Replies

Hello @planetwilson , I am also trying to get that to work... I believe the issue is with the vm generation.

".../... The following configuration requirements apply to VMs running Windows 11.

  • Generation: 2 *
  • Storage: 64 GB or greater
  • Security: Secure Boot capable, virtual TPM enabled
  • Memory: 4 GB or greater
  • Processor: 2 or more virtual processors .../..."

https://docs.microsoft.com/en-us/windows/whats-new/windows-11-requirements#virtual-machine-support

 

So...We need gen 2 vms to run windows 11, and AIB only creates Gen1.  I believe that we will need to follow this workaround:

 

" Image Builder currently only natively supports creating Hyper-V generation (Gen1) 1 images to the Azure Shared Image Gallery (SIG) or Managed Image. If you want to create Gen2 images, then you need to use a source Gen2 image, and distribute to VHD. After, you will then need to create a Managed Image from the VHD, and inject it into the SIG as a Gen2 image."

https://docs.microsoft.com/en-us/azure/virtual-machines/linux/image-builder-json#properties-source

 

@Adrián García MartinezHI yes - I already tried this approach but still didn't get it to work. The VM never comes back from a sysprep. I am not sure if this is a Win 11 Preview issue or not. As an aside, MS told me that they are looking at Gen 2 support in AIB towards the end of this year.

I think I misunderstood the workaround myself, so I am going to retry now and will let you know if this works or not too...
https://github.com/danielsollondon/azvmimagebuilder/issues/57#issuecomment-684935782
@planetwilson, did you try to distribute to a VHD and then as a post deployment task get the VHD captured as a version to SIG?

I can confirm that it works. Its a bit cumbersome but once scripted it's the same...
You have to use a managed image as the source to your vm in the template, then distribute to a VHD ; this is an option within the template, just make sure not to delete the resource group as the VHD will be stored in the VHDS container of the temporary resource group storage account.
Once that is complete, create a managed image out of that VHD and then publish it to the SIG.
VMs deployed from that image version work perfectly fine. 

At least we do not need to wait for MSFT to release this feature! Let me know if its not clear and I will be happy to help you.