Vagrant Error

I came across a situation where “vagrant up” just wasn’t successful. “vagrant halt” and “vagrant destroy” didn’t do it. I even removed everything from ~/.vagrant.d but it still kept on failing with the following error.

There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["import", "/home/hiriumi/.vagrant.d/boxes/oraclelinux-VAGRANTSLASH-7/7.9.289/virtualbox/box.ovf", "--vsys", "0", "--vmname", "OL7U9_x86_64-vagrant-virtualbox-b289_1643606820210_37412", "--vsys", "0", "--unit", "11", "--disk", "/media/hiriumi/extra/OL7U9_x86_64-vagrant-virtualbox-b289_1643606820210_37412/box-disk001.vmdk"]

Stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting /home/hiriumi/.vagrant.d/boxes/oraclelinux-VAGRANTSLASH-7/7.9.289/virtualbox/box.ovf...
Progress state: NS_ERROR_INVALID_ARG
VBoxManage: error: Appliance import failed
VBoxManage: error: Code NS_ERROR_INVALID_ARG (0x80070057) - Invalid argument value (extended info not available)
VBoxManage: error: Context: "RTEXITCODE handleImportAppliance(HandlerArg*)" at line 1119 of file VBoxManageAppliance.cpp

I even opened VirtualBox to check if a leftover VM was still there but there wasn’t. When I navigated to the directory where VirtualBox creates VMs and there was a directory leftover from the failed instance. I manually removed the directory where VirtualBox stores VM files and did “vagrant up” and then things came back to normal.

Hope this helps someone out there. 🙂