在Linux上通过Vagrant将文件上载到虚拟机Windows服务器时出错

在Linux上通过Vagrant将文件上载到虚拟机Windows服务器时出错,vagrant,virtual-machine,virtualbox,Vagrant,Virtual Machine,Virtualbox,我在linux CentOS上使用vagrant构建windows server 2012虚拟机,现在我得到了以下vagrant文件: # -*- 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", bri

我在linux CentOS上使用vagrant构建windows server 2012虚拟机,现在我得到了以下vagrant文件:

# -*- 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
运行脚本后,我出现以下错误:

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>
以下WinRM命令以非零退出状态响应。
Vagrant认为这意味着命令失败!
mkdir/-force
命令中的Stdout:
命令中的Stderr:
#

我做错了什么?我是流浪者的新手,我遵循了这个。谢谢您的时间。

我遵循了vahdet指南:我阅读并做了一些变通:

  • 将文件提供目标“/tmp”替换为“C:\tmp”
  • 我将“PHP_ZEND.zip”文件上传到NEXUS服务器,然后通过vagrant脚本提供的powershell脚本下载到VM
  • 我做了第二点,因为当脚本运行zip文件的配置时,VM被迫关闭并自动销毁


    这就解决了问题。

    在官方的Github回购协议上,有很多人抱怨同样的错误(
    路径不是合法形式。x000D_x000A
    )。你赶上他们了吗?首先:我会查的,谢谢。