をアップデートして既存のBoxを起動しようとするとエラーが発生する場合がある。
このときのエラー内容は下記。

d:\vagrant\vagrant up
The  VM was created  a user that doesn't match the
current user running Vagrant. VirtualBox requires that the same user
be used to manage the VM that was created. Please re-run Vagrant with
that user. This is not a Vagrant issue.

The UID used to create the VM was: 1196
Your UID is: 0

VMの作成ユーザーのUIDと現在使用されているUIDとの違いによるエラーのようです。
これの対応方法は、Boxを再作成するか(vagrant destroy 次 vagrant up)、UIDの修正して起動させる方法がある。
簡単に直せるのUIDの修正を行うことにした。

Vagranの構成情報ファイルがあるフォルダにあるファイルを開き内容を修正します。

.vagrant/machines/default/virtualbox/creator_uid

creator_uid を開くと中にUIDが記載されています。
今回は「1196」と記載されているのでこれを「0」に変更して保存します。
その後、「vagrant up」で起動するようになり解決しました。

カテゴリー: Vagrant