[VirtualBox]Fedora 7(Guest)にGuest Additionsをインストールする

Written by uechoco 1 月 03

 VirutalBox Guest Additions(以下VBGAと呼ぶ)はゲストOSにVirtualBoxの便利なコマンドやツールをインストールするためのパッケージです。VirtualBoxの共有フォルダ機能を使ってみようと思ったのでインストールに挑戦してみました。環境は

  • ホストOS: Windows XP SP2
  • ゲストOS: Fedora 7

です。

■Guest Additions CD-ROMイメージのマウント

 VBGAはISO形式のCD-ROMイメージになっています。既にVirtualBoxのインストールしたフォルダの中に含まれています。たとえば私の環境では、ホストOSがWindows XPなので、

C:\Program Files\innotek VirtualBox\VBoxGuestAdditions.iso

というファイルです。使い方は簡単で、Fedora 7の実行中に、実行ウィンドウの[デバイス(D)]-[Guest Additions のインストール(I)...]をクリックすると自動でCD-ROMイメージがマウントされます。見た目には何も変わっていませんが、[デバイス(D)]-[CD/DVD-ROMのマウント解除(D)]でVBGAのCD-ROMイメージのイジェクトができるようになっています。

 続いて、Fedora 7のコマンドラインでマウントします。以下のコマンドでマウントできると思います。

# mkdir /mnt/cdrom
# mount -r /dev/cdrom /mnt/cdrom

マウントしたドライブを覗いてみると

# ls -la /mnt/cdrom
合計 1515
dr-xr-xr-x 6 root root?? 2048 2007-12-29 03:36 .
drwxr-xr-x 3 root root?? 4096 2008-01-03 07:11 ..
dr-xr-xr-x 2 root root?? 2048 2007-12-29 03:36 AMD_PCnet
-r-xr-xr-x 1 root root??? 143 2007-12-27 12:54 AUTORUN.INF
-r-xr-xr-x 1 root root 896496 2007-12-29 03:35 VBoxGuestAdditions.exe
-r-xr-xr-x 1 root root 635366 2007-12-29 03:35 VBoxLinuxAdditions.run
dr-xr-xr-x 5 root root?? 2048 2007-12-29 03:36 driver
dr-xr-xr-x 2 root root?? 2048 2007-12-29 03:36 gina
dr-xr-xr-x 2 root root?? 2048 2007-12-29 03:36 os2

となっているはずです。この中の

/mnt/cdrom/VBoxLinuxAdditions.run

というのが、実行可能なシェルスクリプトです。

■インストールシェルスクリプトの詳細

 ためしにヘルプコマンドを見てみます。

# sh /mnt/cdrom/VBoxLinuxAdditions.run help
Verifying archive integrity... All good.
Uncompressing VirtualBox 1.5.4 Guest Additions for Linux installation........
VirtualBox 1.5.4 Guest Additions installation
Usage: sh VBoxLinuxAdditions.run <options...>

The following options are recognized:

all           -- install all components of the Guest Additions
kernel-module -- only install the core components in the Linux kernel
vfs-module    -- install the shared folder component
timesync      -- install the time synchronisation component
x11           -- install guest drivers for the X Window System

If you do not specify any options, all components will be installed.
Components which you do not install will be deactivated if they arealready present in order to prevent possible problems due to mixingdifferent versions of the Additions.

 (あっている保障はないですが)日本語に訳すと、

使い方: sh VBoxLinuxAdditions.run <options...>

以下のオプションが認識されました:

all           -- Guest Additionsのすべてのコンポーネントをインストールします。
kernel-module -- Linux kernelのコア コンポーネントのみインストールします。
vfs-module    -- 共有フォルダ コンポーネントをインストールします。
timesync      -- 時刻同期コンポーネントをインストールします。
x11           -- X Window Systemのゲスト ドライバをインストールします。

オプションの指定がない場合は、すべてのコンポーネントがインストールされます。
既にインストール済みなのにインストールしなかったコンポーネントは無効化されます?
(異なるバージョンのGuest Additionsが混ざって実行可能なプログラムが妨げられるため)

だと思います。

 実行して成功すると、以下のようなメッセージが表示されます。

# sh /mnt/cdrom/VBoxLinuxAdditions.run all
Verifying archive integrity... All good.
Uncompressing VirtualBox 1.5.4 Guest Additions for Linux installation............
VirtualBox 1.5.4 Guest Additions installation
Building the VirtualBox Guest Additions kernel module...
Building the shared folder support kernel module...
Installing the VirtualBox Guest Additions...

Successfully installed the VirtualBox Guest Additions.
You must restart your guest system in order to complete the installation.

指示に従って再起動すればVBGAのインストールは完了です。

■エラーの対処方法

 と、先に成功のメッセージを紹介しましたが、私はすんなりと成功しませんでした。私の場合は

# sh /mnt/cdrom/VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 1.5.4 Guest Additions for Linux installation..........
VirtualBox 1.5.4 Guest Additions installation
Please install the build and header files for your current Linux kernel.
The current kernel version is 2.6.23.8-34.fc7
Please install the GNU compiler.
Problems were found which would prevent the Guest Additions from installing.
Please correct these problems and try again.

というエラーメッセージが表示されました。どうやらいくつかソフトウェアが足りなかったようです。以下は、エラー別の対処方法です。

Error 1. Please install the GNU compiler.

# yum install gcc
# yum install make

でgccパッケージなどをインストールしましょう。警告が消えます。

Error 2.Please install the build and header files for your current Linux kernel.

 Linuxカーネルのヘッダーファイルが必要とのことらしいですが、よくわからないので、

ホストOSはWindowsとLinuxに対応。ただしWindows 2000では次のバージョンを待つか、test build したものを使ってくれとのこと。LinuxだとqtとSDL、そしてVMwareと同じく linux-headers、kernel-devel、kernel-source などのパッケージが事前に導入済みでないと駄目。ちなみにFedora Core6の場合、compat-libstdc++-33 もいりました。

を参考に、

# yum install kernel-devel

から入れてみました。この状態でVBGAのスクリプトを走らせたらインストールが成功しました。

2 Responses to “[VirtualBox]Fedora 7(Guest)にGuest Additionsをインストールする”

  1. Comment by こだま on 2009 年 5 月 18 日 11 : 26 : 59

    こんにちは、こだまと申します。
    Guest Additionのインストール方法が分からず、こちらのブログを参考にさせて頂いた所、
    インストールする事が出来ました。(ちなみに、私のゲストOSはFedora10です)
    本当に助かりました!ありがとうございます。

  2. Comment by uechoco on 2009 年 5 月 18 日 13 : 02 : 21

    わたしもこのインストール方法に結構に悩みました。お役に立てて何よりです!

Comments RSS rss うえちょこ@ぼろぐ TrackBack Identifier URI rss うえちょこ@ぼろぐ

コメントをどうぞ