Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The VirtualBox VM was created with a user that doesn't match the current user running Vagrant. #8630

Closed
815217607 opened this issue May 31, 2017 · 13 comments

Comments

@815217607
Copy link

mac 10.12.5
Vagrant 1.9.5
VirtualBox 5.1.22

The VirtualBox VM was created with a user that doesn't match the
current user running Vagrant. VirtualBox requires that the same user
be used to manage the VM that was created. Please re-run Vagrant with
that user. This is not a Vagrant issue.

The UID used to create the VM was: 0
Your UID is: 501

@zacker330
Copy link

try rm -r .vagrant.
I guess you copied or moved project folder from one place to another.

@bteague
Copy link

bteague commented Jul 10, 2017

Actually You don't need to delete the .vagrant. You need to update the creator_uid file in .vagrant/

The file should be in: .vagrant/machines/web/virtualbox/creator_uid

You may also need to assign the ownership for .vagrant/machines/web to the new uid as well.

Read this for more information:
http://albertech.blogspot.com/2016/11/fix-vagrant-error-virtualbox-vm-was.html

In addition you may need to change ownership of other files in your VM install such as:
provisioning/site.retry

@kikitux
Copy link
Contributor

kikitux commented Jul 20, 2017

doesn't include repro, doesn't seem a vagrant issue

@kikitux kikitux closed this as completed Jul 20, 2017
@mh-cbon
Copy link

mh-cbon commented Aug 24, 2017

I faced the problem now.

$ vagrant destroy -f
The VirtualBox VM was created with a user that doesn't match the
current user running Vagrant. VirtualBox requires that the same user
be used to manage the VM that was created. Please re-run Vagrant with
that user. This is not a Vagrant issue.

The UID used to create the VM was: 1001
Your UID is: 1000

I guess it is my responsibility, i suspect i made a mistake when i did some backup / restore long time ago.

Fact is i could not figure out the issue quickly.

Because it says it is not vagrant issue i was searching into virtualbox folders,
then i could not figure out which file was concerned (i was looking for something into ~),
so i lost time.

Finally i found this ticket and figured it out...

i suggest to improve that error message to make it more clear which files are concerned by the error.

@kosyfrances
Copy link
Contributor

I had this same issue after I deleted .vagrant.d folder. Removing .vagrant folder resolved it.

@hscheuerle
Copy link

hscheuerle commented Feb 19, 2018

just learning vagrant, but I ran into this issue and notice my uid's matched in the file location, but did not print to console.

My issue was that I tried to vagrant ssh from a different directory than the one I booted the VM from. Changing to the directory the shared folder is located worked for me. Good thing for beginners to note.

Also related to the question, I noticed that the UID I was assigned trying as root level was 0, you must have set the UID while running as root and then wouldn't match UID when trying not at root level access.

@GuidoRobertone
Copy link

That happens to me when the provisioning process was interrupted unexpectedly. And the usr id used to create the VM is NULL.

The VirtualBox VM was created with a user that doesn't match the
current user running Vagrant. VirtualBox requires that the same user
be used to manage the VM that was created. Please re-run Vagrant with
that user. This is not a Vagrant issue.

The UID used to create the VM was: 
Your UID is: 1000

I deleted .vagrant folder resolved it.

@collins-b
Copy link

collins-b commented Apr 14, 2018

Even though deleting .vagrant folder solves the issue, I don't think it's the best option. I prefer updating the uid to that of the current user here .vagrant/machines/<machine_name>/virtualbox/creator_uid.

@arkhoss
Copy link

arkhoss commented Sep 25, 2018

@bteague change the UID at creator_uid worked like a charm. Nice solution.

@chavychaze
Copy link

Need to dosudo -iand then direct to project directory, then I can run vagrant ssh, and start VM

@mattkenefick
Copy link

Would recommend people give @bteague 's suggestion a thought before blindly deleting the .vagrant folder.

The file should be in: .vagrant/machines/web/virtualbox/creator_uid

I recently copied all my VMs from a Macbook to a Windows SSD and started the re-configuration. It was much simpler for me to adjust the user ID in creator_uid than to redo the whole folder structure.

@raolivei
Copy link

raolivei commented Feb 1, 2019

The file should be in: .vagrant/machines/web/virtualbox/creator_uid

You may also need to assign the ownership for .vagrant/machines/web to the new uid as well.

Just correcting... "web" should be your vagrant VM name, in my case, "default". Hence:
vagrant/machines/default/virtualbox/creator_uid

@ghost
Copy link

ghost commented Mar 28, 2020

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.

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests