[Vagrant] GuestAdditions versions on your host (x.x.x) and guest (y.y.y) do not match.How to resolve this issue.

Uncategorized
スポンサーリンク

Preface

After updating the macOS, the virtual environment that had been working so far stopped functioning as expected. As a result, I had to update VirtualBox, and it seems I also need to align the Vagrant version accordingly.

I downloaded the latest versions of VirtualBox and Vagrant, thinking that the version issue with Vagrant could be resolved using the “vbguest” plugin—but that was overly optimistic.

# vagrant plugin install vagrant-vbguest

After performing the above steps and starting Vagrant, the “GuestAdditions do not match” issue occurred.

# vagrant up
・
・
GuestAdditions versions on your host (7.1.4) and guest (5.2.44) do not match.
・
・

Although it’s still usable as is, this error causes the sync folder (synchronizing the local project folder with a directory in the virtual environment) to fail, so it needs to be fixed.

Solution

We will align the version of Guest Additions on the guest side with the version on the host side.

1) Log in to the virtual machine (guest OS)

# vagrant ssh

2) Obtain the Guest Additions image

# curl -OL http://download.virtualbox.org/virtualbox/x.x.x/VBoxGuestAdditions_x.x.x.iso
complement

Replace “x.x.x” with the version number corresponding to your situation. This refers to the version number of “on your host” mentioned in the “GuestAdditions versions ~ do not match” error message.
For example, in my case, it was “7.1.4.”

3) Create a mount directory for the ISO file and mount the ISO file.

# sudo mkdir /VBoxGuestAdditions
# sudo mount -o loop,ro VBoxGuestAdditions_x.x.x.iso /VBoxGuestAdditions

4) Execute the installation.

# sudo sh /VBoxGuestAdditions/VBoxLinuxAdditions.run

5) Unmount the ISO file.

# sudo umount /VBoxGuestAdditions

6) Delete the mount directory and remove the ISO file.

# sudo rmdir /VBoxGuestAdditions
# rm VBoxGuestAdditions_x.x.x.iso

7) Log out from the virtual machine (guest OS).

# exit

8) Restart Vagrant on the host OS.

# vagrant reload

With this, the version mismatch is resolved, and the sync folder is now working!
(I never imagined that a difference in Guest Additions versions could affect the behavior of the sync folder…)

タイトルとURLをコピーしました