Saturday, May 14, 2016

Vagrant - The guest additions on this VM do not match the installed version of VirtualBox!

Each time when I ran vagrant up, I will get this annoying message:
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 4.3.28
default: VirtualBox Version: 5.0
==> default: Setting hostname...

My VM image using the older VirtualBox Guest Additions tool than my Oracle VirtualBox installed on my machine. This cause my shared folder unable to mount and sync correctly. Now, let upgrade our tool:


1. Mount VBoxGuestAdditions.iso as optical disk drive (located at Oracle Virtualbox installed folder)

2. Run VM via Oracle Virtualbox or SSH inside our VM and install the linux kernel headers and the basic developer tools
$ sudo apt-get install linux-headers-$(uname -r) build-essential dkms

3. Run the shell script on your VM to install the guest additions.
$ sudo sh /media/cdrom/VBoxLinuxAdditions.run

Now restart / halt you VM. Next time when booting, the vagrant doesnt give the annoying message anymore and Oracle VirtualBox should able to mount the shared folder correctly.

No comments:

Post a Comment