4
respostas

Erro ao iniciar máquina com Vagrant

Não consigo conectar na máquina. Ao dar o comando vagrant up, apresenta a seguinte msg:

Timed out while waiting for the machine to boot. This means that Vagrant was unable to communicate with the guest machine within the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that Vagrant had when attempting to connect to the machine. These errors are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly working and you're able to connect to the machine. It is a common problem that networking isn't setup properly in these boxes. Verify that authentication configurations are also setup properly, as well.

If the box appears to be booting properly, you may want to increase the timeout ("config.vm.boot_timeout") value.

A máquina está rodando, mas ao dar o commando vagrant ssh, apresenta a mensagem:

ssh_exchange_identification: read: Connection reset by peer

4 respostas

Bom dia, você está usando qual sistema operacional?

Passa o resultado dos comandos abaixo:

vagrant ssh-config
vagrant version

Debian 9.3

vagrant version

Installed Version: 2.0.3 Latest Version: 2.0.3

You're running an up-to-date version of Vagrant!

vagrant ssh-config

Host wordpress HostName 127.0.0.1 User vagrant Port 2222 UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile /root/.vagrant.d/insecure_private_key IdentitiesOnly yes LogLevel FATAL

vagrant status

Current machine states:

wordpress running (virtualbox)

Opa, caso não tenha o nmap, instala ele, executa e passa o resultado dos comandos abaixo:

whoami
nmap -P0 127.0.0.1 -p 2222
sudo netstat -nap | grep :2222 | cut -d\/ -f1 | awk '{print $NF}' | while read id ; do ps -ef | grep $id | grep -v grep ; done

Emerson,

Estava com o mesmo problema, não sei se meu caso é o mesmo que o seu.

Eu estou usando Win 8.1 (meu OS principal), subi uma VM do Ubuntu para fazer esse módulo do Ansible (já que não existe para ambiente Windows), e dentro dela estava executando o "vagrant up" que iria executar uma nova VM.

Win 8.1 (OS) -> Ubuntu (VM) -> Ubuntu (Nested VM)

Mas parece que não é possível fazer "Nested Virtualization" com VirtualBox. (https://www.virtualbox.org/ticket/4032)

Então optei por trocar o box por uma versão não-gráfica, e deu certo (pelo menos nas atividades da Aula 1, ainda não testei nas outras)

Solução:

no Vagrantfile

config.vm.box = "ubuntu/trusty64"

alterar para

config.vm.box = "hashicorp/precise32"

Por garantia, após alterar o arquivo, faça um "vagrant destroy" e depois "vagrant up", então teste novamente.

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software