LoginSignup
1
0

More than 5 years have passed since last update.

Vagrant upで接続できないときは?

Last updated at Posted at 2019-01-31

未来電子テクノロジーでインターンをしている@yuka_ponです。

ローカル環境を開発していて、Vagrantに接続できないときはありませんか?
Vagrant upをしてもつながらないときは、多々あるのではないのでしょうか?

そこで、ここでは、私が経験した2つの接続トラブルをご紹介します。

"vboxsf" が入手されていない?

Windows PowerShellにて入力している際、Vagrant upをすると、次のように表示されませんか?

Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

このように表示される原因は、ホストとゲストのバージョンが一致していないからだと考えられます。

この対処法は、vagrant-vbguestをインストールすることです。
そのため、次のように入力します。

vagrant plugin install vagrant-vbguest

詳しくはこちら

キーが異なっている?

次は、下記のような表示が出てきたときです。

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.

この原因は、vagrantのauthorized_keysの中身と、vagrantが参照している鍵が違っていたからだと考えられます。

※authorized_keysとは・・・複数の公開鍵(SSHに接続するための認証方式の一つ)を保存するファイル

この対処法は、使用している秘密鍵から公開鍵を作成し、authorized_keysに書き込むことです。
そして、再起動をすれば完了です。
詳しくはこちら

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0