[root@centos-test ubuntu_64]# packr build server.json
virtualbox-iso output will be in this color.
==> virtualbox-iso: Downloading or copying Guest additions
virtualbox-iso: Downloading or copying: file:///usr/share/virtualbox/VBoxGuestAdditions.iso
==> virtualbox-iso: Downloading or copying ISO
virtualbox-iso: Downloading or copying: http://releases.ubuntu.com/14.04/ubuntu-14.04.4-server-amd64.iso
==> virtualbox-iso: Starting HTTP server on port 9001
==> virtualbox-iso: Creating virtual machine...
==> virtualbox-iso: Creating hard drive...
==> virtualbox-iso: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 2555)
==> virtualbox-iso: Executing custom VBoxManage commands...
virtualbox-iso: Executing: modifyvm server.local --memory 1536
virtualbox-iso: Executing: modifyvm server.local --cpus 1
virtualbox-iso: Executing: modifyvm server.local --natpf1 guest_ssh,tcp,,2022,,22
virtualbox-iso: Executing: modifyvm server.local --natpf1 postgres,tcp,,5432,,5432
virtualbox-iso: Executing: modifyvm server.local --natpf1 tomcat_http,tcp,,8080,,8080
virtualbox-iso: Executing: modifyvm server.local --natpf1 tomcat_https,tcp,,8443,,8443
==> virtualbox-iso: Starting the virtual machine...
==> virtualbox-iso: Waiting 20s for boot...
==> virtualbox-iso: Typing the boot command...
==> virtualbox-iso: Waiting for SSH to become available...
==> virtualbox-iso: Timeout waiting for SSH.
==> virtualbox-iso: Unregistering and deleting virtual machine...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Timeout waiting for SSH.
==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Timeout waiting for SSH.
==> Builds finished but no artifacts were created.
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/d22f3ed9-697e-4f76-bed5-93579c9daed9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
"ssh_disable_agent": true, "ssh_host": "localhost", "ssh_port": "2022",2) The shell script section cannot execute scripts in bash, despite the #!/bin/bash header. I've implemented a work-around to make this shell-friendly.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/d22f3ed9-697e-4f76-bed5-93579c9daed9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Alvaro
{ "type": "shell", "script": "scripts/vm_deploy.sh", "execute_command": "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'" },
so it will do sh <file>
i will say make the user to be able to sudo without password
and use a more simple scripts line, like
{ "type": "shell", "script": "scripts/vm_deploy.sh" },vm_deploy.sh#!/usr/bin/env bashecho "hello from the VM!!!"idsudo idAlvaro.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/582aea94-663d-4650-9e13-329b7bf6f9b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.