Hey Guys. I have an issue with telling Packer to provision my shell scripts. When I debugged using the PACKER_LOG I got this
2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 [DEBUG] Opening new ssh session
2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 [DEBUG] Starting remote scp process: scp -vt /tmp
2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 [DEBUG] Started SCP session, beginning transfers...
2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 [DEBUG] scp: Uploading script_4852.sh: perms=C0666 size=275
2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 [DEBUG] SCP session complete, closing stdin pipe.
2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 [DEBUG] Waiting for SSH session to complete.
2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 [DEBUG] non-zero exit status: 1
2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 [DEBUG] scp output: Broken pipe
2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 Retryable error: Error uploading script: Process exited with status 1
2018/06/08 15:42:50 packer.exe: 2018/06/08 15:42:50 [INFO] 264 bytes written for 'uploadData'
2018/06/08 15:42:50 [INFO] 264 bytes written for 'uploadData'
I am developing Packer on Windows 10 and I am using Packer to create an Ubuntu operation system.
This is my Packer provision code
"provisioners": [
{
"type": "shell",
"script": "C:/Users/SavageHacker/automation/packer/scripts/install-virtualbox-guest-additions.sh"
}],
This is my shell scripts
#!/bin/bash
# Mount the disk image
cd /tmp
mkdir /tmp/isomount
mount -t iso9660 -o loop /root/VBoxGuestAdditions.iso /tmp/isomount
# Install the drivers
/tmp/isomount/VBoxLinuxAdditions.run
# Cleanup
umount isomount
rm -rf isomount /root/VBoxGuestAdditions.iso
Lastly, this is what I see on my Windows 10 powershell when I run packer

The reason it deregister and deletes the VM because it receives a signal interrupt.