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

Packer VisualBox builder fails with ssh: unable to authenticate, attempted methods [none password], no supported methods remain #12224

Open
urmilajn opened this issue Jan 26, 2023 · 3 comments

Comments

@urmilajn
Copy link

urmilajn commented Jan 26, 2023

I'm using ubuntu-20.04.5-live-server-amd64.iso alongside virtualbox builder. The VM starts successfully only to fail connecting to host's SSH with below error:

2023/01/26 14:41:48 packer-builder-virtualbox-iso plugin: [INFO] Attempting SSH connection to 127.0.0.1:2455...
2023/01/26 14:41:48 packer-builder-virtualbox-iso plugin: [DEBUG] reconnecting to TCP connection for SSH
2023/01/26 14:41:48 packer-builder-virtualbox-iso plugin: [DEBUG] handshaking with SSH
2023/01/26 14:41:51 packer-builder-virtualbox-iso plugin: [DEBUG] SSH handshake err: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
packer version
# Packer v1.8.5

This is the user-data file I'm using where the username & password are ubuntu.

#cloud-config
autoinstall:
  version: 1
  early-commands:
    - systemctl stop ssh
  identity:
    hostname: ubuntu-server
    password: '$6$wdAcoXrU039hKYPd$508Qvbe7ObUnxoj15DRCkzC3qO7edjH0VV7BPNRDYK4QR8ofJaEEF2heacn0QgD.f8pO8SNp83XNdWG6tocBM1'
    username: ubuntu
  network:
    network:
      version: 2
      ethernets:
        ens33: {dhcp4: true, dhcp-identifier: mac}
  ssh:
    install-server: true
  late-commands:
    - sed -i 's/^#*\(send dhcp-client-identifier\).*$/\1 = hardware;/' /target/etc/dhcp/dhclient.conf

This is the .pkr.hcl file.

source "virtualbox-iso" "basic-example" {
  boot_command                 = ["<esc><wait><esc><wait><f6><wait><esc><wait>", "<bs><bs><bs><bs><bs>", "autoinstall ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ ", "--- <enter>"]
  boot_wait                    = "5s"
  pause_before_connecting      = "1m"
  guest_os_type                = "Ubuntu_64"
  http_directory               = "http"
  iso_checksum                 = "sha256:5035be37a7e9abbdc09f0d257f3e33416c1a0fb322ba860d42d74aa75c3468d4"
  iso_url                      = "/home/xxxxxx/Downloads/ubuntu-20.04.5-live-server-amd64.iso"
  disk_size                    = 10000
  memory                       = 1024
  ssh_username                 = "ubuntu"
  ssh_password                 = "ubuntu"
  ssh_timeout                  = "5m"
  shutdown_command             = "echo 'packer' | sudo -S shutdown -P now"
}

build {
  sources = ["sources.virtualbox-iso.basic-example"]

  provisioner "shell" {
    inline = ["while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done"]
  }
}

Are there any prerequisite steps that I'm missing?

@urmilajn urmilajn changed the title VisualBox builder fails with ssh: unable to authenticate, attempted methods [none password], no supported methods remain Packer visualBox builder fails with ssh: unable to authenticate, attempted methods [none password], no supported methods remain Jan 27, 2023
@urmilajn urmilajn changed the title Packer visualBox builder fails with ssh: unable to authenticate, attempted methods [none password], no supported methods remain Packer VisualBox builder fails with ssh: unable to authenticate, attempted methods [none password], no supported methods remain Jan 27, 2023
@urmilajn
Copy link
Author

After starting the build, sshing into the VM using ssh -p 2455 [email protected] just stalls the terminal.

@nkmadala-qumu
Copy link

Were you able to figure out the issue? I'm also having the same issue.

@urmilajn
Copy link
Author

I had to drop this approach. All the solutions out there did not work for me. However, I haven't looked at it in a year now.

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

No branches or pull requests

2 participants