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

Upgrading GuestAdditions does not carry through to VirtualBox VM #115

Open
ryanlelek opened this Issue Mar 19, 2014 · 4 comments

Comments

Projects
None yet
5 participants
@ryanlelek

ryanlelek commented Mar 19, 2014

Summary

When this module upgrades GuestAdditions for an image, Vagrant complains about the versions being mismatched. I'm not sure if the version failed to upgrade or if the versions are really only out of sync. The only thing that seemed to fail was the X-Windows-related module, and that's not applicable for a server.
_Regardless, this removes those pesky errors._

Files/logs included below to reproduce the issue
Possible solution as discovered by @trkoch

Background

I discovered this module after upgrading many, many packages on a precise64 image using apt-get upgrade. So, I don't know how this would impact the regular image without updating

Commands / Logs

This is running vagrant up from nothing
However, the box file from hashicorp/precise64 has been downloaded/cached locally

$ vagrant up
Bringing machine 'ubuntu' up with 'virtualbox' provider...
==> ubuntu: Importing base box 'hashicorp/precise64'...
==> ubuntu: Matching MAC address for NAT networking...
==> ubuntu: Checking if box 'hashicorp/precise64' is up to date...
==> ubuntu: Setting the name of the VM: ubuntu
==> ubuntu: Clearing any previously set network interfaces...
==> ubuntu: Preparing network interfaces based on configuration...
    ubuntu: Adapter 1: nat
    ubuntu: Adapter 2: hostonly
==> ubuntu: Forwarding ports...
    ubuntu: 22 => 2222 (adapter 1)
==> ubuntu: Running 'pre-boot' VM customizations...
==> ubuntu: Booting VM...
==> ubuntu: Waiting for machine to boot. This may take a few minutes...
    ubuntu: SSH address: 127.0.0.1:2222
    ubuntu: SSH username: vagrant
    ubuntu: SSH auth method: private key
    ubuntu: Error: Connection timeout. Retrying...
==> ubuntu: Machine booted and ready!
GuestAdditions versions on your host (4.3.8) and guest (4.2.0) do not match.
stdin: is not a tty
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  fakeroot linux-headers-3.2.0-23 make patch
Suggested packages:
  make-doc diffutils-doc
The following NEW packages will be installed:
  dkms fakeroot linux-headers-3.2.0-23 linux-headers-3.2.0-23-generic make
  patch
0 upgraded, 6 newly installed, 0 to remove and 66 not upgraded.
Need to get 12.7 MB of archives.
After this operation, 68.5 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/main make amd64 3.81-8.1ubuntu1 [118 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ precise/main patch amd64 2.6.1-3 [80.2 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ precise/main dkms all 2.2.0.3-1ubuntu3 [73.1 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ precise/main fakeroot amd64 1.18.2-1 [87.2 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu/ precise/main linux-headers-3.2.0-23 all 3.2.0-23.36 [11.4 MB]
Get:6 http://us.archive.ubuntu.com/ubuntu/ precise/main linux-headers-3.2.0-23-generic amd64 3.2.0-23.36 [947 kB]
dpkg-preconfigure: unable to re-open stdin: No such file or directory
Fetched 12.7 MB in 6s (1,905 kB/s)
Selecting previously unselected package make.
(Reading database ... 51095 files and directories currently installed.)
Unpacking make (from .../make_3.81-8.1ubuntu1_amd64.deb) ...
Selecting previously unselected package patch.
Unpacking patch (from .../patch_2.6.1-3_amd64.deb) ...
Selecting previously unselected package dkms.
Unpacking dkms (from .../dkms_2.2.0.3-1ubuntu3_all.deb) ...
Selecting previously unselected package fakeroot.
Unpacking fakeroot (from .../fakeroot_1.18.2-1_amd64.deb) ...
Selecting previously unselected package linux-headers-3.2.0-23.
Unpacking linux-headers-3.2.0-23 (from .../linux-headers-3.2.0-23_3.2.0-23.36_all.deb) ...
Selecting previously unselected package linux-headers-3.2.0-23-generic.
Unpacking linux-headers-3.2.0-23-generic (from .../linux-headers-3.2.0-23-generic_3.2.0-23.36_amd64.deb) ...
Processing triggers for man-db ...
Setting up make (3.81-8.1ubuntu1) ...
Setting up patch (2.6.1-3) ...
Setting up dkms (2.2.0.3-1ubuntu3) ...
Setting up fakeroot (1.18.2-1) ...
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode.
Setting up linux-headers-3.2.0-23 (3.2.0-23.36) ...
Setting up linux-headers-3.2.0-23-generic (3.2.0-23.36) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 3.2.0-23-generic /boot/vmlinuz-3.2.0-23-generic
Copy iso file /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
stdin: is not a tty
mount: warning: /mnt seems to be mounted read-only.
Installing Virtualbox Guest Additions 4.3.8 - guest version is 4.2.0
stdin: is not a tty
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.8 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 4.2.0 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules ...done.
Doing non-kernel setup of the Guest Additions ...done.
You should restart your guest to make sure the new modules are actually used

Installing the Window System drivers
Could not find the X.Org or XFree86 Window System, skipping.
An error occurred during installation of VirtualBox Guest Additions 4.3.8. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
stdin: is not a tty
==> ubuntu: Checking for guest additions in VM...
==> ubuntu: Setting hostname...
==> ubuntu: Configuring and enabling network interfaces...
==> ubuntu: Mounting shared folders...
    ubuntu: /vagrant => /Users/ryanlelek/Sites/vagrant-test
==> ubuntu: Running provisioner: ansible...

PLAY [all] ******************************************************************** 

GATHERING FACTS *************************************************************** 
ok: [ubuntu]

TASK: [Update Apt Repository Cache] ******************************************* 
ok: [ubuntu]

TASK: [Upgrade Apt Packages] ************************************************** 
changed: [ubuntu]

TASK: [ensure ntpd is at the latest version] ********************************** 
ok: [ubuntu]

TASK: [install git] *********************************************************** 
changed: [ubuntu]

PLAY RECAP ******************************************************************** 
ubuntu                     : ok=5    changed=2    unreachable=0    failed=0

Then running vagrant status outputs

$ vagrant status
Current machine states:

ubuntu                    running (virtualbox)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.

Then vagrant reload will spit this out when run the first time and additional times

$ vagrant reload
==> ubuntu: Attempting graceful shutdown of VM...
==> ubuntu: Checking if box 'hashicorp/precise64' is up to date...
==> ubuntu: Clearing any previously set forwarded ports...
==> ubuntu: Clearing any previously set network interfaces...
==> ubuntu: Preparing network interfaces based on configuration...
    ubuntu: Adapter 1: nat
    ubuntu: Adapter 2: hostonly
==> ubuntu: Forwarding ports...
    ubuntu: 22 => 2222 (adapter 1)
==> ubuntu: Running 'pre-boot' VM customizations...
==> ubuntu: Booting VM...
==> ubuntu: Waiting for machine to boot. This may take a few minutes...
    ubuntu: SSH address: 127.0.0.1:2222
    ubuntu: SSH username: vagrant
    ubuntu: SSH auth method: private key
    ubuntu: Error: Connection timeout. Retrying...
==> ubuntu: Machine booted and ready!
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:   4.2.0
VBoxService inside the vm claims: 4.3.8
Going on, assuming VBoxService is correct...
GuestAdditions seems to be installed (4.3.8) correctly, but not running.
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:   4.2.0
VBoxService inside the vm claims: 4.3.8
Going on, assuming VBoxService is correct...
stdin: is not a tty
Starting the VirtualBox Guest Additions ...done.
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:   4.2.0
VBoxService inside the vm claims: 4.3.8
Going on, assuming VBoxService is correct...
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:   4.2.0
VBoxService inside the vm claims: 4.3.8
Going on, assuming VBoxService is correct...
==> ubuntu: Checking for guest additions in VM...
    ubuntu: The guest additions on this VM do not match the installed version of
    ubuntu: VirtualBox! In most cases this is fine, but in rare cases it can
    ubuntu: prevent things such as shared folders from working properly. If you see
    ubuntu: shared folder errors, please make sure the guest additions within the
    ubuntu: virtual machine match the version of VirtualBox you have installed on
    ubuntu: your host and reload your VM.
    ubuntu: 
    ubuntu: Guest Additions Version: 4.2.0
    ubuntu: VirtualBox Version: 4.3
==> ubuntu: Setting hostname...
==> ubuntu: Configuring and enabling network interfaces...
==> ubuntu: Mounting shared folders...
    ubuntu: /vagrant => /Users/ryanlelek/Sites/vagrant-test
==> ubuntu: VM already provisioned. Run `vagrant provision` or use `--provision` to force it

Now, I execute the solution mentioned by @trkoch

$ /usr/bin/VBoxManage guestproperty get ubuntu /VirtualBox/GuestAdd/Version
Value: 4.3.8

$ /usr/bin/VBoxManage guestproperty set ubuntu /VirtualBox/GuestAdd/Version

And we appear to have a fixed version when running vagrant reload (Yay!)

$ vagrant reload
==> ubuntu: Attempting graceful shutdown of VM...
==> ubuntu: Checking if box 'hashicorp/precise64' is up to date...
==> ubuntu: Clearing any previously set forwarded ports...
==> ubuntu: Clearing any previously set network interfaces...
==> ubuntu: Preparing network interfaces based on configuration...
    ubuntu: Adapter 1: nat
    ubuntu: Adapter 2: hostonly
==> ubuntu: Forwarding ports...
    ubuntu: 22 => 2222 (adapter 1)
==> ubuntu: Running 'pre-boot' VM customizations...
==> ubuntu: Booting VM...
==> ubuntu: Waiting for machine to boot. This may take a few minutes...
    ubuntu: SSH address: 127.0.0.1:2222
    ubuntu: SSH username: vagrant
    ubuntu: SSH auth method: private key
    ubuntu: Error: Connection timeout. Retrying...
    ubuntu: Error: Connection timeout. Retrying...
    ubuntu: Error: Connection timeout. Retrying...
==> ubuntu: Machine booted and ready!
GuestAdditions 4.3.8 running --- OK.
==> ubuntu: Checking for guest additions in VM...
==> ubuntu: Setting hostname...
==> ubuntu: Configuring and enabling network interfaces...
==> ubuntu: Mounting shared folders...
    ubuntu: /vagrant => /Users/ryanlelek/Sites/vagrant-test
==> ubuntu: VM already provisioned. Run `vagrant provision` or use `--provision` to force it
@ngocphamm

This comment has been minimized.

ngocphamm commented May 31, 2014

I got this after using the VBoxManage guestproperty set command.

Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:   4.3.12 r93733
VBoxService inside the vm claims: 4.3.12
Going on, assuming VBoxService is correct...
GuestAdditions seems to be installed (4.3.12) correctly, but not running.
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:   4.3.12 r93733
VBoxService inside the vm claims: 4.3.12
Going on, assuming VBoxService is correct...

I'm desperate with this problem.

@blisteringherb

This comment has been minimized.

blisteringherb commented Jun 10, 2014

I'm having the same problem as @ngocphamm after running VBoxManage guestproperty set

@Gerst20051

This comment has been minimized.

Gerst20051 commented Aug 7, 2015

👍

@NeMO84

This comment has been minimized.

Contributor

NeMO84 commented May 27, 2016

+1, need a longer term solution for this.

In the interim 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