LoginSignup
11
5

More than 5 years have passed since last update.

macのアップデートをしたらvagrant upができなくなった

Posted at

立ち上がらなくなったvagrant

開発のメインマシンがwinなのでフランクにmacのアップデートをしがちです。
フランクにアップデートしたら立ち上がらなくなりました。
OSのバージョンは 10.14 Mojave です。
vagrant up をしようとしたのは会社で使っているローカル環境ですが
元ネタは以下のリポジトリです。
https://github.com/htanaka0828/devbase_for_htanaka0828

エラーの内容としてはこちらと同じ
https://ja.stackoverflow.com/questions/3123/vagrant-up-%E3%81%8C-failed-to-open-dev-vboxnetctl-no-such-file-or-directory-%E3%81%A7%E5%A4%B1%E6%95%97%E3%81%99%E3%82%8B

There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

Stderr: 0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open  /dev/vboxnetctl: No such file or directory
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component   HostNetworkInterface, interface IHostNetworkInterface
VBoxManage: error: Context: "int handleCreate(HandlerArg*, int, int*)" at line 66 of     file VBoxManageHostonly.cpp

解決方法

ググると色々情報が出てきますが結論だけ書くと
1. VirtualBoxのアップデートをする
2. vagrantのアップデートをする
3. vagrantのプラグインを再インストールする

という感じです。

VirtualBoxの更新

公式からインストールパッケージをダウンロードしてインストール
https://www.virtualbox.org/wiki/Downloads

vagrantの更新

公式からインストールパッケージをダウンロードしてインストール
https://www.vagrantup.com/downloads.html

vagrant pluginの更新(をしなかったために出たエラーとか)

この状態で vagrant up を試みたところ

Vagrant failed to initialize at a very early stage:

The plugins failed to initialize correctly. This may be due to manual
modifications made within the Vagrant home directory. Vagrant can
attempt to automatically correct this issue by running:

  vagrant plugin repair

If Vagrant was recently updated, this error may be due to incompatible
versions of dependencies. To fix this problem please remove and re-install
all plugins. Vagrant can attempt to do this automatically by running:

  vagrant plugin expunge --reinstall

Or you may want to try updating the installed plugins to their latest
versions:

  vagrant plugin update

Error message given during initialization: Unable to resolve dependency: user requested 'vagrant-hostsupdater (= 1.0.2)'

こんな感じのメッセージが出ました。
ご丁寧に「vagrantのアプデしてこれが出てるならこのコマンドを打ってくれよな!(意訳)」って書いてあるので
ありがたく vagrant plugin expunge --reinstall って打ったら解決しました。
このコマンドもすごくご丁寧に

This command permanently deletes all currently installed user plugins. It
should only be used when a repair command is unable to properly fix the
system.

Continue? [N]:

みたいな確認をしてきます。
「一回全部プラグイン消してもう一度インストールするんだけど大丈夫だよな?(意訳)」って確認なので
スマートにエンターキーを打ち抜きましょう。

最後に

あとは厳かに vagrant up を打って
立ち上がる仮想マシンと共に過ごす時間に想いを巡らせながらログを眺めてください。
現場からは以上です。

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