Kitchen converge fails on macOS 13.x / Ventura with latest (2.3.3) vagrant release

The version of the software I using are

Ventura 13.0.1
Virtualbox 7.0.2r154219
Vagrant 2.3.3
Chef
Chef Development Kit Version: 3.13.1
chef-client version: 14.14.29
kitchen version: 1.25.0
inspec version: 3.9.3

A normal Vagrant up is working as expected.

However a kitchen converge is failing with

STDERR: A customization command failed:
[“createhd”, “–filename”, “/tmp/kitchen-jira-data.vmdk”, “–size”, 10000]
The following error was experienced:
#<Vagrant::Errors::VBoxManageError: There was an error while executing VBoxManage, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: [“createhd”, “–filename”, “/tmp/kitchen-jira-data.vmdk”, “–size”, “10000”]
Stderr: 0%…VBOX_E_FILE_ERROR
VBoxManage: error: Failed to create medium
VBoxManage: error: Could not create the medium storage unit ‘/tmp/kitchen-jira-data.vmdk’.
VBoxManage: error: VDI: cannot create image ‘/tmp/kitchen-jira-data.vmdk’ (VERR_ALREADY_EXISTS)
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium
*VBoxManage: error: Context: "RTEXITCODE handleCreateMedium(HandlerArg )" at line 632 of file VBoxManageDisk.cpp
>
Please fix this customization and try again.
---- End output of vagrant up --no-provision --provider virtualbox ----
Ran vagrant up --no-provision --provider virtualbox returned 1] on default-centos7-cis
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running kitchen diagnose --all for configuration

However the file is created in the location it is specified.

Any suggestions would be greatly appreciated.

That line in the error message is stating that the disk cannot be created because it already exists. I’m not familiar with where this disk creation is occurring (if it’s in your local Vagrantfile or somewhere else) but it would appear that the guard around the creation of the disk is either incorrect or missing. I assume that the disk is ephemeral so you could probably just delete it manually and re-run given that nothing on that disk is needed.

Thanks for the reply.

I wasn’t probably clear enough in my initial post. The drive is set to be created in /tmp

The disk isn’t in the location and doing a kitchen converge runs through until that error.
The disk is then in /tmp, so it creates it, but then decides it already exists.
A kitchen destroy doesn’t remove the disk either.

Where the disk is being created is the important part of this. My guess is that it is defined in the Vagrantfile, but it’s only a guess. The issue is that the location where the disk creation command is defined is likely being evaluated multiple times, and there is no guard around the creation call that checks if the disk exists first. Making the disk creation be conditional based on the existence of the path will prevent the error.

Thanks, I’ll look into sorting that out.