Fedora 15へVirtualBoxをインストールしたときのメモ
ダウンロード
-
rpm
Linux用にrpmがありますので、ダウンロードします。 まず、下記のDownloadsのページから「VirtualBox 4.1.10 for Linux hosts」をクリックします。
すると、UbuntuやFedora 用などに分かれているので、必要なものをダウンロードします。 2012年3月24日の時点で、Fedora 15 64bit (AMD64)版は以下でした。
VirtualBox-4.1-4.1.10_76795_fedora15-1.x86_64.rpm
インストール
# rpm -ihv VirtualBox-4.1-4.1.10_76795_fedora15-1.x86_64.rpmFedora 15の場合、インストールに成功すると /usr/bin/ にインストールされます。
# whcih virtualbox /usr/bin/virtualbox起動する場合は、以下を実行します。
# virtualbox &
または、デスクトップ上で [アプリケーション] → [システムツール] →[Oracle VM VirtualBox] から起動します。

インストールでエラーが発生した場合、次の項目の「インストールエラー」を参考にして対応します。
インストールエラー
-
Qt関係
Qt関係のパッケージがインストールされていないと、以下のようなエラーがでます。
# rpm -ihv VirtualBox-4.1-4.1.10_76795_fedora15-1.x86_64.rpm
警告: VirtualBox-4.1-4.1.10_76795_fedora15-1.x86_64.rpm: ヘッダー V4 DSA/SHA1 Signature、
鍵 ID 98ab5139: NOKEY
エラー: 依存性の欠如:
libQtCore.so.4()(64bit) は VirtualBox-4.1-4.1.10_76795_fedora15-1.x86_64 に必要と
されています
libQtGui.so.4()(64bit) は VirtualBox-4.1-4.1.10_76795_fedora15-1.x86_64 に必要と
されています
libQtNetwork.so.4()(64bit) は VirtualBox-4.1-4.1.10_76795_fedora15-1.x86_64 に必要
とされています
libQtOpenGL.so.4()(64bit) は VirtualBox-4.1-4.1.10_76795_fedora15-1.x86_64 に必要
とされています
必要なパッケージをインストールします。
# yum install qt # yum install qt-x11
参考
- libQtCore.so.4
- libQtNetwork.so.4
- libQtGui.so.4
- libQtOpenGL.so.4
DKMS
rpmのインストール途中で以下のように失敗した場合
# rpm -ihv VirtualBox-4.1-4.1.10_76795_fedora15-1.x86_64.rpm 警告: VirtualBox-4.1-4.1.10_76795_fedora15-1.x86_64.rpm: ヘッダー V4 DSA/SHA1 Signature、 鍵 ID 98ab5139: NOKEY 準備しています... ########################################### [100%] 1:VirtualBox-4.1 ########################################### [100%] Creating group \'vboxusers\'. VM users must be member of that group! No precompiled module for this kernel found -- trying to build one. Messages emitted during module compilation will be logged to /var/log/vbox-install.log. Stopping VirtualBox kernel modules [ OK ] Uninstalling old VirtualBox DKMS kernel modules [ OK ] Trying to register the VirtualBox kernel modules using DKMS[失敗] (Failed, trying without DKMS) Recompiling VirtualBox kernel modules [失敗] (Look at /var/log/vbox-install.log to find out what went wrong) # less /var/log/vbox-install.log Makefile:172: *** Error: unable to find the sources of your current Linux kernel. Specifyインストールで「失敗」がありましたが、実行してみると起動しました。 しかし、そのまま新規ゲストのインストールをしようとすると、エラーが起こります。
# virtualbox &
[1] 3304
# WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (2.6.38.6-26.rc1.fc15.x86_64) or it fa
iled to
load. Please recompile the kernel module and install it by
sudo /etc/init.d/vboxdrv setup
You will not be able to start VMs until this problem is fixed.
このような場合、必要なパッケージがインストールされていない可能性があります。
以下のページを参考に必要なパッケージをインストールします。
以下、必要なパッケージ
- dkms
- binutils
- gcc
- make
- patch
- libgomp
- glibc-headers
- glibc-devel
- kernel-headers
- kernel-devel
必要なパッケージをインストールしたら、セットアップを実行します。
#/etc/rc.d/init.d/vboxdrv setup
kernel と kernel headers のバージョン違い
再度、セットアップを実行してみて、以下のようなエラーが起こる場合、 インストールされているkernel と kernel headers のバージョンが違う可能性があります。
# /etc/rc.d/init.d/vboxdrv setup
Stopping VirtualBox kernel modules [ OK ]
Uninstalling old VirtualBox DKMS kernel modules [ OK ]
Trying to register the VirtualBox kernel modules using DKMSError! echo
Your kernel headers for kernel 2.6.38.6-26.rc1.fc15.x86_64 cannot be found at
/lib/modules/2.6.38.6-26.rc1.fc15.x86_64/build or /lib/modules/2.6.38.6-26.rc1.fc15.x86_64/source.
[失敗]
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules [失敗]
(Look at /var/log/vbox-install.log to find out what went wrong)
そのため、kernel関係のバージョンを確認します。
# yum list kernel* 読み込んだプラグイン:langpacks, presto, refresh-packagekit インストール済みパッケージ kernel.x86_64 2.6.38.6-26.rc1.fc15 @anaconda-InstallationRepo-201105131943.x86_64 kernel-debug.x86_64 2.6.40-4.fc15 @updates kernel-devel.x86_64 2.6.42.9-2.fc15 @updates kernel-headers.x86_64 2.6.42.9-2.fc15 @updates 利用可能なパッケージ kernel.x86_64 2.6.42.9-2.fc15 updates kernel-debug.x86_64 2.6.42.9-2.fc15 updates kernel-debug-devel.x86_64 2.6.42.9-2.fc15 updates kernel-doc.noarch 2.6.42.9-2.fc15 updatesこの場合、kernel のバージョンは 2.6.38.6-26.rc1.fc15 で、 kernel headers は 2.6.42.9-2.fc15 で、2つのバージョンが異なります。
そのため、yumで kernelをアップデートした後、リブートします。 これでkernel と kernel headers のバージョンを同じになります。
# yum update kernel
・・・
・・・
==========================================================================================
パッケージ アーキテクチャ
バージョン リポジトリー 容量
==========================================================================================
インストールしています:
kernel x86_64 2.6.42.9-2.fc15 updates 26 M
更新:
mdadm x86_64 3.2.3-6.fc15 updates 326 k
依存性関連でのインストールをします。:
netxen-firmware noarch 4.0.534-4.fc15 fedora 1.1 M
依存性関連での更新をします。:
grubby x86_64 7.0.16-5.fc15 updates 43 k
linux-firmware noarch 20120206-0.1.git06c8f81.fc15 updates 10 M
トランザクションの要約
==========================================================================================
インストール 2 パッケージ
アップグレード 3 パッケージ
総ダウンロード容量: 38 M
・・・
アップデートしたカーネルに変更するため、リブートを行います。その後、再度VirtualBoxのsetupを実施します。 全て成功すると、以下のようになります。
# /etc/rc.d/init.d/vboxdrv setup Stopping VirtualBox kernel modules [ OK ] Uninstalling old VirtualBox DKMS kernel modules [ OK ] Trying to register the VirtualBox kernel modules using DKMS[ OK ] Starting VirtualBox kernel modules [ OK ]