New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
NeMO84 opened this Issue May 26, 2016 · 3 comments

Comments

Projects
None yet
1 participant
@NeMO84
Contributor

NeMO84 commented May 26, 2016

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.

@NeMO84

This comment has been minimized.

Show comment
Hide comment
@NeMO84

NeMO84 May 27, 2016

Contributor

Please see my pull request: #214

Its a little more thorough than my description above.

Contributor

NeMO84 commented May 27, 2016

Please see my pull request: #214

Its a little more thorough than my description above.

@NeMO84

This comment has been minimized.

Show comment
Hide comment
@NeMO84

NeMO84 May 28, 2016

Contributor

PR merged.

Contributor

NeMO84 commented May 28, 2016

PR merged.

@NeMO84

This comment has been minimized.

Show comment
Hide comment
@NeMO84

NeMO84 May 31, 2016

Contributor

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.

Contributor

NeMO84 commented May 31, 2016

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.

glookie1 pushed a commit to glookie1/vagrant-vbguest that referenced this issue Jun 27, 2016

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