LoginSignup
9
8

More than 5 years have passed since last update.

VirtualBox 上の CentOS 7.2 に Guest Additions をインストールする

Last updated at Posted at 2015-12-25

概要

VirtualBox 上の CentOS 7.2 に VirtualBox Guest Additions をインストールする手順のまとめ。

バージョン

VirtualBox 5.0.12
CentOS 7.2.1511

インストール

VirtualBox の仮想マシンのウィンドウのメニューで、デバイス > Guest Additions CD イメージの挿入... を選択。

yum -y update
yum -y install gcc perl bzip2 kernel-devel
mount /dev/cdrom /media
sh /media/VBoxLinuxAdditions.run

失敗するケース

kernel と kernel-devel のバージョンが一致していないと以下のようなエラーを吐いて失敗するので、kernel を事前にアップデートしておく必要がある。

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-3.10.0-327.el7.x86_64

Building the main Guest Additions module[失敗]

このケースでは、確認すると以下のように kernel.x86_64kernel-devel.x86_64 のバージョンがそれぞれ 3.10.0-327.el73.10.0-327.3.1.el7 で一致していない。

[root@localhost ~]# yum list installed | grep kernel
kernel.x86_64                         3.10.0-327.el7                   @anaconda
kernel-devel.x86_64                   3.10.0-327.3.1.el7               @updates
kernel-headers.x86_64                 3.10.0-327.3.1.el7               @updates
kernel-tools.x86_64                   3.10.0-327.el7                   @anaconda
kernel-tools-libs.x86_64              3.10.0-327.el7                   @anaconda

その他

共有フォルダーの設定等は CentOS 6.6 に Guest Additions をインストールする を参照のこと。

9
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
8