Skip to content
This repository was archived by the owner on Dec 17, 2023. It is now read-only.
This repository was archived by the owner on Dec 17, 2023. It is now read-only.

Guest Additions version mismatch could be due to a logical issue in getting guest version #213

Closed

Description

@NeMO84

The latest version of vagrant-vbguest, at the time of writing this, is 1.11.0.

Looking at the master branch it seems we rely on the installer's guest_version method to determine the active version as reported by the Guest. I am using Ubuntu guest, so the Ubuntu installer delegates the responsibility to the Linux installer from which it inherits.

The logical issue is with the method that loads the guest version guest_version. See: https://github.com/dotless-de/vagrant-vbguest/blob/master/lib/vagrant-vbguest/installers/linux.rb#L80

This method is calling super to load the driver determined guest version. But as a side effect it is also assigning the @guest_version instance variable. Note, the super method is delegating to the Base installer. The base installer reads the value from the driver and is in the format ''5.0.18 r106667'. This is then assigned to the @guest_version.

The logical issue with the guest_version method is we read the driver_version by altering the response of super; super.to_s[/^(\d+\.\d+.\d+)/, 1]. So the value assigned to driver_version is '5.0.18'.

When we go to determine the version reported by VBoxService, we also do the same altering of the response; data.to_s[/^(\d+\.\d+.\d+)/, 1]. So the check for the driver_version being different than fails since the versions are the same. When they are different we invoke a warning of their difference. This is expected behavior.

The problem is we rely on the driver version and VBoxService reported versions to be different to set the @guest_version. This assignment should be independent of version mismatch as it is still the guest version that we have calculated.

The method then completes and returns @guest_version'; which is still set to '5.0.18 r106667'.

I believe that the assignment of the @guest_version = v should be done outside and after the comparison of the versions.

So the fix might be to move the assignment outside below the if statement.

If I have made any assumptions that aren't correct please provide details. Thanks.

Activity

  1. NeMO84 commented on May 27, 2016

    @NeMO84
    ContributorAuthor

    Please see my pull request: #214

    Its a little more thorough than my description above.

  2. NeMO84 commented on May 28, 2016

    @NeMO84
    ContributorAuthor

    PR merged.

  3. NeMO84 commented on May 31, 2016

    @NeMO84
    ContributorAuthor

    For those who are also affected by this issue, I wrote a quick script to help me sync the version if they change after I upgrade:

    https://gist.github.com/NeMO84/95e93346e81dbb2b75dd677922addbda

    Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions