devopsgroup-io / vagrant-hostmanager

:pencil: A Vagrant plugin that manages hosts files within a multi-machine environment.
Mozilla Public License 2.0
1.46k stars 148 forks source link

No prompt is given to sudo, vagrant up fails. #270

Open stephenreay opened 5 years ago

stephenreay commented 5 years ago

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'
    ....
seth-reeser commented 5 years ago

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