Laravel Homesteadのvagrant upでSSHがこける問題の恒久的な解決策




vagrant up をすると以下のようにSSHの部分でこける。

vagrant up
Bringing machine 'blog' up with 'virtualbox' provider...
==> blog: Importing base box 'laravel/homestead'...
==> blog: Matching MAC address for NAT networking...
==> blog: Checking if box 'laravel/homestead' is up to date...
==> blog: Setting the name of the VM: blog
==> blog: Clearing any previously set network interfaces...
==> blog: Preparing network interfaces based on configuration...
    blog: Adapter 1: nat
    blog: Adapter 2: hostonly
==> blog: Forwarding ports...
    blog: 80 (guest) => 8000 (host) (adapter 1)
    blog: 443 (guest) => 44300 (host) (adapter 1)
    blog: 3306 (guest) => 33060 (host) (adapter 1)
    blog: 5432 (guest) => 54320 (host) (adapter 1)
    blog: 8025 (guest) => 8025 (host) (adapter 1)
    blog: 27017 (guest) => 27017 (host) (adapter 1)
    blog: 22 (guest) => 2222 (host) (adapter 1)
==> blog: Running 'pre-boot' VM customizations...
==> blog: Booting VM...
==> blog: Waiting for machine to boot. This may take a few minutes...
    blog: SSH address:
    blog: SSH username: vagrant
    blog: SSH auth method: private key
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.

こいつは困ったということでググることに。 そしたら以下の記事を見つけた。

Laravel homesteadで最初のVagrant upが止まる - kz-engineer -SCRAP-

で、やると確かに destroyしてup中にケーブル接続にチェックを入れれば 問題なくup出来た。



ssh - Laravel Homestead vagrant up times out - Stack Overflow


以下を Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| の間に追加する。

    config.vm.provider 'virtualbox' do |vb|
        vb.customize ['modifyvm', :id, '--cableconnected1', 'on']

VirtualBox限定なのでproviderを変えたら消さなきゃだけどとりあえずはバージョンアップまでこれで対応すればよいかな。 Homested.yamlの書き方を工夫して掛けるなら誰かその方法を書いてくれるとありがたい。