Kitchen create changing virtualbox default machine folder, failing to rename settings file when renaming vm

We’re setting up a new test machine for running test-kitchen and are having issues when running kitchen create on a kitchen.yml that is succeeding in another environment. After a bunch of research it appears that kitchen is modifying the default machine folder setting in virtualbox to be a directory in the .kitchen sub-directory. (something like D:{path to project}.kitchen\kitchen-vagrant\kitchen-test-windows-2012-r2-standard-x64) This then results in errors during the vagrant vm creation.

Kitchen Create
-----> Starting Kitchen (v1.17.0)
-----> Creating …
Bringing machine ‘default’ up with ‘virtualbox’ provider…
==> default: Setting the name of the VM: kitchen-test-project-arcfm-1021
There was an error while executing VBoxManage, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

   Command: ["modifyvm", "dc4152b6-28a7-4bd6-b34a-b5d857c33f98", "--name", " kitchen-test-project-test-windows-2012-r2-standard-x64_default_1503436827563_17249"]
   Stderr: VBoxManage.exe: error: Could not rename the settings file 'D:\git> \test-project\.kitchen\kitchen-vagrant\kitchen-test-project-test-window> s-2012-r2-standard-x64\kitchen-test-project-test-windows-2012-r2-standard-x64_default_1503436827563_17249\temp_clone_1503434592901_87400.vbox' to 'D:\gi> t\test-project\.kitchen\kitchen-vagrant\kitchen-test-project-test-windo> ws-2012-r2-standard-x64\kitchen-test-project-test-windows-2012-r2-standard-x64_default_1503436827563_17249\kitchen-test-project-test-windows-201> 2-r2-standard-x64_default_1503436827563_17249.vbox' (VERR_PATH_NOT_FOUND)        VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component SessionMachine, interface IMachine, callee IUnknown        VBoxManage.exe: error: Context: "SaveSettings()" at line 3060 of file VBo xManageModifyVM.cpp

If I navigate to the vagrantfile inside .kitchen and run vagrant up I get the same error. If I then change the default machine folder in virtualbox to d:\VirtualBox_VMs and re-run vagrant up the machine fails to come online with the same error - however, running vagrant destroy and then vagrant up the machine comes online properly.

Re-running kitchen create after hacking the path together then brings the machine online correctly. Running kitchen destroy then kitchen create reintroduces the same path issues.

Thoughts? Am I missing something that tells kitchen where to store vms?

This is a known bug introduced in kitchen-vagrant 1.2.0 (included in Chef DK 2.1.11). We’re working on a fix and new release of kitchen-vagrant today.

Fantastic! Thanks for the quick response. :sunglasses: