I have also experienced this error in a more or less random way. I've tracked it to the sequence of events related to the vm creation process listed below. My understanding is that it is due to race condition between the preparation of the vm and the kapua build process. In between the vm is stopped and then started, but sometimes this process doesn't work as expected:
==> default: Attempting graceful shutdown of VM...
==> default: Clearing any previously set forwarded ports...
==> default: Exporting VM...
==> default: Compressing package to: /home/pablo/workspace/kapua/dev-tools/src/main/vagrant/baseBox/kapua-box-tmp/trusty64-kapua-dev-0.1.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'trusty64/kapua-dev-box-0.1' (v0) for provider:
box: Unpacking necessary files from: file:///home/pablo/workspace/kapua/dev-tools/src/main/vagrant/baseBox/kapua-box-tmp/trusty64-kapua-dev-0.1.box
==> box: Successfully added box 'trusty64/kapua-dev-box-0.1' (v0) for 'virtualbox'!
==> default: Destroying VM and associated drives...
... done.
creating demo vagrant machine
======> start demo vagrant machine
======> destroy old machine
==> default: VM not created. Moving on...
======> delete old Vagrant file
======> kapua vagrant demo machine... starting
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'trusty64/kapua-dev-box-0.1'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: demo
The name of your virtual machine couldn't be set because VirtualBox
is reporting another VM with that name already exists. Most of the
time, this is because of an error with VirtualBox not cleaning up
properly. To fix this, verify that no VMs with that name do exist
(by opening the VirtualBox GUI). If they don't, then look at the
folder in the error message from VirtualBox below and remove it
if there isn't any information you need in there.
VirtualBox error:
VBoxManage: error: Could not rename the directory '/home/pablo/VirtualBox VMs/kapua-box-tmp_default_1483464707091_60906_1483464959294_527' to '/home/pablo/VirtualBox VMs/demo' to save the settings file (VERR_ALREADY_EXISTS)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "SaveSettings()" at line 3016 of file VBoxManageModifyVM.cpp