LoginSignup
4
5

More than 5 years have passed since last update.

Vagrant 1.9.4でVMが起動しない場合の対処方法(Windowsのみ?)

Posted at

はじめに

Mastodonを動かしてみようとVagrantで環境を立ち上げようとしたら、はまったので情報共有です。
なお、タイトルにあるようにWindowsだけの問題かもしれません(MacやLinuxはないので未確認)

起こってたエラー

VMが起動して、SSH接続しようとしているところで「Warning: Connection reset. Retrying...」→「Forcing shutdown of VM...となります。

Warningなのに強制終了はおかしいだろと調べたところ、

Vagrant up forces shutdown of VM · Issue #8520 · mitchellh/vagrant

というIssueがありました。

要約すると、「捕まえるべき例外を捕まえていないから終了フローに行く。例外捕まえるようにしたら直った」ということだそうです。

対処方法

1.9.5では直ったの入れるとのことですが、まだ出ないようです。
すぐにどうにかしたいという人はjoelhandwellさんのコメントを参考に、en.yml, errors.rb, communicator.rbをダウンロードして

  • C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/templates/locales/en.yml
  • C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/errors.rb
  • C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/plugins/communicators/ssh/communicator.rb

を置き換えます。これでvagrant upできます。

余談

これでVMは起動するのですが、MastodonのVagrantfileは失敗します。理由はboxに入ってるGuest Additionsのバージョンが古くて共有フォルダのマウントができないため。

共有フォルダをマウントできるようにしてもWindowsだとシンボリックリンクが張れなくてうまくいかないそうです。私は、

Windowsホストのvagrantでmastodonを動かす - 王様の耳は驢馬の耳(別館)

を参考に、gistをいただきMastodonを動かしました。

4
5
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
4
5