I created a fresh image using packer, using the following code: { "builders": [{ "type": "azure-arm", "client_id": "", "client_secret": "", "tenant_id": "", "subscription_id": "", "managed_image_resource_group_name": "", "managed_image_name": "", "os_type": "Windows", "image_publisher": "MicrosoftWindowsDesktop", "image_offer": "Windows-10", "image_sku": "RS5-PRO", "communicator": "winrm", "winrm_use_ssl": true, "winrm_insecure": true, "winrm_timeout": "5m", "winrm_username": "packer", "azure_tags": { "dept": "", "task": "" } , "location": "North Europe", "vm_size": "Standard_DS2_v2" }], "provisioners": [ { "type": "powershell", "inline": [ "Set-Service RdAgent -StartupType Disabled", "Set-Service WindowsAzureTelemetryService -StartupType Disabled", "Set-Service WindowsAzureGuestAgent -StartupType Disabled", "remove-itemproperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\SysPrepExternal\\Generalize' -Name '*'", "if( Test-Path $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml )\{ rm $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml -Force} ", "& $env:SystemRoot\\System32\\Sysprep Sysprep.exe /oobe /generalize /quiet /quit", "while($true) { $imageState = Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup State | Select ImageState; if($imageState.ImageState -ne 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') { Write-Output $imageState.ImageState; Start-Sleep -s 10 } else { break } }" ] }] } ~ and it took 9 minutes for deployment. Kindly suggest if we are doing something wrong. this is only for windows-10 Desktop |