fabric8io / fabric8-ansible-spring-boot

an Ansible playbook for provisioning Spring Boot apps
BSD 3-Clause "New" or "Revised" License
9 stars 8 forks source link

Virtualbox Guest addition can't be installed #1

Closed cmoulliard closed 8 years ago

cmoulliard commented 8 years ago
vagrant vbguest app1
GuestAdditions versions on your host (5.0.14) and guest (4.3.6) do not match.
Loaded plugins: fastestmirror, versionlock
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror0.babylon.network
 * epel: mirror.proserve.nl
 * extras: centos.mirror.fr.planethoster.net
 * updates: centos.weezel.co.uk
No package kernel-devel-2.6.32-431.3.1.el6.x86_64 available.
Package gcc-4.4.7-16.el6.x86_64 already installed and latest version
Package 1:make-3.81-20.el6.x86_64 already installed and latest version
Package 4:perl-5.10.1-141.el6_7.1.x86_64 already installed and latest version
Package bzip2-1.0.5-7.el6_0.x86_64 already installed and latest version
Nothing to do
Copy iso file /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
Installing Virtualbox Guest Additions 5.0.14 - guest version is 4.3.6
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.0.14 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 5.0.14 of VirtualBox Guest Additions...
Stopping VirtualBox Additions [  OK  ]
Removing existing VirtualBox non-DKMS kernel modules[  OK  ]
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox non-DKMS kernel modules[  OK  ]
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.
The missing package can be probably installed with
yum install kernel-devel-2.6.32-431.3.1.el6.x86_64

