Forum Discussion

Raxx024's avatar
Raxx024
Copper Contributor
May 10, 2023

window Image not build using packer

Getting the below error in build while creating the linux image using packer:-

1 Reply

  • Take this:

     

    1. 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.
    2. 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.
    3. 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.
    4. 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.
    5. Provisioner Script Errors
      If your shell or Ansible provisioners fail, check the logs for syntax errors or missing dependencies.

Resources