Skip to content

VirtualBox path is not autodetected on Windows

Summary

The VirtualBox executor does not detect the VirtualBox installation, as opposed to e.g. Linux.

Steps to reproduce

  1. Install Runner on Windows.

  2. Register a virtualbox executor:

    gitlab-runner register --executor "virtualbox" --virtualbox-base-name="windows" --ssh-user root --ssh-password='Passw0rd!' --ssh-identity-file="%HOME$/.ssh/id_rsa" --url "https://gitlab.com/" --description "gitlab.com Windows VirtualBox runner" --tag-list "virtualbox,gitlab.com,windows" --locked="false" --access-level="not_protected" --registration-token="<your token>" --non-interactive
  3. Start runner:

    gitlab-runner -debug run
  4. Run a simple job against the virtualbox executor (should fail because VirtualBox is not found):

    ERROR: Preparation failed: exec: "vboxmanage": executable file not found in %PATH%
  5. Install VirtualBox on the Windows box.

  6. Re-run job (should execute correctly without changes now)

.gitlab-ci.yml
start_evaluation:
  script:
    - date > .date
    - echo Done
  tags: [virtualbox]

Actual behavior

The VirtualBox installation is not found.

ERROR: Preparation failed: exec: "vboxmanage": executable file not found in %PATH%

Expected behavior

If VirtualBox is installed on the default path, the runner should automatically detect the installation and the CI job should succeed.

Edited by Pedro Pombeiro