SSH issues when launching windows8.1 VM from vagrant

2

1

As described on title, I'm having some issues launching a win8.1 VM with Vagrant, where SSH never connects. The console display the error below:

default: Warning: Connection timeout. Retrying...

Full log:

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: cyg_server
    default: SSH auth method: password
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...

I installed cygwin64 and openssh, configured username as cyg_server and password as vagrant. Successfully checked if it's working within VM doing ssh localhost and displaying directory trees using ls -lh /cygdrive/c as discribed on some tutorial.

My Vagrantfile is configured as above:

config.ssh.username = "cyg_server"
config.ssh.password = "vagrant"

but no success yet.

Of course I googled about it without any good info, and no tutorials doing the same thing as I'm doing.

Anybody knows how to resolve this problem?

I'm running on a Mac Yosemite, using vagrant1.7.2, VirtualBox4.3.28 and Windows8.1 VM box.

Thanks in advance.

FormigaNinja

Posted 2015-06-03T06:19:11.737

Reputation: 121

Answers

0

I resolved it by myself. Vagrant's documents says that Windows boxes can use WinRM to communicate with Vagrant through vagrant rdp commands, so all I had to do was changing Vagrantfile configurations to this:

config.vm.guest = :windows
config.vm.communicator = "winrm"
config.vm.network :forwarded_port, guest: 3389, host: 13389
config.vm.network :forwarded_port, guest: 5985, host: 15985, id: "winrm", auto_correct: true

And then enable and configure WinRM on the OS inserting the commands below on the console (execute as admin):

winrm quickconfig -q 
winrm set winrm/config/winrs @{MaxMemoryPerShellMB="512"} 
winrm set winrm/config @{MaxTimeoutms="1800000"} 
winrm set winrm/config/service @{AllowUnencrypted="true"} 
winrm set winrm/config/service/auth @{Basic="true"} 
sc config WinRM start= auto

This WinRM commands above is all described on the docs page: http://docs.vagrantup.com/v2/boxes/base.html

After this I just vagrant up it again and everything worked fine.

FYI: Some people had trouble after this (read on some forum), so in this case just remember to check the windows firewall too.

FormigaNinja

Posted 2015-06-03T06:19:11.737

Reputation: 121