Falha na autenticação durante o Vagrant Up, enquanto o vagrant ssh e o ssh vagrant @ localhost -p2222 funcionam
Eu gostaria de executar um script de shell usando o Vagrant na inicialização. O Vagrant não pode se autenticar, enquanto a VM foi iniciada usando vagrant up
:
c:\temp\helloworld>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'helloworld'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: helloworld_default_1398419922203_60603
==> 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: vagrant
default: SSH auth method: private key
default: Error: Connection timeout. Retrying...
default: Error: Authentication failure. Retrying...
default: Error: Authentication failure. Retrying...
default: Error: Authentication failure. Retrying...
default: Error: Authentication failure. Retrying...
...
Após a execução CTRL + C
, é possível autenticar na VM usando vagrant ssh
essh vagrant@localhost -p2222
Arquivo Vagrant
Eu uso o Vagrantfile padrão e mudei apenas o nome do host:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "helloworld"
...
Versão Vagrant
c:\temp\helloworld>vagrant --version
Vagrant 1.5.1
Questão
Como autenticar na VM usando vagrant up
?