Vagrant mkdir / -force错误

时间:2015-08-11 12:05:10

标签: vagrant vagrantfile

我使用Vagrant相当新,我试图在OSX主机上启动Windows VM。

我的流浪文件是,

config.vm.define "jenkins_slave" do |slave|

    slave.vm.box = "windows-2012-r2-puppet"
    slave.vm.box_check_update = false;

    slave.vm.hostname = "jenkins-slave"
    slave.vm.network :private_network, ip: "192.168.10.11"

    slave.vm.communicator = "winrm"
end

但是当Vagrant尝试设置一些代理配置值时,我收到错误

==> jenkins_slave: Configuring proxy environment variables...
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!


mkdir / -force
if ($?) { exit 0 } else { if($LASTEXITCODE) { exit $LASTEXITCODE } else   { exit 1 } }


Stdout from the command:


Stderr from the command:


#< CLIXML
<Objs Version="1.1.0.1"   xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><S S="Error">mkdir : The path is not of a legal form._x000D__x000A_</S><S S="Error">At line:1 char:1_x000D__x000A_</S><S S="Error">+ 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>

我不确定从哪里开始,所以任何人都可以给我的任何帮助都会很棒。

1 个答案:

答案 0 :(得分:2)

似乎答案是Vagrant并不知道它是一个Windows框,我不得不添加这条线,

slave.vm.guest =:windows