hashicorp / setup-packer

Run HashiCorp Packer as part of your GitHub Actions Workflow
https://github.com/marketplace/actions/setup-hashicorp-packer
Apache License 2.0
139 stars 83 forks source link

Failed creating VirtualBox driver: exec: "VBoxManage": executable file not found in $PATH #57

Closed Neudrino closed 1 year ago

Neudrino commented 2 years ago

Expected Behavior

A Virtualbox image is build on a given ISO image.

Current Behavior

Build 'virtualbox-iso' errored after 4 milliseconds 350 microseconds: Failed creating VirtualBox driver: exec: "VBoxManage": executable file not found in $PATH

Steps to Reproduce

Configure and run the following Github action .github/workflows/packer.yml:

on:
  push: null

jobs:
  packer-action:
    runs-on: ubuntu-latest
    steps:
      - name: Minimal packer configuration
        run: |
          tee packer.json << EOF
          {
            "builders": [
              {
              "type": "virtualbox-iso",
              "guest_os_type": "Ubuntu_64",
              "iso_url": "http://releases.ubuntu.com/12.04/ubuntu-12.04.5-server-amd64.iso",
              "iso_checksum": "md5:769474248a3897f4865817446f9a4a53",
              "ssh_username": "packer",
              "ssh_password": "packer",
              "shutdown_command": "echo 'packer' | sudo -S shutdown -P now",
              "post_shutdown_delay": "2m",
              "headless": true,
              "vboxmanage": [
                  [ "startvm", "{{.Name}}", "--type", "headless" ]
                ]
              }
            ]
          }

      - name: Validate Template
        uses: hashicorp/packer-github-actions@master
        with:
          command: validate
          arguments: -syntax-only
          target: packer.json
      - name: Build Artifact
        uses: hashicorp/packer-github-actions@master
        with:
          command: build
          arguments: "-on-error=abort"
          target: packer.json
        env:
          PACKER_LOG: 1

Environment

Neudrino commented 1 year ago

There is a job configured at https://github.com/hashicorp/packer-plugin-virtualbox/actions/workflows/test-plugin-example.yml, however it was never run. It would be good, if this job could be run at least once (better regularly) to verify that the workflow and plugin is actually working as expected.

ksatirli commented 1 year ago

Thank you for reporting this, @Neudrino!

You should be able to use the latest version of this Action to run this builder.

Please let me know if you run into any issues with it.