3

When I am building a win 7 box using packer, it hangs waiting for SSH to be available:

==> virtualbox-iso: Downloading or copying Guest additions
    virtualbox-iso: Downloading or copying: file:///vb/VBoxGuestAdditions.iso
==> virtualbox-iso: Downloading or copying ISO
    virtualbox-iso: Downloading or copying: file:///home/foo/win7_prof.iso
==> virtualbox-iso: Creating floppy disk...
    virtualbox-iso: Copying: ./answer_files/7/Autounattend.xml
    virtualbox-iso: Copying: ./scripts/dis-updates.ps1
    virtualbox-iso: Copying: ./scripts/microsoft-updates.bat
    virtualbox-iso: Copying: ./scripts/win-updates.ps1
    virtualbox-iso: Copying: ./scripts/openssh.ps1
    virtualbox-iso: Copying: ./scripts/oracle-cert.cer
==> virtualbox-iso: Creating virtual machine...
==> virtualbox-iso: Creating hard drive...
==> virtualbox-iso: Attaching floppy disk...
==> virtualbox-iso: Creating forwarded port mapping for SSH (host port 3143)
==> virtualbox-iso: Executing custom VBoxManage commands...
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1420575242 --memory 2048
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1420575242 --cpus 2
==> virtualbox-iso: Starting the virtual machine...
==> virtualbox-iso: Waiting 2m0s for boot...
==> virtualbox-iso: Typing the boot command...
==> virtualbox-iso: Waiting for SSH to become available...

Any experience with resolving this ?

  • Initially I also wondered why it hangs (btw, I'm on Linux). In my case it was working fine (no hangs), but virtualbox was in headless mode and I didn't see any activity. In your template file, try adding "headless": false in virtualbox builder and see what happens. Please report back. – Paolo Feb 15 '15 at 18:54
  • How long do you let it sit at the Waiting for SSH to become available... before you came to the assumption that it's just hung up? – Kuberchaun Aug 21 '15 at 21:15
0

Packer currently requires that an SSH server is installed and running in the guest OS (virtual machine).

Edit Autounattend.xml and add the command that installs OpenSSH. Make sure it's the last command and that the Order is correct.

Reference: https://github.com/joefitzgerald/packer-windows/issues/141#issuecomment-82056372

For an example command and script that installs OpenSSH, see https://github.com/joefitzgerald/packer-windows/blob/master/answer_files/7/Autounattend.xml and https://github.com/joefitzgerald/packer-windows/blob/develop/scripts/openssh.ps1

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.