本文来自:http://www.linuxsight.com/blog/2019
不记得从什么时候起,各大Linux发行版,安装vitualbox开始有问题。
rpm -ivh VirtualBox-4.0-4.0.8_71778_fedora15-1.i686.rpm
Preparing… ########################################### [100%]
1:VirtualBox-4.0 ########################################### [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 [确定]
Uninstalling old VirtualBox DKMS kernel modules [确定]
Trying to register the VirtualBox kernel modules using DKMSError! echo
Your kernel headers for kernel 2.6.38.6-27.fc15.i686.PAE cannot be found at
/lib/modules/2.6.38.6-27.fc15.i686.PAE/build or /lib/modules/2.6.38.6-27.fc15.i686.PAE/source.
[失败]
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules [失败]
(Look at /var/log/vbox-install.log to find out what went wrong)
fedora opensuse 都不能正常安装 ubuntu就没问题,而mandriva可以用源里的。
今日在fedora15又尝试了一番,最后终于成功。理论上来说,只需要安装kernel-devel, dkms, gcc,但发现内核是RC,并不匹配,所以需要升级内核,而内核是PAE(PAE即物理地址扩展,允许在32位系统使用最大64GB内存),所以还需要的是kernel-PAE-devel,而dkms不装试过也可以启动。
我先做个总结:
1、升级内核:yum update kernel
2、安装必要支持:yum install dkms kernel-PAE-devel qt qt-x11 gcc
3、最后安装:rpm -ivh VirtualBox-4.0-4.0.8_71778_fedora15-1.i686.rpm
有人指出要添加用户到组,我试过没有必要,或者因每个人机器不同而有所差别。
以下是折腾过程,如若发现有哪一步是不需要的,欢迎指出。
首先下载好官方的RPM包。
http://dlc.sun.com.edgesuite.net/virtualbox/4.0.8/VirtualBox-4.0-4.0.8_71778_fedora15-1.i686.rpm
升级内核:fedora15正式版的内核为:kernel-PAE-2.6.38.6-26.rc1.fc15.i686 当初我还以为我下错版,不过我们可以升级。
yum update kernel 升级到kernel-PAE-2.6.38.6-27.fc15.i686
升级完成后重启电脑
[linuxsight@linuxsight ~]$ uname -r
2.6.38.6-27.fc15.i686.PAE
发现内核已经更新了,但我们还留下一个旧的内核,把它删除。
[root@linuxsight 下载]# rpm -qa |grep kernel
abrt-addon-kerneloops-2.0.2-5.fc15.i686
kernel-headers-2.6.38.6-27.fc15.i686
kernel-devel-2.6.38.6-27.fc15.i686
kernel-PAE-2.6.38.6-26.rc1.fc15.i686
kernel-PAE-2.6.38.6-27.fc15.i686
[root@linuxsight 下载]# yum remove kernel-PAE-2.6.38.6-26.rc1.fc15.i686
已加载插件:fastestmirror, langpacks, presto, refresh-packagekit
设置移除进程
解决依赖关系
–> 执行事务检查
—> Package kernel-PAE.i686 0:2.6.38.6-26.rc1.fc15 will be 删除
–> 完成依赖关系计算
依赖关系解决
================================================================================
软件包
架构 版本 仓库 大小
================================================================================
正在删除:
kernel-PAE
i686 2.6.38.6-26.rc1.fc15 @anaconda-InstallationRepo-201105131946.i686 80 M
事务概要
================================================================================
Remove 1 Package(s)
Installed size: 80 M
确定吗?[y/N]:y
下载软件包:
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
Warning: RPMDB altered outside of yum.
正在删除 : kernel-PAE-2.6.38.6-26.rc1.fc15.i686 1/1
删除:
kernel-PAE.i686 0:2.6.38.6-26.rc1.fc15
完毕!
我们还需要下载几个东西:
yum install dkms
依赖关系解决
================================================================================
软件包 架构 版本 仓库 大小
================================================================================
正在安装:
dkms noarch 2.1.1.2-2.gitb66d7406.fc15 fedora 105 k
为依赖而安装:
kernel-devel i686 2.6.38.6-27.fc15 updates 6.7 M
事务概要
================================================================================
Install 2 Package(s)
再安装
[root@linuxsight 下载]# yum install kernel-PAE-devel
已加载插件:fastestmirror, langpacks, presto, refresh-packagekit
Loading mirror speeds from cached hostfile
* fedora: mirror.bjtu.edu.cn
* rpmfusion-free-rawhide: ftp.sjtu.edu.cn
* rpmfusion-nonfree-rawhide: ftp.sjtu.edu.cn
* updates: mirrors.ustc.edu.cn
设置安装进程
解决依赖关系
–> 执行事务检查
—> Package kernel-PAE-devel.i686 0:2.6.38.6-27.fc15 will be 安装
–> 完成依赖关系计算
依赖关系解决
================================================================================
软件包 架构 版本 仓库 大小
================================================================================
正在安装:
kernel-PAE-devel i686 2.6.38.6-27.fc15 updates 6.8 M
事务概要
================================================================================
Install 1 Package(s)
总下载量:6.8 M
Installed size: 24 M
确定吗?[y/N]:y
下载软件包:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 6.8 M
kernel-PAE-devel-2.6.38.6-27.fc15.i686.rpm | 6.8 MB 00:21
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
正在安装 : kernel-PAE-devel-2.6.38.6-27.fc15.i686 1/1
已安装:
kernel-PAE-devel.i686 0:2.6.38.6-27.fc15
我们还需要:
[root@linuxsight 下载]#yum install gcc
[root@linuxsight 下载]# yum install qt qt-x11
最后安装,总算成功。
[root@linuxsight 下载]# rpm -ivh VirtualBox-4.0-4.0.8_71778_fedora15-1.i686.rpm
Preparing…
########################################### [100%]
1:VirtualBox-4.0 ########################################### [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 [确定]
Uninstalling old VirtualBox DKMS kernel modules [确定]
Trying to register the VirtualBox kernel modules using DKMS[确定]
Starting VirtualBox kernel modules