Building the main Guest Additions module[FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions[  OK  ]
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 5.0.14. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
dabou:~/Temp/fabric8-ansible-spring-boot$ vagrant ssh app1
Last login: Wed Feb 24 18:14:25 2016 from 10.0.2.2
[vagrant@app1 ~]$ more /var/log/vboxadd-install.log
/tmp/vbox.0/Makefile.include.header:97: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Stop.
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.
[vagrant@app1 ~]$ rpm -qa | grep kernel | sort
dracut-kernel-004-388.el6.noarch
kernel-2.6.32-431.3.1.el6.x86_64
kernel-firmware-2.6.32-431.3.1.el6.noarch
kernel-headers-2.6.32-431.3.1.el6.x86_64
jstrachan commented 8 years ago

Looks like an invalid VirtualBox installation.

I'd maybe uninstall VirtualBox, vagrant and zap your ~.vagrant.d/ folder and reinstall them all again.

Basically it looks like you've a newer VirtualBox with an incompatible older Guest Additions

jstrachan commented 8 years ago

Or if you could reinstall the Guest Additions inside VirtualBox that might be a less drastic fix - not sure how to do that though!

rhuss commented 8 years ago

Its probably an issue of the Vagrant box, so the first step I would try is to remove it:

vagrant box remove Centos-6.5-minimal-x86_64-20140116

and reload the box. If this doesn't work, maybe we should switch to a box with the guest additions already installed ? (like this is the case in Jimmis Box used in the fabric8 vagrant box)

cmoulliard commented 8 years ago

The problem comes from the fact that there is no VAR defined for the KERN_DIR

Building the main Guest Additions module[FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions[  OK  ]
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 5.0.14. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
dabou:~/Temp/fabric8-ansible-spring-boot$ vagrant ssh app1
Last login: Wed Feb 24 18:14:25 2016 from 10.0.2.2
[vagrant@app1 ~]$ more /var/log/vboxadd-install.log
/tmp/vbox.0/Makefile.include.header:97: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Stop.
cmoulliard commented 8 years ago

Even if the Guest Addition is not packaged within the box as this is the case for Fedora 23 vagrant box too (https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-23-20151030.x86_64.vagrant-virtualbox.box), it can be added easily using vbguest vagrant plugin.

cmoulliard commented 8 years ago

I would like to suggest to use a different image as the centos box is broken. dkms and kernel-devel can't be installed. See here after

sudo yum install dkms
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package dkms.noarch 0:2.2.0.3-30.git.7c3e7c5.el6 will be installed
--> Processing Dependency: kernel-devel for package: dkms-2.2.0.3-30.git.7c3e7c5.el6.noarch
--> Finished Dependency Resolution
Error: Package: dkms-2.2.0.3-30.git.7c3e7c5.el6.noarch (epel)
           Requires: kernel-devel
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

[vagrant@app1 ~]$ sudo yum install kernel-devel
Setting up Install Process
No package kernel-devel available.
cmoulliard commented 8 years ago

Alternatively, we could also repackage the centos box with the correct VirtualBox Guest Addon or to remove it and use the vagrant vbguest plugin to install it

cmoulliard commented 8 years ago

For a reason that I don't know the kernel-devel package can't be retrieve by yum.

The workaround is to install it manually. See instructions hereafter

vagrant ssh app1 or app2
sudo yum install wget
wget http://vault.centos.org/6.5/os/x86_64/Packages/kernel-devel-2.6.32-431.el6.x86_64.rpm
sudo rpm -Uvh kernel-devel-2.6.32-431.el6.x86_64.rpm
sudo ln -s /usr/src/kernels/2.6.32-431.el6.x86_64/ /usr/src/kernels/2.6.32-431.3.1.el6.x86_64
vagrant reload app1 or app2
jstrachan commented 8 years ago

Do you have similar issues when using the fabric8 vagrant image? If not am wondering if we should reuse Jimmi's centos box for the kansible examples too?

jimmidyson commented 8 years ago

Yeah we should use the same box.

jstrachan commented 8 years ago

@cmoulliard OK I"ve updated the spring boot demo to use Jimmi's centos box.

Wanna do a vagrant destroy -f then try vagrant up and see if things work better? Just tried it here and it worked great first time

cmoulliard commented 8 years ago

The image of Jimmy suffers from the same issue too :

The kernel-devel package is missing : No package kernel-devel-3.10.0-229.20.1.el7.x86_64 available. which is responsible of the issue when vbguest will install the Guest Addition

Installing Virtualbox Guest Additions 5.0.14 - guest version is 5.0.10
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.0.14 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 5.0.10 of VirtualBox Guest Additions...
Removing existing VirtualBox non-DKMS kernel modules[  OK  ]
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox non-DKMS kernel modules[  OK  ]
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module[FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)

[vagrant@app1 ~]$ more /var/log/vboxadd-install.log
/tmp/vbox.0/Makefile.include.header:115: *** Error: unable to find the include directory for your current Linux kernel. Specify KERN_INCL=<directory> and run Make again.  Stop.
jstrachan commented 8 years ago

lots of folks have been using the same image just fine; are you sure there's not something odd with your installation of VirtualBox + vagrant install? Did you try doing vagrant destroy -f then uninstalling vagrant + virtualbox, trashing your ~/.vagrant.d folder and trying a clean install?

cmoulliard commented 8 years ago

Problem solved after deleting ~/.vagrant.d

tranpuil commented 7 years ago

hi! Am very new to linux and am finding it difficult to solved some errors I have pasted some of them below to start with.

Thanks in advance.

root@kali:~# apt-get install -y dkms linux-headers-$(uname -r) Reading package lists... Done Building dependency tree
Reading state information... Done E: Unable to locate package dkms E: Unable to locate package linux-headers-4.9.0-kali3-amd64 E: Couldn't find any package by glob 'linux-headers-4.9.0-kali3-amd64' E: Couldn't find any package by regex 'linux-headers-4.9.0-kali3-amd64' root@kali:~# cd media bash: cd: media: No such file or directory root@kali:~# cd /media/ root@kali:/media# ls cdrom cdrom0 root@kali:/media# cd /cdrom0 bash: cd: /cdrom0: No such file or directory root@kali:/media# cd /cdrom0/ bash: cd: /cdrom0/: No such file or directory root@kali:/media# cd cdrom0/ root@kali:/media/cdrom0# ls 32Bit cert VBoxSolarisAdditions.pkg 64Bit OS2 VBoxWindowsAdditions-amd64.exe AUTORUN.INF runasroot.sh VBoxWindowsAdditions.exe autorun.sh VBoxLinuxAdditions.run VBoxWindowsAdditions-x86.exe root@kali:/media/cdrom0# cp VBoxLinuxAdditions.run /home/ root@kali:/media/cdrom0# cd /home/ root@kali:/home# ls VBoxLinuxAdditions.run root@kali:/home# ./VBoxLinuxAdditions.run Verifying archive integrity... All good. Uncompressing VirtualBox 5.1.22 Guest Additions for Linux........... VirtualBox Guest Additions installer Copying additional installer modules ... Installing additional modules ... vboxadd.sh: Starting the VirtualBox Guest Additions. Failed to set up service vboxadd, please check the log file /var/log/VBoxGuestAdditions.log for details. root@kali:/home# ./VBoxLinuxAdditions.run Verifying archive integrity... All good. Uncompressing VirtualBox 5.1.22 Guest Additions for Linux........... VirtualBox Guest Additions installer Removing installed version 5.1.22 of VirtualBox Guest Additions... Copying additional installer modules ... Installing additional modules ... vboxadd.sh: Starting the VirtualBox Guest Additions. Failed to set up service vboxadd, please check the log file /var/log/VBoxGuestAdditions.log for details. root@kali:/home# cd root@kali:~# tail -f /var/log/mail.log tail: cannot open '/var/log/mail.log' for reading: No such file or directory tail: no files remaining root@kali:~# tail ^C root@kali:~# cd /var/log root@kali:/var/log# ls alternatives.log fontconfig.log syslog apache2 gdm3 syslog.1 apt inetsim sysstat auth.log installer unattended-upgrades bootstrap.log kern.log user.log btmp lastlog vboxadd-install.log chkrootkit macchanger.log VBoxGuestAdditions.log couchdb messages VBoxGuestAdditions-uninstall.log daemon.log mysql wtmp debug ntpstats wvdialconf.log dpkg.log postgresql Xorg.0.log dradis samba Xorg.0.log.old exim4 speech-dispatcher Xorg.1.log faillog stunnel4 Xorg.1.log.old root@kali:/var/log# less VBoxGuestAdditions.log root@kali:/var/log# less vboxadd-install.log root@kali:/var/log# rpm -qa kernel* | sort bash: rpm: command not found root@kali:/var/log# cd root@kali:~# rpm -qa kernel* | sort bash: rpm: command not found root@kali:~# uname -r 4.9.0-kali3-amd64 root@kali:~# rpm -qa kernel* | sort bash: rpm: command not found root@kali:~# yum install kernel-headers kernel-devel bash: yum: command not found root@kali:~# yum update install kernel-headers kernel-devel bash: yum: command not found