vagrant up でAuthentication failure. Retrying...

kteraguchi edited this page Dec 15, 2015 · 1 revision
Clone this wiki locallyとVBoxの関係が切れた


vagrant up を実行すると

>vagrant up default
========= 省略 =========
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address:
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...
========= 省略(30回くらい繰り返します。しかも1回の時間が長い。。。) =========
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...
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.

vagrant haltすると

>vagrant halt
==> default: Attempting graceful shutdown of VM...
    default: Guest communication could not be established! This is usually because
    default: SSH is not running, the authentication information was changed,
    default: or some other networking issue. Vagrant will force halt, if capable.
==> default: Forcing shutdown of VM...


調べながら色々やってみたところ、 が参考になりました。


  • ホストOSのNC3ディレクトリ/.vagrant/machines/default/virtualbox/private_keyを削除します。
  • vagrant up を実行します。 Authentication failure. Retrying...が発生するが無視。
  • sshはつながるので、sshでログインします。
  • ゲストOSのvagrantユーザホームディレクトリ(/home/vagrant)/.ssh/authorized_keysの中身を、 の内容に書き換えます。
  • ホストOSからvagrant haltを実行します。
>vagrant halt
==> default: Attempting graceful shutdown of VM...
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...

鍵が再作成されるので、vagrant upで問題なく起動します。

公開鍵だけ書き換えたり、秘密鍵だけ削除したり試してみたのですが、 上記の手順でやらないと、再作成されませんでした。

vagrant up時に