Forum Discussion
Raxx024
May 10, 2023Copper Contributor
window Image not build using packer
Getting the below error in build while creating the linux image using packer:-
1 Reply
Take this:
- Authorization Issues
If you're deploying to Azure and see a 403 - AuthorizationFailed error (like in your PowerShell screenshot), it means your identity lacks permission to perform the deployment. - Make sure your user or service principal has the Contributor role on the target resource group.
- If you just updated permissions, run az login again or refresh your credentials.
- SSH Timeout or Connection Failures
Packer often hangs at “Waiting for SSH to become available.” - Check that the image boots correctly and SSH is enabled.
- Ensure the correct username/password or SSH key is configured.
- If using QEMU or VirtualBox, verify that port forwarding is set up properly.
- Insufficient Resources
Kernel panics or boot failures can happen if the VM doesn’t have enough memory or CPU. - Try setting memory = 2048 and cpus = 2 in your Packer template.
- Missing Communicator Settings
If you see “No communicator is set,” Packer doesn’t know how to connect to the VM. - Add communicator = "ssh" to your builder block.
- Specify ssh_username, ssh_password or ssh_private_key_file.
- Provisioner Script Errors
If your shell or Ansible provisioners fail, check the logs for syntax errors or missing dependencies.
- Authorization Issues