Skip to content

virtualbox-vm builder crashes when no "attach_snapshot" is specified or is null #8904

@bmhenry

Description

@bmhenry

Overview of the Issue

The virtualbox-vm builder crashes if attach_snapshot is null, empty, or missing.

Reproduction Steps

In short: make a config that should load an existing, imported VM, leaving attach_snapshot out.

Example config:

{
   "builders": [
      {
         "disable_shutdown": "false",
         "guest_additions_mode": "disable",
         "headless": "true",
         "keep_registered": true,
         "name": "onprem-k8s-step",
         "output_directory": "./images/onprem_k8s",
         "shutdown_command": "/sbin/halt -p",
         "shutdown_timeout": "5m",
         "skip_export": true,
         "ssh_password": "changeme",
         "ssh_timeout": "5m",
         "ssh_username": "root",
         "target_snapshot": "step_00",
         "type": "virtualbox-vm",
         "vm_name": "onprem_k8s"
      }
   ],
   "provisioners": [
      {
         "inline": [
            "echo ==============================",
            "echo   Making initial snapshot...  ",
            "echo =============================="
         ],
         "type": "shell-local"
      }
   ]
}

Packer version

1.5.4

Operating system and Environment details

Linux x86-64, Pop OS 19.10, using precompiled binary

Log Fragments and crash.log files

Crash log atached

crash.log

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions