Skip to content

[Reslove IT] SSH timeout problem when use centos7 kickstarter within the kvm builder

wangxf edited this page Feb 18, 2019 · 1 revision

When run packer build command, I want to build a centos7.qcow2 format image. I occur some issue as follows: " 2019/02/18 09:37:33 packer: 2019/02/18 09:37:33 [INFO] Attempting SSH connection... 2019/02/18 09:37:33 packer: 2019/02/18 09:37:33 [DEBUG] reconnecting to TCP connection for SSH 2019/02/18 09:37:33 packer: 2019/02/18 09:37:33 [DEBUG] handshaking with SSH 2019/02/18 09:37:33 packer: 2019/02/18 09:37:33 [DEBUG] SSH handshake err: ssh: handshake failed: read tcp 127.0.0.1:59216->127.0.0.1:4333: read: connection reset by peer " Oh my god, I didn't know how to resolved it. less debug information. I tried to follow debug mode:

  1. add para 'vnc_bind_address' and binding 0.0.0.0 to vnc serve.
  2. now i can watch the installing progress.
  3. you can note any problems in the installing progess. and the other hand, My kickstarter files is have some issue, "part /boot/ --fstype xfs --size=2048 --ondisk=sda", because the <disk_interface> is virtio, the ondisk is vda or remove the flag. Now, fix above issues, and rebuild it. done.