Skip to content

Instantly share code, notes, and snippets.

@vmadman
Last active August 1, 2017 17:12
Show Gist options
  • Save vmadman/f6686e9e16f99297d7c00e9b73645bf4 to your computer and use it in GitHub Desktop.
Save vmadman/f6686e9e16f99297d7c00e9b73645bf4 to your computer and use it in GitHub Desktop.
Packer log: Error deleting VM
{
"variables" : {
"source_name" : "centos-7.3-x86_64-raw-r1",
"headless" : "false",
"http_proxy" : "{{env `http_proxy`}}",
"https_proxy" : "{{env `https_proxy`}}",
"memory" : "2048",
"metadata" : "packer/floppy/dummy_metadata.json",
"name" : "centos-7.3",
"no_proxy" : "{{env `no_proxy`}}",
"template" : "centos-7.3-x86_64-dev-r1",
"scripts_root" : "packer/scripts/dev/centos",
"version" : "TIMESTAMP"
},
"builders" : [
{
"type" : "virtualbox-ovf",
"source_path" : "output/virtualbox/{{user `source_name`}}/{{user `source_name`}}.ovf",
"ssh_password" : "vagrant",
"ssh_port" : 22,
"ssh_username" : "root",
"ssh_wait_timeout" : "45s",
"guest_additions_path" : "VBoxGuestAdditions.iso",
"shutdown_command" : "echo 'vagrant'|sudo -S /sbin/halt -h -p",
"output_directory" : "output/virtualbox/{{user `template`}}",
"virtualbox_version_file" : ".vbox_version",
"headless" : "{{ user `headless` }}",
"boot_wait" : "30s",
"vm_name" : "{{ user `template` }}"
}
],
"post-processors" : [
{
"output" : "output/vagrant/{{user `template`}}.{{.Provider}}.box",
"type" : "vagrant",
"keep_input_artifact" : true
}
],
"provisioners" : [
{
"destination" : "/tmp/bento-metadata.json",
"source" : "{{user `metadata`}}",
"type" : "file"
},
{
"environment_vars" : [
"HOME_DIR=/home/vagrant",
"http_proxy={{user `http_proxy`}}",
"https_proxy={{user `https_proxy`}}",
"no_proxy={{user `no_proxy`}}"
],
"execute_command" : "echo 'vagrant' | {{.Vars}} sudo -S -E sh -eux '{{.Path}}'",
"scripts" : [
"{{user `scripts_root`}}/common/install-common-libs.sh"
],
"type" : "shell"
}
]
}
$ packer build packer/templates/centos-7-dev.json
virtualbox-ovf output will be in this color.
==> virtualbox-ovf: Downloading or copying Guest additions
virtualbox-ovf: Downloading or copying: file:///E:/Program%20Files/Oracle/VirtualBox/VBoxGuestAdditions.iso
==> virtualbox-ovf: Downloading or copying OVF/OVA
virtualbox-ovf: Downloading or copying: file:///F:/Projects/Personal/sysops/sysops-packer/output/virtualbox/centos-7.3-x86_64-raw-r1/centos-7.3-x86_64-raw-r1.ovf
==> virtualbox-ovf: Importing VM: F:/Projects/Personal/sysops/sysops-packer/output/virtualbox/centos-7.3-x86_64-raw-r1/centos-7.3-x86_64-raw-r1.ovf
==> virtualbox-ovf: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 3383)
==> virtualbox-ovf: Starting the virtual machine...
==> virtualbox-ovf: Waiting 30s for boot...
==> virtualbox-ovf: Typing the boot command...
==> virtualbox-ovf: Waiting for SSH to become available...
==> virtualbox-ovf: Timeout waiting for SSH.
==> virtualbox-ovf: Unregistering and deleting imported VM...
==> virtualbox-ovf: Error deleting VM: VBoxManage error: VBoxManage.exe: error: Cannot unregister the machine 'centos-7.3-x86_64-dev-r1' while it is locked
==> virtualbox-ovf: VBoxManage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee IUnknown
==> virtualbox-ovf: VBoxManage.exe: error: Context: "Unregister(CleanupMode_DetachAllReturnHardDisksOnly, ComSafeArrayAsOutParam(aMedia))" at line 155 of file VBoxManageMisc.cpp
==> virtualbox-ovf: Deleting output directory...
Build 'virtualbox-ovf' errored: Timeout waiting for SSH.
==> Some builds didn't complete successfully and had errors:
--> virtualbox-ovf: Timeout waiting for SSH.
==> Builds finished but no artifacts were created.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment