Skip to content
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

Getting SSH Handshake Failed on Alma 9 #172

Open
AkashRajvanshi opened this issue May 1, 2024 · 6 comments
Open

Getting SSH Handshake Failed on Alma 9 #172

AkashRajvanshi opened this issue May 1, 2024 · 6 comments
Assignees
Labels
question Further information is requested

Comments

@AkashRajvanshi
Copy link

Hi, I'm trying to build Alma 9 images, but I'm encountering an SSH handshake error: 'ssh: handshake failed: read tcp 127.0.0.1:59326->127.0.0.1:3346: read: connection reset by peer'. Can you please help?"

Screenshot_20240501_124309

@LKHN LKHN self-assigned this May 1, 2024
@LKHN
Copy link
Member

LKHN commented May 1, 2024

Hi Akash, Could you please share more information from you setup?

  • Which image are trying to build?
  • Host OS
  • Packer version

@AkashRajvanshi
Copy link
Author

Hi @LKHN , below are the required details of my environment:

  • Which image are you trying to build?
    qemu.almalinux-9-gencloud-x86_64

  • Host OS:
    Kubuntu 22.04.4 LTS x86_64

  • Packer version:
    Packer v1.10.3

Building BIOS images is working, but when I try for UEFI, it gets stuck on the SSH connection part.

@AkashRajvanshi
Copy link
Author

Hi @LKHN , I tried building UEFI images and also opened a local VNC viewer. It shows on screen "guest has not initialized the display (yet)", while the console is attempting to SSH into it.

Packer Logs:

2024/05/04 09:33:24 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:33:24 Special code '<enter>' found, replacing with: 0xFF0D
2024/05/04 09:33:24 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:33:24 [INFO] Waiting 1s
    qemu.almalinux-9-gencloud-x86_64: Not using a NetBridge -- skipping StepWaitGuestAddress
==> qemu.almalinux-9-gencloud-x86_64: Using SSH communicator to connect: 127.0.0.1
2024/05/04 09:33:25 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:33:25 [INFO] Waiting for SSH, up to timeout: 1h0m0s
==> qemu.almalinux-9-gencloud-x86_64: Waiting for SSH to become available...
2024/05/04 09:33:25 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:33:25 [INFO] Attempting SSH connection to 127.0.0.1:2291...
2024/05/04 09:33:25 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:33:25 [DEBUG] reconnecting to TCP connection for SSH
2024/05/04 09:33:25 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:33:25 [DEBUG] handshaking with SSH
2024/05/04 09:34:25 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:34:25 [DEBUG] SSH handshake err: Timeout during SSH handshake
2024/05/04 09:34:32 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:34:32 [INFO] Attempting SSH connection to 127.0.0.1:2291...
2024/05/04 09:34:32 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:34:32 [DEBUG] reconnecting to TCP connection for SSH
2024/05/04 09:34:32 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:34:32 [DEBUG] handshaking with SSH
2024/05/04 09:35:32 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:35:32 [DEBUG] SSH handshake err: Timeout during SSH handshake
2024/05/04 09:35:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:35:39 [INFO] Attempting SSH connection to 127.0.0.1:2291...
2024/05/04 09:35:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:35:39 [DEBUG] reconnecting to TCP connection for SSH
2024/05/04 09:35:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:35:39 [DEBUG] handshaking with SSH
2024/05/04 09:36:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:36:39 [DEBUG] SSH handshake err: Timeout during SSH handshake
2024/05/04 09:36:46 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:36:46 [INFO] Attempting SSH connection to 127.0.0.1:2291...
2024/05/04 09:36:46 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:36:46 [DEBUG] reconnecting to TCP connection for SSH
2024/05/04 09:36:46 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:36:46 [DEBUG] handshaking with SSH
2024/05/04 09:37:46 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:37:46 [DEBUG] SSH handshake err: Timeout during SSH handshake
2024/05/04 09:37:53 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:37:53 [INFO] Attempting SSH connection to 127.0.0.1:2291...
2024/05/04 09:37:53 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:37:53 [DEBUG] reconnecting to TCP connection for SSH
2024/05/04 09:37:53 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:37:53 [DEBUG] handshaking with SSH
2024/05/04 09:38:53 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:38:53 [DEBUG] SSH handshake err: Timeout during SSH handshake
2024/05/04 09:39:00 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:39:00 [INFO] Attempting SSH connection to 127.0.0.1:2291...
2024/05/04 09:39:00 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:39:00 [DEBUG] reconnecting to TCP connection for SSH
2024/05/04 09:39:00 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:39:00 [DEBUG] handshaking with SSH
2024/05/04 09:40:00 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:40:00 [DEBUG] SSH handshake err: Timeout during SSH handshake
2024/05/04 09:40:07 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:40:07 [INFO] Attempting SSH connection to 127.0.0.1:2291...
2024/05/04 09:40:07 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:40:07 [DEBUG] reconnecting to TCP connection for SSH
2024/05/04 09:40:07 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:40:07 [DEBUG] handshaking with SSH
2024/05/04 09:41:07 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:41:07 [DEBUG] SSH handshake err: Timeout during SSH handshake
2024/05/04 09:41:14 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:41:14 [INFO] Attempting SSH connection to 127.0.0.1:2291...
2024/05/04 09:41:14 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:41:14 [DEBUG] reconnecting to TCP connection for SSH
2024/05/04 09:41:14 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:41:14 [DEBUG] handshaking with SSH
2024/05/04 09:42:14 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:42:14 [DEBUG] SSH handshake err: Timeout during SSH handshake
2024/05/04 09:42:21 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:42:21 [INFO] Attempting SSH connection to 127.0.0.1:2291...
2024/05/04 09:42:21 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:42:21 [DEBUG] reconnecting to TCP connection for SSH
2024/05/04 09:42:21 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/05/04 09:42:21 [DEBUG] handshaking with SSH

@LKHN
Copy link
Member

LKHN commented May 20, 2024

@AkashRajvanshi

I just tested the the distros listed below because of the #176 . Haven't experienced any issue.

Can you clone the repo and test again with the recently merged changes?

  • Debian 12
  • Debian 11
  • Fedora 40
  • Fedora 39
  • Fedora 38
  • Ubuntu 24.04 LTS
  • Ubuntu 22.04 LTS
  • Ubuntu 20.04 LTS
  • OpenSUSE Leap 15.6

@VladyslavTkachenkoDesy
Copy link

VladyslavTkachenkoDesy commented Sep 2, 2024

Hi @LKHN , I did the test with :
Packer 1.11.2
Host: Ubuntu 22.04
Image: qemu.almalinux-9-gencloud-x86_64

The only think that I changed is that it create LVM, but should not be an issue. As a result has the same SSH issue. Any suggestions?

@LKHN
Copy link
Member

LKHN commented Sep 9, 2024

@VladyslavTkachenkoDesy

Can you disable the headless mode to able to see whether the VM is booted after the installation or not?

export PKR_VAR_headless='false'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants