devopsgroup-io/vagrant-hostmanager

No prompt is given to sudo, vagrant up fails.

stephenreay opened this issue · 1 comments

When attempting to vagrant up (on a machine that has been vagrant destroy'd, and worked fine previously) I now get an error when vagrant-hostmanager tries to update the hosts file on the host machine:

/opt/vagrant/embedded/lib/ruby/2.4.0/fileutils.rb:1289:in `initialize': Permission denied @ rb_sysopen - /etc/hosts (Errno::EACCES)
	from /opt/vagrant/embedded/lib/ruby/2.4.0/fileutils.rb:1289:in `open'
	from /opt/vagrant/embedded/lib/ruby/2.4.0/fileutils.rb:1289:in `copy_file'
	from /opt/vagrant/embedded/lib/ruby/2.4.0/fileutils.rb:430:in `copy_file'
	from /opt/vagrant/embedded/lib/ruby/2.4.0/fileutils.rb:357:in `block in cp'
	from /opt/vagrant/embedded/lib/ruby/2.4.0/fileutils.rb:1461:in `block in fu_each_src_dest'
	from /opt/vagrant/embedded/lib/ruby/2.4.0/fileutils.rb:1477:in `fu_each_src_dest0'
	from /opt/vagrant/embedded/lib/ruby/2.4.0/fileutils.rb:1459:in `fu_each_src_dest'
	from /opt/vagrant/embedded/lib/ruby/2.4.0/fileutils.rb:356:in `cp'
	....

Hello @stephenreay, try running vagrant global-status --prune