{
"provisioners": [
{
"type": "shell",
"execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'",
"override": {
"BaseVM": {
"scripts": [
"scripts/base.sh"
]
}
}}
],
"builders": [{
"name" : "BaseVM",
"type": "vmware-vmx",
"source_path": "t/packer-vmware-iso.vmx",
"output_directory" : "output",
"headless" : false,
"ssh_username" : "vagrant",
"ssh_password" : "vagrant",
"ssh_wait_timeout" : "30m",
"ssh_pty" : true,
"vmx_data": {
"memsize": "4096",
"numvcpus": "2"
},
"shutdown_command" : "echo '/sbin/halt -h -p' > /tmp/shutdown.sh; echo 'vagrant'|sudo -S sh '/tmp/shutdown.sh'"
}],
"post-processors": [
{
"type": "vagrant",
"override": {
"vmware": {
"output": "centos-7-0-x64-vmware-basevm.box"
}
}
}
]
}
packer build packerVM.json
BaseVM output will be in this color.
==> BaseVM: Cloning source VM...
==> BaseVM: Starting virtual machine...
==> BaseVM: Waiting 10s for boot...
==> BaseVM: Connecting to VM via VNC
==> BaseVM: Typing the boot command over VNC...
==> BaseVM: Waiting for SSH to become available...
==> BaseVM: Connected to SSH!
==> BaseVM: Provisioning with shell script: scripts/base.sh
BaseVM: [sudo] password for vagrant: Loaded plugins: fastestmirror
BaseVM: base | 3.6 kB 00:00
BaseVM: extras | 3.4 kB 00:00
BaseVM: updates | 3.4 kB 00:00
BaseVM: (1/4): base/7/x86_ | 155 kB 00:01
BaseVM: (2/4): extras/7/x8 | 165 kB 00:01
BaseVM: (3/4): base/7/x86_ | 5.3 MB 00:08
BaseVM: (4/4): updates/7/x | 7.8 MB 00:14
BaseVM: Determining fastest mirrors
BaseVM: Resolving Dependencies
BaseVM: --> Running transaction check
BaseVM: ---> Package NetworkManager.x86_64 1:1.0.6-27.el7 will be updated
BaseVM: ---> Package NetworkManager.x86_64 1:1.0.6-31.el7_2 will be an update
After this step packer terminates. When I try to run packer in debug mode I was not able to see any output and hangs near "==> BaseVM: Waiting for SSH to become available..."