vagrant-hostmanager icon indicating copy to clipboard operation
vagrant-hostmanager copied to clipboard

Cannot find path 'C:\tmp\hosts\hosts.agent2' because it does not exist.

Open pearcec opened this issue 8 years ago • 0 comments
trafficstars

The code for Windows is broken when it comes to move the hosts file in place.

https://github.com/devopsgroup-io/vagrant-hostmanager/blob/master/lib/vagrant-hostmanager/hosts_file/updater.rb#L43

==> agent2: Mounting shared folders...
    agent2: /vagrant => C:/Users/user/Documents/projects/vagrant-puppet4-oss
==> agent2: Updating /etc/hosts file on active guest machines...
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mv -force /tmp/hosts/hosts.agent2 C:\Windows\System32\drivers\etc\hosts

Stdout from the command:



Stderr from the command:

Cannot find path 'C:\tmp\hosts\hosts.agent2' because it does not exist.
At line:1 char:1
+ mv -force /tmp/hosts/hosts.agent2 C:\Windows\System32\drivers\etc\hosts
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\tmp\hosts\hosts.agent2:String) [Move-Item], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.MoveItemCommand

pearcec avatar Mar 10 '17 17:03 pearcec