[Vagrant]Gueat Additionsの更新に失敗するの時の対応
Vagrant+VartualBOXでCentOS6.5を利用しているとき、guest Additonsのバージョン違いでvagrantディレクトリのマウントができないなどのトラブルが多々ある。
これを可決するため、Guest Addtionsのインストールを行うも失敗することがある。。。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
$ vagrant vbguest --status GuestAdditions versions on your host (5.0.26) and guest (5.0.12) do not match. $ vagrant plugin install vagrant-vbguest Installed the plugin 'vagrant-vbguest (0.12.0)'! $ vagrant vbguest [default] GuestAdditions versions on your host (5.0.26) and guest (5.0.12) do not match. Loaded plugins: fastestmirror Setting up Install Process Loading mirror speeds from cached hostfile * base: www.ftp.ne.jp * extras: www.ftp.ne.jp * updates: www.ftp.ne.jp No package kernel-devel-2.6.32-573.el6.x86_64 available. Package gcc-4.4.7-17.el6.x86_64 already installed and latest version Package binutils-2.20.51.0.2-5.44.el6.x86_64 already installed and latest version Package 1:make-3.81-23.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.26 - guest version is 5.0.12 Verifying archive integrity... All good. Uncompressing VirtualBox 5.0.26 Guest Additions for Linux............ VirtualBox Guest Additions installer Removing installed version 5.0.26 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-573.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 ] $ vagrant vbguest --status [default] GuestAdditions versions on your host (5.0.26) and guest (5.0.12) do not match. |
そして、vagrant reloadするもディレクトリ同期に失敗。。。
みるとyum install kernel-devel-2.6.32-573.e16.x86_64のインストールに失敗してるっぽい。
なので、guestOS側にkernel-develをインストールする。
1 2 3 4 5 6 7 8 |
$ sudo yum install kernel-devel インストールしています : kernel-devel-2.6.32-431.3.1.el6.x86_64 1/1 Verifying : kernel-devel-2.6.32-431.3.1.el6.x86_64 1/1 インストール: kernel-devel.x86_64 0:2.6.32-431.3.1.el6 完了しました! |
ん?なんかバージョンが違うな?
とりあえずvbguestのインストール
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
$ vagrant vbguest [default] GuestAdditions versions on your host (5.0.26) and guest (5.0.12) do not match. Loaded plugins: fastestmirror Setting up Install Process Loading mirror speeds from cached hostfile * base: www.ftp.ne.jp * extras: www.ftp.ne.jp * updates: www.ftp.ne.jp No package kernel-devel-2.6.32-573.el6.x86_64 available. Package gcc-4.4.7-17.el6.x86_64 already installed and latest version Package binutils-2.20.51.0.2-5.44.el6.x86_64 already installed and latest version Package 1:make-3.81-23.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.26 - guest version is 5.0.12 Verifying archive integrity... All good. Uncompressing VirtualBox 5.0.26 Guest Additions for Linux............ VirtualBox Guest Additions installer Removing installed version 5.0.26 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-573.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 ] |
やっぱりダメみたい。
ネット検索してみたら直接対象バージョンのkernel-develをインストールして解決したのがあったので、やってみる。
1 2 3 4 5 6 |
$ sudo yum install ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/6.6/x86_64/updates/security/kernel-devel-2.6.32-573.el6.x86_64.rpm ・・・ インストール: kernel-devel.x86_64 0:2.6.32-573.el6 完了しました! |
インストールされていることを確認する。
1 2 |
$ ls -l /usr/src/kernels/ drwxr-xr-x. 22 root root 4096 7月 21 11:51 2016 2.6.32-573.el6.x86_64 |
今度は行けるか!
いけた!!
1 2 |
$ vagrant vbguest --status [default] GuestAdditions 5.0.26 running --- OK. |