-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSH error while building image with CentOS stream 9 cloud images #11656
Comments
Hi @kashifest |
Thanks for the reply, strangely that didnt help for us, still facing the same issue. |
We have the same issue with the RHEL 9 beta images. It seems to be related to the stronger crypto policy requirements on recent OS releases. By running packer in debug mode, we paused after the VM was created, but before packer tries to connect to it using SSH. While packer is waiting we connect to the machine with ssh (regular OpenSSH, which works just fine) and run After that we continue the packer process which now works just fine. Packer can connect with SSH and starts to do the tasks in our packer file. Our conclusion is that the internal SSH agent used by packer is not up to date with contemporary requirements. It can't handle the |
Same issue here with daily build Ubuntu 22.04 image (https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img). But we need a fix in packer to be able to use it properly with that future Ubuntu release. |
This is really important to fix. |
We have the same issue with a Windows Server 2019 image patched with the latest Windows Updates. ==> amazon-ebs.base: Error waiting for SSH: Packer experienced an authentication error when trying to connect via SSH. This can happen if your username/password are wrong. You may want to double-check your credentials as part of your debugging process. original error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain Packer version 1.8.0 |
Same problem -- Packer cannot build images based on 22.04. I incorrectly blamed cloud-init, but it turns out Packer's SSH keys are too insecure for 22.04 to accept. https://bugs.launchpad.net/cloud-init/+bug/1968360 |
Here's a workaround based on #11656 (comment):
|
Currently using this workaround for CentOS 9 Stream on OpenStack:
Where
|
At least hashicorp developers should be aware about this, because terraform is affected as well. I assume packer and terraform uses the same golang code base: I post the terraform issue here, because it contains a good bug description and some links to the state in the go project And maybe hashicorp sees that both of their projects are affected and can synergize their ressources. |
Thanks a lot everyone for the suggestions, I have already got it in a working shop following your suggestions, I just wonder when will a maintainer acknowledge this issue and try to land a fix in packer. |
In my case I was able to use a ssh key based on elliptic curve instead of rsa. Example with linux ssh keygen
Looks like the go / packer code is ok with that. |
Having the same problem with Ubuntu 22.04, but with EDIT: I tried one of the workaround for the However, In short, it seems for certain |
Likely the same root cause as this issue: #8609 |
at least for |
confirmed, didn't know the |
Would be nice to use Local Virtualbox ISO build
|
|
Found a solution for |
Hi folks a potential fix for this issue has been merged into Packer main. It is scheduled to be released next week but will be available in the next nightly release. The SSH communication is handled by the Packer Plugin SDK within each of the builders. So even though Packer has the latest SDK the plugin responsible for executing the builder will need to be updated as well in order for the fix to work. We are tracking individual plugin updates in #11761. To download the latest plugin you can run note: The latest nightly has the fix #11712 which should help folks using JSON |
Oh one more thing 😄 If you are still running into issues with the proposed fix please feel free to drop a comment on the thread and we will gladly reopen. Thanks again to everyone for providing workarounds and for your patience. |
@nywilken I seem to still be running into issues with the Config as follows:
Logs as follows:
Would be grateful for any pointers if you think the issue might lie on my end :) |
@onematchfox we released a new version of packer-plugin-virtualbox today that should fix this issue. You can install the latest version of the plugin by updating the pinned version in your template and running There will be a new nightly release of Packer in a few minutes that has been updated with all of the newly released plugins as well. We are planning to ship 1.8.1 soon. |
Thanks for this. I can confirm that it works fine now. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.
Overview of the Issue
While building an image on CentOS stream 9 cloud image, we are facing the following error:
If we only change to CentOS stream 8 cloud image in the whole process, the build is passing. It seems packer is facing issues while SSH handshake in CentOS stream 9.
Packer version
From
packer version
1.6.5
Operating system and Environment details
OS, Architecture, and any other information you can provide about the
environment.
https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-20220309.0.x86_64.qcow2
The text was updated successfully, but these errors were encountered: