Vagrant: vboxmanage fails after changing user name

Created on 29 Sep 2015  ยท  9Comments  ยท  Source: hashicorp/vagrant

After changing my user name 'vagrant up' now fails due to trying to use my old user name in some place (new: mis6541, old: mxs8934). Vagrant up with instance used from before user name change yields:

Command: ["import", "/home/mis6541/.vagrant.d/boxes/chef-VAGRANTSLASH-centos-6.6/1.0.0/virtualbox/box.ovf", "--vsys", "0", "--vmname", "packer-centos-6.6-x86_64_1443536545252_14393", "--vsys", "0", "--unit", "7", "--disk", "/home/mxs8934/VirtualBox VMs/packer-centos-6.6-x86_64_1443536545252_14393/packer-centos-6.6-x86_64-disk1.vmdk"]

Stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting /home/mis6541/.vagrant.d/boxes/chef-VAGRANTSLASH-centos-6.6/1.0.0/virtualbox/box.ovf...
OK.
0%...
Progress state: VBOX_E_IPRT_ERROR
VBoxManage: error: Appliance import failed
VBoxManage: error: Could not create the directory '/home/mxs8934/VirtualBox VMs/packer-centos-6.6-x86_64_1443536545252_14393' (VERR_ACCESS_DENIED)
VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component ApplianceWrap, interface IAppliance
VBoxManage: error: Context: "RTEXITCODE handleImportAppliance(HandlerArg*)" at line 876 of file VBoxManageAppliance.cpp

This also occurs when using otto with obviously a fresh instance from after the user name change:

Command: ["import", "/home/mis6541/.vagrant.d/boxes/hashicorp-VAGRANTSLASH-precise64/1.1.0/virtualbox/box.ovf", "--vsys", "0", "--vmname", "precise64_1443536237256_50750", "--vsys", "0", "--unit", "9", "--disk", "/home/mxs8934/VirtualBox VMs/precise64_1443536237256_50750/box-disk1.vmdk"]

Stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting /home/mis6541/.vagrant.d/boxes/hashicorp-VAGRANTSLASH-precise64/1.1.0/virtualbox/box.ovf...
OK.
0%...
Progress state: VBOX_E_IPRT_ERROR
VBoxManage: error: Appliance import failed
VBoxManage: error: Could not create the directory '/home/mxs8934/VirtualBox VMs/precise64_1443536237256_50750' (VERR_ACCESS_DENIED)
VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component ApplianceWrap, interface IAppliance
VBoxManage: error: Context: "RTEXITCODE handleImportAppliance(HandlerArg*)" at line 876 of file VBoxManageAppliance.cpp

Thought this may be due to some stale cache file being used in vagrant.d but:

find /home/mis6541/.vagrant.d/. -type f | xargs grep mxs

Binary file /home/mis6541/.vagrant.d/./boxes/chef-VAGRANTSLASH-centos-6.6/1.0.0/virtualbox/packer-centos-6.6-x86_64-disk1.vmdk matches
Binary file /home/mis6541/.vagrant.d/./boxes/hashicorp-VAGRANTSLASH-precise64/1.1.0/virtualbox/box-disk1.vmdk matches

vagrant/plugins/providers/virtualbox/driver.base.rb has the function definition at line 326 but I was unsure where the faulty array and the specific function call are.

Vagrant 1.7.4
VirtualBox-5.0-5.0.2_102096_el7
CentOS 7.1
bug core

Most helpful comment

Ah, hah. This is actually a VirtualBox setting. You'll need to go to VirtualBox => Preferences to fix this. They have some hardcoded paths when you first run VirtualBox. :(

All 9 comments

Hi @mschuchard

Thank you for opening an issue. Unfortunately there is no way for Vagrant to know that you changed your username, let alone what you changed it to. Vagrant relies on file paths (often absolute) to store important metadata information about the running machines in Virtualbox.

The easiest way to fix this issue is to remove the .vagrant directory in your affected project(s). I realize this might not be the most glamorous approach, but unfortunately it is difficult for Vagrant to behave well when the environment has changed out of band.

Removing that directory would certainly affect my project that existed before the username change, but the vagrant project initialized from otto was after the username change.

I can try it the next time I have access to the affected environment, but it seems that intuitively this solution would not work for the post-username change projects, such as the one created by otto, since this directory is intra-project and not inter-project.

Just confirmed that neither removing .vagrant in the pre-username change vagrant project nor removing the .otto in the post-username change otto project fixed the issue.

Ah, hah. This is actually a VirtualBox setting. You'll need to go to VirtualBox => Preferences to fix this. They have some hardcoded paths when you first run VirtualBox. :(

Thanks, going to give that a try.

This happened to me as well. I had even uninstall VirtualBox but still had the problem. Their uninstall tool must not clean up everything.

HI Bro,
i find same the error . how to fix this issues ?

The solution to this issues is to change the configuration of the virtual box.
See environmental setting and general menu.

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dorinlazar picture dorinlazar  ยท  3Comments

hesco picture hesco  ยท  3Comments

mpontillo picture mpontillo  ยท  3Comments

jsirex picture jsirex  ยท  3Comments

cbednarski picture cbednarski  ยท  3Comments