0
votes

I using vagrant on linux CentOS to construct windows server 2012 virtual machines, right now I got this Vagrantfile:

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

Vagrant.configure(2) do |config|

  config.vm.define "MACHINE" do |db|
    db.vm.box = "win2k12r2en"
    db.vm.network "public_network", bridge: "p1p1", ip: "130.103.97.40", netmask: "255.255.252.0"

    db.vm.provider "virtualbox" do |vb|
        vb.memory = 4096
        vb.cpus = 2
        vb.name = "MACHINE"
    end
    db.vm.provision :file, source: '/home/vagrant/ambientes/machine/shell/Install.ps1', destination: "/tmp/"
    db.vm.provision :file, source: '/home/vagrant/ambientes/machine/shell/Lib-General.ps1', destination: "/tmp"
    db.vm.provision :file, source: '/home/vagrant/ambientes/machine/shell/continue.bat', destination: "/tmp"
    db.vm.provision :file, source: '/home/vagrant/ambientes/machine/shell/PHP_ZEND.zip', destination: "/tmp"

  end

end

After run the script i got this error:

The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mkdir / -force

Stdout from the command:



Stderr from the command:

#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><S S="Error">mkdir : The path is not of a legal form._x000D__x000A_</S><S S="Error">At line:1 char:40_x000D__x000A_</S><S S="Error">+ $ProgressPreference='SilentlyContinue';mkdir / -force_x000D__x000A_</S><S S="Error">+                                        ~~~~~~~~~~~~~~_x000D__x000A_</S><S S="Error">    + CategoryInfo          : InvalidArgument: (C:\:String) [New-Item], Argume _x000D__x000A_</S><S S="Error">   ntException_x000D__x000A_</S><S S="Error">    + FullyQualifiedErrorId : CreateDirectoryArgumentError,Microsoft.PowerShel _x000D__x000A_</S><S S="Error">   l.Commands.NewItemCommand_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S></Objs>

¿What am I doing wrong?, I'm new to vagrant, I followed this guide. Thanks for your time.

1
There are a bunch of people complaining about the same error(The path is not of a legal form._x000D__x000A_) on the official Github repo. Have you caught up with them? To start: github.com/hashicorp/vagrant/issues/7435 - vahdet
I'm gonna check, thank you. - Haroldo Payares Salgado

1 Answers

0
votes

I followed vahdet guidance: I read github.com/hashicorp/vagrant/issues/7435 and did some workarounds:

  1. replace file provision destination "/tmp" by "C:\tmp"
  2. I upload the "PHP_ZEND.zip" file to a NEXUS server then downloaded to the VM by a powershell script provisioned by the vagrant script.

I did the second point because the VM was forced to shutdown and auto-destroy when the script was running the provision for the zip file.

That solved the problem.