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

Permission denied @ rb_sysopen - .vagrant.d/tmp/hosts.local #233

Closed
tovletoglou opened this issue May 4, 2017 · 5 comments
Closed

Permission denied @ rb_sysopen - .vagrant.d/tmp/hosts.local #233

tovletoglou opened this issue May 4, 2017 · 5 comments

Comments

@tovletoglou
Copy link

tovletoglou commented May 4, 2017

On a Windows system, runing the vagrant up, I'm getting the error:

C:/Users/USER/.vagrant.d/gems/2.2.5/gems/vagrant-hostmanager-1.8.6/lib/vagrant-hostmanager/hosts_file/updater.rb:85:in `initialize': Permission denied @ rb_sysopen - C:/Users/USER/.vagrant.d/tmp/hosts.local (Errno::EACCES)

Checking the file C:/Users/USER/.vagrant.d/tmp/hosts.local and it's read-only.

Then run the vagrant up again:

C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/fileutils.rb:1392:in `initialize': Permission denied @ rb_sysopen - C:/Users/USER/.vagrant.d/tmp/hosts.local (Errno::EACCES)

Example Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.provider 'virtualbox' do |vb|
    vb.gui = false
    vb.memory = '1024'
    vb.cpus = 1
  end
  config.vm.box = 'centos/7'
  config.vm.synced_folder '.',
                          '/vagrant',
                          type: 'vboxsf',
                          disabled: true
  config.vm.hostname = "my_hostname"
  config.vm.network "private_network", ip: "192.168.33.10"
  config.hostmanager.enabled = true
  config.hostmanager.manage_host = true
  config.hostmanager.manage_guest = true
  config.hostmanager.ignore_private_ip = false
  config.hostmanager.include_offline = true
end

System:
Windows 10
Vagrant 1.9.3
vagrant-hostmanager 1.8.6

@Ovsyanka
Copy link

Ovsyanka commented Jun 2, 2017

I removed "read-only" attribute frome the hosts file and it worked for me.
But I think that it is temporary solution and things should work without it.

@xymox12
Copy link

xymox12 commented Aug 28, 2019

This was my workaround which I am currently using successfully (so far!):

#178 (comment)

@tovletoglou
Copy link
Author

Close issue due to inactivity

@tino118
Copy link

tino118 commented Aug 19, 2023

  1. don't use the plugin host updater.

vagrant plugin list
vagrant plugin uninstall

  1. Make sure your user without elevating privileges have access to read
    write to:
    C:/Windows/system32/drivers/etc/hosts

@michalziaja
Copy link

  1. don't use the plugin host updater.

vagrant plugin list vagrant plugin uninstall

  1. Make sure your user without elevating privileges have access to read
    write to:
    C:/Windows/system32/drivers/etc/hosts

This helps. Thank You!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants