Search code examples
vagrantvirtualboxvirtualbox-guest-additions

Destroying VM causes Guest Additions Mismatch to Recur


I use vagrant to create Vagrantfile:

vagrant init somedir/thebox-1.0.0 http://XX.XX.XXX.XXX.XXXX/somedir/thebox-1.0.0.box

I run vagrant up:

vagrant up

which displays (among other info)

[default] GuestAdditions versions on your host (6.1.8) and guest (6.0.2) do not match.
...
Complete!
Copy iso file C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso into the box 
/tmp/VBoxGuestAdditions.iso
Mounting Virtualbox Guest Additions ISO to: /mnt
mount: /dev/loop0 is write-protected, mounting read-only
Installing Virtualbox Guest Additions 6.1.8 - guest version is 6.0.2
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.1.8 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 6.0.2 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel
modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel
3.10.0-957.1.3.el7.x86_64.
VirtualBox Guest Additions: Running kernel modules will not be replaced until
the system is restarted
An error occurred during installation of VirtualBox Guest Additions 6.1.8. Some functionality may not 
work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
Redirecting to /bin/systemctl start vboxadd.service
Redirecting to /bin/systemctl start vboxadd-service.service
Unmounting Virtualbox Guest Additions ISO from: /mnt
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:   6.0.2
VBoxService inside the vm claims: 6.1.8
Going on, assuming VBoxService is correct...
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:   6.0.2
VBoxService inside the vm claims: 6.1.8
Going on, assuming VBoxService is correct... 
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => C:/vagrant_devbox

Now if I destroy the VM by:

vagrant destroy -f

And then turn it on again via:

vagrant up

The mismatch is still reported

[default] GuestAdditions versions on your host (6.1.8) and guest (6.0.2) do not match.

The file already exists locally:

Copy iso file C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso into the box

How can I avoid getting the error

[default] GuestAdditions versions on your host (6.1.8) and guest (6.0.2) do not match.

when vagrant up is first called?

I've seen answers like How to upgrade to VirtualBox Guest Additions on VM box?. Installing vagrant-vbguest does not prevent the error when vagrant up is first called.


Solution

    • Why do you have the error ?

    You get this message because the vagrant box has been created with a prior version of VirtualBox (6.0.2) and the GuestAdditions has been installed on the box for this version. But now you run a newer version of VBox (6.1.8) so the system needs to copy on the box the updated tool.

    You will get this message everytime you spin a new VM against this box and everytime you upgrade VirtualBox on your host.

    • How can I avoid getting the error

    If you really want to avoid the error, you will need to upgrade your box and install the Guest Addition in the box and repackage the box