Should Vagrant require sudo for each team?

My question in short: I encounter a permission error every time I execute any Vagrant command without 'sudo' - from vagrant up to vagrant provision . Is this expected behavior?

 /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:295:in `unlink': Permission denied - /Users/Cibulka/Sites/.vagrant/machines/default/virtualbox/id (Errno::EACCES) from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:295:in `delete' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:295:in `id=' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:438:in `state' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/action/created.rb:11:in `call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116:in `call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `block in run' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in `busy' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `run' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/call.rb:43:in `call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/config_validate.rb:25:in `call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116:in `call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `block in run' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in `busy' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `run' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:196:in `action_raw' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:173:in `block in action' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:434:in `lock' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:161:in `call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:161:in `action' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/commands/provision/command.rb:35:in `block in execute' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/plugin/v2/command.rb:226:in `block in with_target_vms' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/plugin/v2/command.rb:220:in `each' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/plugin/v2/command.rb:220:in `with_target_vms' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/commands/provision/command.rb:34:in `execute' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/cli.rb:42:in `execute' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:252:in `cli' from /Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.3/bin/vagrant:166:in `<main>' 

I work on Mac OSX, 10.7.5.

Sidenote

Besides the permission error mentioned above, I get many other various errors and timeouts, so I suspect there might be something fundamentally wrong with my Vagrant installation (maybe resolved?). But since I'm obviously not a Unix ninja, I'm not quite sure what the problem is. Most errors, according to Google, are quite common and can be caused by several reasons (for example, "Timeout while waiting for the computer to load" or else).

Recently, after the xth trail, I have successfully vagrant up . I got this error: the private key for connecting to the machine via SSH must belong to the user running Vagrant. "After starting ...

 sudo chown root insecure_private_key 

... my tramp seems to be acting a little more stable.

This is just side code to provide some (fairly localized) context for my question, so feel free to edit / delete it if it doesn't give any meaning.

+7
vagrant sudo permissions macos chown
source share
1 answer

I made my first vagrant up as part of my own installation script, which runs as sudo . Because of this, each installed file belonged to the root , and not to my current account.

Connected:

In short, when you come to a similar problem, you can always “return” the ownership of the corresponding files.

 chown -R <USERNAME> /<YOUR-WEBSITES-DIRECTORY>/.vagrant/machines/ chown -R <USERNAME> /<YOUR-HOME-DIRECTORY>/.vagrant.d 

vagrant up , and the other team should work without sudo from now on.

+9
source share

All Articles