hosts.local permission denied
Everytime I run vagrant up I get the error:
C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.3.0/fileutils.rb:1394:in `initialize': Permission
denied @ rb_sysopen - C:/Users/trahloff/.vagrant.d/tmp/hosts.local (Errno::EACCES)
The Vagrantfile wasn't altered in any way.
Visited Links:
System:
- Windows 10
- Ruby: 2.3.4
- Vagrant: 1.9.6
- Vagrant-Hostmanager: 1.8.7
This means Vagrant doesn't have access to modify files on host's machine.
You can try to run Vagrant as Administrator or adjust file permissions for %SystemRoot%\system32\drivers\etc.
I tried to run Vagrant as Administrator (CMD and Powershell) and the file permissions are "-a---". What else could be the problem?
No other ideas, except of file/dirs permissions.
Make sure those dirs/files (%SystemRoot%\system32\drivers\etc, %SystemRoot%\system32\drivers\etc\hosts, C:/Users/trahloff/.vagrant.d/tmp/hosts.local) are writable.
Also what means -a---, "all" something?
Did you try workarounds from the links you listed above? https://github.com/cogitatio/vagrant-hostsupdater/issues/89 Antivirus? Change file permissions? Destroy/re-create vagrant VM?
The point of vagrant-hostmanager plugin is to modify hosts files, so the entire fleet of Vagrant instances can be accessed by hostname like web, db, chatops instead of IP.
Something on your system is blocking that Vagrant operation to edit the hosts file.
I sadly couldn't figure out how to run it on the Windows host but managed to get is to work on a Linux Host.
Hostname association still fails, though. I can't access the services with "web", "chatops" but when I try 192.168.90.61 I actually get the NGINX welcome page. Somehow my I can't access the StackStorm Web GUI (neither https://www.chatops, nor 192.168.90.60 works).
My vagrant up output:
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 31999
DEBUG subprocess: Exit status: 0
INFO warden: Calling OUT action: #<VagrantPlugins::ProviderVirtualBox::Action::IsRunning:0x000000
03766a08>
DEBUG updater: init updater
INFO runner: Preparing hooks for middleware sequence...
INFO runner: 2 hooks defined.
INFO runner: Running action: machine_action_up #<Vagrant::Action::Warden:0x000000061a2790>
INFO warden: Calling IN action: #<Proc:0x000000069ab928@C:/HashiCorp/Vagrant/embedded/gems/gems/v
agrant-1.9.6/lib/vagrant/action/warden.rb:94 (lambda)>
INFO warden: Calling IN action: #<VagrantPlugins::ProviderVirtualBox::Action::CheckAccessible:0x0
00000061a2718>
INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvmi
nfo", "44e62452-a2ea-47fe-8a2f-25a7da3c9bab", "--machinereadable"]
INFO subprocess: Command not in installer, restoring original environment...
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: name="chatops"
groups="/"
ostype="Ubuntu (64-bit)"
UUID="44e62452-a2ea-47fe-8a2f-25a7da3c9bab"
CfgFile="C:\\Users\\IBM_ADMIN\\VirtualBox VMs\\chatops\\chatops.vbox"
SnapFldr="C:\\Users\\IBM_ADMIN\\VirtualBox VMs\\chatops\\Snapshots"
LogFldr="C:\\Users\\IBM_ADMIN\\VirtualBox VMs\\chatops\\Logs"
hardwareuuid="44e62452-a2ea-47fe-8a2f-25a7da3c9bab"
memory=2048
pagefusion="off"
vram=12
cpuexecutioncap=100
hpet="off"
chipset="piix3"
firmware="BIOS"
cpus=1
pae="off"
longmode="on"
cpuid-portability-level=0
bootmenu="messageandmenu"
boot1="disk"
boot2="none"
boot3="none"
boot4="none"
acpi="on"
ioapic="on"
biossystemtimeoffset=0
rtcuseutc="on"
hwvirtex="on"
nestedpaging="on"
largepages="off"
vtxvpid="on"
vtxux="on"
paravirtprovider="legacy"
VMState="running"
VMStateChangeTime="2017-08-24T01:22:20.551000000"
monitorcount=1
accelerate3d="off"
accelerate2dvideo="off"
teleporterenabled="off"
teleporterport=0
teleporteraddress=""
teleporterpassword=""
tracing-enabled="off"
tracing-allow-vm-access="off"
tracing-config=""
autostart-enabled="off"
autostart-delay=0
defaultfrontend=""
storagecontrollername0="SATAController"
storagecontrollertype0="IntelAhci"
storagecontrollerinstance0="0"
storagecontrollermaxportcount0="30"
storagecontrollerportcount0="1"
storagecontrollerbootable0="on"
"SATAController-0-0"="C:\Users\IBM_ADMIN\VirtualBox VMs\chatops\box-disk1.vmdk"
"SATAController-ImageUUID-0-0"="e07a4559-e518-4037-b661-142c3de71efa"
natnet1="nat"
macaddress1="080027806EF8"
cableconnected1="on"
nic1="nat"
nictype1="82540EM"
nicspeed1="0"
mtu="0"
sockSnd="64"
sockRcv="64"
tcpWndSnd="64"
tcpWndRcv="64"
Forwarding(0)="ssh,tcp,127.0.0.1,2201,,22"
hostonlyadapter2="VirtualBox Host-Only Ethernet Adapter #2"
macaddress2="080027B1EDFD"
cableconnected2="on"
nic2="hostonly"
nictype2="82540EM"
nicspeed2="0"
nic3="none"
nic4="none"
nic5="none"
nic6="none"
nic7="none"
nic8="none"
hidpointing="ps2mouse"
hidkeyboard="ps2kbd"
uart1="off"
uart2="off"
uart3="off"
uart4="off"
lpt1="off"
lpt2="off"
audio="none"
clipboard="disabled"
draganddrop="disabled"
SessionName="headless"
VideoMode="720,400,0"@0,0 1
vrde="off"
usb="off"
ehci="off"
xhci="off"
SharedFolderNameMachineMapping1="vagrant"
SharedFolderPathMachineMapping1="\\?\C:\Projects\showcase-ansible-chatops"
VRDEActiveConnection="off"
VRDEClients=0
vcpenabled="off"
vcpscreens=0
vcpfile="C:\Users\IBM_ADMIN\VirtualBox VMs\chatops\chatops.webm"
vcpwidth=1024
vcpheight=768
vcprate=512
vcpfps=25
GuestMemoryBalloon=0
GuestOSType="Linux26_64"
GuestAdditionsRunLevel=2
GuestAdditionsVersion="4.3.36_Ubuntu r105129"
GuestAdditionsFacility_VirtualBox Base Driver=50,1503534494588
GuestAdditionsFacility_VirtualBox System Service=50,1503534506889
GuestAdditionsFacility_Seamless Mode=0,1503534494588
GuestAdditionsFacility_Graphics Mode=0,1503534494587
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
INFO warden: Calling IN action: #<Vagrant::Action::Builtin::Provision:0x000000061a26f0>
INFO provision: Checking provisioner sentinel file...
INFO provision: Sentinel found! Not provisioning.
DEBUG updater: init updater
INFO warden: Calling IN action: #<Vagrant::Action::Builtin::ConfigValidate:0x00000005a1ede8>
INFO warden: Calling IN action: #<VagrantPlugins::HostManager::Action::UpdateAll:0x00000005a1edc0
>
INFO warden: Calling IN action: #<Proc:0x0000000619b148@C:/HashiCorp/Vagrant/embedded/gems/gems/v
agrant-1.9.6/lib/vagrant/action/warden.rb:94 (lambda)>
INFO warden: Calling IN action: #<Proc:0x00000003f27760@C:/HashiCorp/Vagrant/embedded/gems/gems/v
agrant-1.9.6/lib/vagrant/action/warden.rb:94 (lambda)>
INFO warden: Calling IN action: #<Proc:0x000000053b0b00@C:/HashiCorp/Vagrant/embedded/gems/gems/v
agrant-1.9.6/lib/vagrant/action/warden.rb:94 (lambda)>
INFO warden: Calling OUT action: #<Proc:0x000000053b0b00@C:/HashiCorp/Vagrant/embedded/gems/gems/
vagrant-1.9.6/lib/vagrant/action/warden.rb:94 (lambda)>
INFO warden: Calling OUT action: #<Proc:0x00000003f27760@C:/HashiCorp/Vagrant/embedded/gems/gems/
vagrant-1.9.6/lib/vagrant/action/warden.rb:94 (lambda)>
INFO warden: Calling OUT action: #<Proc:0x0000000619b148@C:/HashiCorp/Vagrant/embedded/gems/gems/
vagrant-1.9.6/lib/vagrant/action/warden.rb:94 (lambda)>
INFO warden: Calling OUT action: #<VagrantPlugins::HostManager::Action::UpdateAll:0x00000005a1edc
0>
INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::ConfigValidate:0x00000005a1ede8>
INFO interface: info: Machine already provisioned. Run `vagrant provision` or use the `--provisio
n`
flag to force provisioning. Provisioners marked to run always will still run.
INFO interface: info: ==> chatops: Machine already provisioned. Run `vagrant provision` or use th
e `--provision`
==> chatops: flag to force provisioning. Provisioners marked to run always will still run.
==> chatops: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> chatops: flag to force provisioning. Provisioners marked to run always will still run.
INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::Provision:0x000000061a26f0>
INFO warden: Calling OUT action: #<VagrantPlugins::ProviderVirtualBox::Action::CheckAccessible:0x
000000061a2718>
INFO warden: Calling OUT action: #<Proc:0x000000069ab928@C:/HashiCorp/Vagrant/embedded/gems/gems/
vagrant-1.9.6/lib/vagrant/action/warden.rb:94 (lambda)>
INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::Call:0x00000003f3c0e8>
INFO warden: Calling OUT action: #<Proc:0x00000003a8f720@C:/HashiCorp/Vagrant/embedded/gems/gems/
vagrant-1.9.6/lib/vagrant/action/warden.rb:94 (lambda)>
INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::Call:0x000000053b0ba0>
INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::ConfigValidate:0x000000053b0cb8>
INFO warden: Calling OUT action: #<VagrantPlugins::ProviderVirtualBox::Action::CheckVirtualbox:0x
000000053b0ce0>
INFO warden: Calling OUT action: #<Proc:0x000000052f9428@C:/HashiCorp/Vagrant/embedded/gems/gems/
vagrant-1.9.6/lib/vagrant/action/warden.rb:94 (lambda)>
INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::Call:0x0000000692feb8>
INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::BoxCheckOutdated:0x00000006a28a90>
INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::ConfigValidate:0x00000006a28ab8>
INFO warden: Calling OUT action: #<VagrantPlugins::ProviderVirtualBox::Action::CheckVirtualbox:0x
00000006a28ae0>
INFO warden: Calling OUT action: #<Proc:0x00000005f42158@C:/HashiCorp/Vagrant/embedded/gems/gems/
vagrant-1.9.6/lib/vagrant/action/warden.rb:94 (lambda)>
INFO warden: Calling OUT action: #<Proc:0x00000005e6c940@C:/HashiCorp/Vagrant/embedded/gems/gems/
vagrant-1.9.6/lib/vagrant/action/warden.rb:94 (lambda)>
INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::Call:0x00000006a28b30>
INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::ConfigValidate:0x00000006a28b58>
INFO warden: Calling OUT action: #<Proc:0x000000064fcdf0@C:/HashiCorp/Vagrant/embedded/gems/gems/
vagrant-1.9.6/lib/vagrant/action/warden.rb:94 (lambda)>
INFO warden: Calling OUT action: #<Proc:0x000000063c8538@C:/HashiCorp/Vagrant/embedded/gems/gems/
vagrant-1.9.6/lib/vagrant/action/warden.rb:94 (lambda)>
INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::Call:0x00000006a28ba8>
INFO warden: Calling OUT action: #<VagrantPlugins::ProviderVirtualBox::Action::CheckVirtualbox:0x
00000006a28bd0>
INFO interface: Machine: action ["up", "end", {:target=>:chatops}]
INFO environment: Released process lock: machine-action-47557826488aa1d0e0562fd1a75d5d23
DEBUG environment: Attempting to acquire process-lock: dotlock
INFO environment: Acquired process lock: dotlock
INFO environment: Released process lock: dotlock
INFO environment: Running hook: environment_unload
INFO runner: Preparing hooks for middleware sequence...
INFO runner: 1 hooks defined.
INFO runner: Running action: environment_unload #<Vagrant::Action::Builder:0x0000000672b1a8>
Sorry to hear that.
The only thing I can help with, - will try to reproduce later with Vagrant: 1.9.6 and Vagrant-Hostmanager: 1.8.7 you mentioned before.
Thanks a lot! Will keep you posted if I somehow manage to fix it
Were you able to reproduce the problem? I think it might be the case that the st2 web instance rejects the requests because it is non-https
I tried with Vagrant 1.9.1 and couldn't reproduce the issue.
Hadn't any chance yet to try with Vagrant 1.9.6.
Ok, right now I'm deploying on the third machine (debian) with Vagrant 1.9.6 and can access the NGINX slaves but get a HTTP301 when curling the www.chatops endpoint. I'm getting seriously confused by the variety of errors I produced throughout the different systems.
- don't use the plugin host updater.
vagrant plugin list
vagrant plugin uninstall
- Make sure your user without elevating privileges have access to read write to: C:/Windows/system32/drivers/etc/hosts