vagrant up
を実行してもTime out
になってしまいます。
考えられる原因と解決策を具体的に教えていただきたいです。
症状
以下、全てwindowsコマンドプロンプトに打っています。
VMはUbuntuです。
C:\Users\hoge\vagrant>vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Checking if box 'ubuntu/trusty32' version '20181022.0.0' is up to date... ==> default: A newer version of the box 'ubuntu/trusty32' is available and already ==> default: installed, but your Vagrant machine is running against ==> default: version '20181022.0.0'. To update to version '20190305.0.0', ==> default: destroy and recreate your machine. ==> default: Clearing any previously set forwarded ports... ==> default: Vagrant has detected a configuration issue which exposes a ==> default: vulnerability with the installed version of VirtualBox. The ==> default: current guest is configured to use an E1000 NIC type for a ==> default: network adapter which is vulnerable in this version of VirtualBox. ==> default: Ensure the guest is trusted to use this configuration or update ==> default: the NIC type using one of the methods below: ==> default: ==> default: https://www.vagrantup.com/docs/virtualbox/configuration.html#default-nic-type ==> default: https://www.vagrantup.com/docs/virtualbox/networking.html#virtualbox-nic-type ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat default: Adapter 2: hostonly ==> default: Forwarding ports... default: 3000 (guest) => 3000 (host) (adapter 1) default: 22 (guest) => 2222 (host) (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: SSH auth method: private key
から進まなくなり、しばらくしたのち以下のようなエラー文が出ます。
==> 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 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 status
を確認すると、
C:\Users\hoge\vagrant>vagrant status Current machine states: default running (virtualbox) The VM is running. To stop this VM, you can run `vagrant halt` to shut it down forcefully, or you can run `vagrant suspend` to simply suspend the virtual machine. In either case, to restart it again, simply run `vagrant up`.
VMは起動しているようです。
しかし、ssh接続ができません。
vagrant ssh
C:\Users\hoge\vagrant>vagrant ssh ssh_exchange_identification: read: Connection reset
vagrant halt
を打つと次のようなメッセージが出ます。
C:\Users\hoge\vagrant>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 default: capable. ==> default: Forcing shutdown of VM...
the authentication information was changed or some other networking issue
この場合の変更してしまった可能性のあるauthentication information
とは主に何であるケースが多いでしょうか。
自力で調べた原因と結果
<原因>
0. 単にタイムアウトまでの時間が短い
0. 仮想化支援機構(Virtualization)が無効になっている
0. private key
の場所が間違っている
0. セキュリティソフト/ファイアウォールに引っかかっている
0. Virtual Boxのアダプターでケーブル接続のチェックが外れている
0. Wi-Fiに問題がある
<結果>
0. Vagrantfileを修正し時間を伸ばしてみたが変化なし。
0. 「有効」になっている。
0. vagrant ssh-config
で参照場所を確かめ、そこにちゃんとあるのを確認。
0. セキュリティソフトを一時的に無効化し再度試みたが変化なし。
0. チェックしてある。
0. 普段使っているWi-Fiから別のもの(スマホのテザリング)に変更したが変化なし。
<試してみたがよくわからなかった解決策>
〇 GUIコンソールからログインし…
→Vagrantfileの以下の部分のコメントアウトを外し、vagrant up
と同時に自動でGUIコンソールを開くも、何も打ち込めないところで止まる。
config.vm.provider "virtualbox" do |vb|
vb.gui = true
end
〇 Vagrantfileに以下を追記する…
→以下を追記し再起動するも変化なし。
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
end
自力では手詰まりです。
考えうる原因とその解決策を具体的に教えて下さい。
参考
vagrant ssh-config
C:\Users\hoge\vagrant>vagrant ssh-config Host default HostName 127.0.0.1 User vagrant Port 2222 UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile C:/Users/hoge/vagrant/.vagrant/machines/default/virtualbox/private_key IdentitiesOnly yes LogLevel FATAL
質問文に不足があれば以下に追記します。
C:\Users\hoge\vagrant>vagrant version Installed Version: 2.2.4 Latest Version: 2.2.4
VirtualBox version: 5.2.6
Windows10
回答2件
あなたの回答
tips
プレビュー