VirtualBox + Vagrant: The version mismatch continues...
If you're using Vagrant with Virtualbox it is more likely than not that you have ran into this issue after you upgraded the host VirtualBox version. This issue may or may not be limited to the Linux machines.
vagrant up a warning that states the host reported version and VBoxService reported versions are out of sync. It looks something like this:
Got different reports about installed GuestAdditions version: Virtualbox on your host claims: 5.0.18 VBoxService inside the vm claims: 5.0.20 Going on, assuming VBoxService is correct...
The error is not expected if you did update your host VirtualBox and then updated your guest additions on the guest VM. They should be in sync. Notice how the host version is older than the guest VM version. This is usually an indicator that you likely updated your host and guest VB but the host version being reported is not the updated value.
It turns out this issue occurs after upgrading your host VirtualBox and then bringing up your guest VM. If you are using the excellent
vagrant-vbguest plugin, it will have auto updated the guest additions on the guest VM.
After digging in deeper, I found the cause may be related to the vagrant-vbguest plugin. The issue is the guest version may not be reported correctly; you can follow the issue here.
The host version is read by the VirtualBox provider driver. And the value is read from the guestproperty of the VM you are running. This value doesn't seem to be updated when you install a newer version of VirtualBox. The command to read it yourself is:
$ VBoxManage guestproperty get <UUID> /VirtualBox/GuestAdd/Version
Note: Be sure to replace
<UUID>. You can substitute the UUID with the VM name as well.
This is the driver reported value above where it reads 'Virtualbox on your host claims: X.X.X'. There may or may not be a build number supplied, but when comparing versions in the vagrant-vbguest plugin, the build number is ignored.
If you are sure that the newest version is installed and that the guest reported version is correct, than you can manually update the the property so that you don't receive the the warning anymore. The following command can help you do this:
$ VBoxManage guestproperty set <UUID> /VirtualBox/GuestAdd/Version "<New Version>"
Note: Be sure to replace
<New Version> with the respective values.
If you don't happen to know your new version or the UUID, I wrote a bash script that will do the heavy lifting. All it needs is the VM name. You can find it here.
It is not necessary to use the script, the set command above is enough, but it makes the process a lot easier when you have as many VMs as I do that need this setting updated.
I hope this helps someone running into this issue.