Packer always stops when script exits with a non zero exit code. Try adding "set -x" at the top of your script (after the shebang) and se why it fails.
You can also run packer build with -on-error=ask to get time to ssh into the VM and research the state it is in when it fails. On 6 January 2018 at 05:34, Robert Wang <[email protected]> wrote: > I used packer to build ubuntu 17 box, it stop and destroy vm for any error > message, > > virtualbox-iso: VirtualBox Guest Additions: modprobe vboxsf failed > ==> virtualbox-iso: Deregistering and deleting VM... > ==> virtualbox-iso: Deleting output directory... > Build 'virtualbox-iso' errored: Script exited with non-zero exit status: 2 > > It never stop when build centos 7 for same error. > > Is any way to prevent to stop and destroy vm when get error? > > env: > > win7 + msys64 > > $ packer version > Packer v1.1.3 > > > > Thanks. > > BR/ > Robert > > -- > 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 [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/packer-tool/f08246a0-8a43-4e53-ab89-ce357fcecea7%40googlegroups.com > <https://groups.google.com/d/msgid/packer-tool/f08246a0-8a43-4e53-ab89-ce357fcecea7%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CALz9Rt_WU36VqTabbGY7u5NnPUozFs975Y3pu%3DjWQ_2gHyCpnA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
