Windows Server 2012 / Vagrant up unable to connect using WinRM communication ?

184 views
Skip to first unread message

Brice Vandeputte

unread,
Mar 3, 2015, 9:33:09 AM3/3/15
to vagra...@googlegroups.com
Hi all
 I'm trying to make a Windows2012 server using vagrant.

 It seems like vagrant supports Windows (without plugin) since version 1.6. This [post][1] was talking about the only one line to add :

    config.vm.communicator = "winrm"

In addition into WinRM specific options [documentation][2] I check this Windows options (cf. complete list into [base config][3]): 

    Set-Item WSMan:\localhost\Service\AllowUnencrypted -Value True
    Set-Item WSMan:\localhost\Service\Auth\Basic -Value True

* I update the timeout from 300 to 600 sec

line to change:

    config.vm.boot_timeout = 600


* I check WinRM access by hand with success

Check WinRM :

    start / powershell + ENTER
    winrs -r:localhost:55985 -u:vagrant dir
 
* I add VirtualBox Guest Additions

* I start vagrant in verbose mode

    vagrant up --debug

This tell me that Vagrant make an infinite loop on this command:

    C:\\Programmes\\VirtualBox\\VBoxManage.exe showvminfo  my-vm-name --machinereadable

and WinRM each try ends with 504 error code:

if ($?) { exit 0 } else { if($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 1 } }
 INFO winrmshell: Attempting to connect to WinRM...
 INFO winrmshell:   - Host: 127.0.0.1
 INFO winrmshell:   - Port: 55985
 INFO winrmshell:   - Username: vagrant
 INFO retryable: Retryable exception raised: #<WinRM::WinRMHTTPTransportError: Bad HTTP response returned from server (504).>


could you help me to understand/fix 504 error on winRM connection ?

thanks

$ vagrant version
Installed Version: 1.7.2

VirtualBox 4.3.20 r96997

Brice Vandeputte

unread,
Mar 3, 2015, 9:49:21 AM3/3/15
to vagra...@googlegroups.com
I found the fix
  • do not use vagrant command line from cygwin but use standard "cmd.exe" console
sorry 
don't hit me 
plz ;) 
....anyway my post is a good cheat sheet for vagrant windows users ..

Alvaro Miranda Aguilera

unread,
Mar 3, 2015, 3:32:50 PM3/3/15
to vagra...@googlegroups.com
Hello,

have a look at packer.io is a tool to create boxes.. and have a post
processor to create vagrant boxes..

also, have a look at this project, that have plenty of packer
templates for windows:

https://github.com/joefitzgerald/packer-windows

So you can automate those boxes.

Alvaro.
> --
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Brice

unread,
Mar 4, 2015, 3:02:18 AM3/4/15
to vagra...@googlegroups.com
Hi Alvaro
thanks for this interesting feedback 
So I will try packer too.
regards

You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/lmVNtsTKRhY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages