Forum Discussion
Azure Image Builder & Windows 11
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.
- Adrián García MartinezCopper Contributor
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
- planetwilsonBrass Contributor
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.
- Adrián García MartinezCopper ContributorI 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?