🐈

【macOSアップデート】vagrant upできない時に一通り試すと良いかもしれない方法

2024/04/28に公開

Reference: https://qiita.com/ist-a-k/items/c103332729e3d0ac39e6

久しぶりにvagrant upしてみたらできなくなっていました。

$ vagrant up                                     
Bringing machine 'xxxxxx' up with 'virtualbox' provider...
==> xxxxxx: Checking if box 'bento/ubuntu-18.04' version '202112.19.0' is up to date...
==> xxxxxx: Resuming suspended VM...
==> xxxxxx: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "4dd36682-ed2e-4f4c-bd26-23909e117e45", "--type", "headless"]

Stderr: VBoxManage: error: The virtual machine 'xxxxxx_1698940574013_45766' has terminated unexpectedly during startup because of signal 9
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine

仮想マシンの削除、ラップトップのリスタートなど何も効かなかったので、brew installしてみました。そうしたらvirtualboxは最初から入ってなかったっぽかった(?)です。

また、Qiita記事からの変更点としてcaskは以下のように渡さないといけなくなりました。

$ brew install --cask vagrant          
$ brew install --cask virtualbox

これでビルドはうまくいきました。

$ vagrant up
....
==> xxx-build: Machine booted and ready!
==> xxx-build: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> xxx-build: flag to force provisioning. Provisioners marked to run always will still run.

Discussion