諸事情でVagrant環境でLaravelプロジェクトを作ることになったが、うまく行かなかったので自分用にメモ。
Homesteadで入れていって vagrant up コマンドを叩いたらエラーが出た。
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 HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg *)" at line 94 of file VBoxManageHostonly.cpp
どうやら VirtualBox の起動でこけてるみたいなので、直接VirtualBoxアプリケーション開いて該当の Vagrant を実行させようとしたらまたエラー。
Kernel driver not installed (rc=-1908)
Make sure the kernel module has been loaded successfully.
where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.
ぐぐったら、今度は「カーネルドライバがインストールされていない」と言われて、もうなんなんだろーと思いながら、対処法を探すと「VirtualBoxを再インストールせよ」とあったので最新版をinstallしにサイトを訪れる。
これでそのままインストールかなーと思ったら、今度はVirtualBoxのインストールができん……!!
The installer has detected running virtual machines. Please shut down all running VirtualBox machines and then restart the installation.
むがががっっ……!!!!
と思いながら翻訳すると、「インストーラーは、実行中の仮想マシンを検出しました。 実行中のすべてのVirtualBoxマシンをシャットダウンしてから、インストールを再開してください。」と出たので、「なんか起動してるものあったけかな?」と思いながらVirtualBox見に行ったがーー
なんも起動してねえ
というわけで再度原因をさぐると、「VirtualBoxのプロセスが残ってる」のが原因らしい。
ps -A | grep Virtual
を叩いたら、なぜかプロセスが残っていたのでkillしていく。
全部プロセスがなくなったのを再度確認して改めて VirtualBoxのパッケージをインストールしたらうまく行ったなーと思ったらーー
最後の最後でインストールできなかった。
原因はmacのセキリュティに阻まれていたようなので、システム環境設定をいじりインストールできるようにしてあげるとうまく行った。
Vagrant も無事起動してめでたしめでたし。
(これで1時間は吹っ飛んだ)
おそらく今回の原因は、macの移行アシスタントだろうなぁと思った。
新しいMacBook Pro買ってからVagrantとか立ち上げてなかったし、、、
下記今回お世話になったサイト様。感謝。


