4

I am using chef to build dev environment on VirtualBox on my local machine. My local machine is Windows 7.

First I would like to excuse myself a little bit as I am totally new with all this Chef and vagrant environment, simply I was following instruction and now stuck with an error which I do not understand and in this case do not know how to fix it.

I have been told to go to vm folder in chef folders structure and run "bundle install" command. After a few problems I managed to install required gems. Now I need to run "kitchen converge" command to build virtual machine in oracle VM Box but on some stage during execution I got below error/exeption.

Class: Kitchen::ActionFailed
Message: Failed to complete #create action: Expected process to exit with
0, but received '1'
Begin output of vagrant ssh-config
STDOUT:
STDERR: 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: 122765
Your UID is: 0
End output of vagrant ssh-config 
Ran vagrant ssh-config returned 1

Please see .kitchen/logs/kitchen.log for more details
Also try running kitchen diagnose --all for configuration

I found this issue:

Vagrant Not Starting Up. User that created VM doesn't match current user

So I run the same command as Administrator but it did not help. The same issue.

Specifically I do not understand below command

VirtualBox requires that the same user be used to manage the VM that was created.

I guess chef is using specific user to build vagrant environment.

I wanted to stop and start Vagrant env from command line directly 'vagrant halt' but I got the same error.

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: 122765
Your UID is: 0

I would appreciate for any help. I would like to mention this is company machine and i have no access to change user privileges like UID ( even though I think it is only relevant to windows)

Community
  • 1
  • 1
Tomasz
  • 71
  • 1
  • 5

1 Answers1

3

For all of you who approached the same problem, solution is quite simply. At least was working for me.

First I run command

kitchen destroy

it will destroy your virtual box you have just created but be honest I do not think it is relevant.

Solution:

I had to remove .Vagrant folder from my user home directory where for windows the folder is located in C:\Users\(your user name)\.Vagrant

That will remove your vagrant instances.

Thank you and good luck.

Tomasz
  • 71
  • 1
  • 5