Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

updated at

Vagrant で bento/ubuntu-16.04 を vagrant up すると Connection timeout になってしまう

ちょっと複雑な環境を構築する必要があって、(Virtualbox で Windows Server, Virtualbox + Vagrant + Ansible で Ubuntu) ネットワークの設定をごにょごにょしていたので問題解決まで時間がかかってしまった


  • macOS Sierra 10.12.1
  • Virtualbox 5.0.28 r111378
  • Vagrant 1.7.4 (1.8.7 でも同じ現象になることを確認)


Vagrant.configure(2) do |config|
  config.vm.box = "bento/ubuntu-16.04"
# 略

として vagrant up をしたが、

==> 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: Connection timeout. 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.


スクリーンショット 2016-11-21 19.12.48.png

A start job is running for Raise network interfaces (進行秒数s / 5min 4s)

となってる。待っていると、表示の通り、5分4秒後にいつもの起動手順をふみ、ログイン可能になる。この時、VirtualboxのGUI上ではログインできるものの、vagrant sshは繋がらないまま。


参考: Timeout error during vagrant up


vb.customize ["modifyvm", :id, "--cableconnected1", "on"]

を加えると動いたという報告が。今回使っている bento/ubuntu-16.04 でも動いた報告があった


なので、Virtualbox provider の設定を

  config.vm.provider "virtualbox" do |vb|
    vb.memory = "2048"
    vb.customize ["modifyvm", :id, "--cableconnected1", "on"]



Vagrant のバージョンが古かった (1.7.4) ことで、別の問題が発生していた。
(別件についてはこちら → Vagrant で bento/ubuntu-16.04 を vagrant up すると途中で ネットワーク周りでコケる)
本件の対応のあとで Vagrant のバージョンアップをした (1.8.7) ので、
再度 確認したら、1.8.7 でも発生した

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
Help us understand the problem. What are the problem?