user3617723
user3617723

Reputation: 1395

Vagrant mkdir / -force Error

I'm fairly new to using Vagrant, I'm trying to use to bring up a Windows VM on an OSX host.

My vagrant file is,

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

However I'm getting an error when Vagrant tries to set some proxy configuration values,

==> 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>

I'm not really sure where to start with this so any help anyone can give me would be great.

Upvotes: 1

Views: 1032

Answers (1)

user3617723
user3617723

Reputation: 1395

It seems like the answer was that Vagrant didn't know it was a windows box, I had to add the line,

slave.vm.guest = :windows

Upvotes: 2

Related Questions