Problemas de SSH ao iniciar a VM windows8.1 do vagrant

Problemas de SSH ao iniciar a VM windows8.1 do vagrant

Conforme descrito no título, estou tendo alguns problemas ao iniciar uma VM win8.1 com o Vagrant, onde SSHnunca se conecta. O console exibe o erro abaixo:

padrão: Aviso: Tempo limite de conexão. Tentando novamente...

Registro completo:

$ 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...

Instalei o cygwin64 e o openssh, configurei o nome de usuário cyg_servere a senha como vagrant. Verificado com sucesso se está funcionando na VM fazendo ssh localhoste exibindo árvores de diretórios usando ls -lh /cygdrive/cconforme descrito em algum tutorial.

Meu Vagrantfileestá configurado como acima:

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

mas sem sucesso ainda.

É claro que pesquisei sobre isso no Google sem nenhuma informação boa e sem tutoriais fazendo a mesma coisa que estou fazendo.

Alguém sabe como resolver esse problema?

Estou executando um Mac Yosemite, usando vagrant1.7.2, VirtualBox4.3.28e Windows8.1 VM box.

Desde já, obrigado.

Responder1

Eu resolvi isso sozinho. Vagabundodocumentosdiz que as caixas do Windows podem usar o WinRM para se comunicar com o Vagrant através de vagrant rdpcomandos, então tudo que tive que fazer foi alterar Vagrantfileas configurações para isto:

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

E então habilite e configure o WinRM no SO inserindo os comandos abaixo no console (execute como 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

Os comandos WinRM acima estão todos descritos na página de documentos:http://docs.vagrantup.com/v2/boxes/base.html

Depois disso, fiz vagrant upde novo e tudo funcionou bem.

PARA SUA INFORMAÇÃO:Algumas pessoas tiveram problemas depois disso (leia em algum fórum), então neste caso lembre-se de verificar o firewall do Windows também.

informação relacionada