标签:virtualbox centos yum
昨天给centos6.5装VirtualBox,装了一天也没,今天闲着没事,试试centos7,结果成功了 PS 小弟也是初学linux,许多地方只是找到了解决方法,但不知道为什么,莫见
怪O(∩_∩)O哈!
1、安装centos7,这个就不说了,centos7的安装比旧版本简单的多。
2、连网设置,刚装完centos后用ifconfig查看发现没有ip地址,解决办法:
cd /etc/sysconfig/network-scripts/
vi ifcfg-eno16777736 #注意,我们平常见的都是ifcfg_eth0,具体是什么,用ifconfig看看。
ONBOOT=yes #将onboot设为yes
然后重启网卡: /etc/init.d/network restart
2、安装virtualbox:
1> 下载VirtualBox的RHEL软件库配置文件:
cd /etc/yum.repos.d wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
2> 安装RPMForge.
首先从http://pkgs.repoforge.org/rpmforge-release/上下载相应的rpm文件,我下载的是rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm,具体版本
信息请参考:http://wiki.centos.org/zh/AdditionalResources/Repositories/RPMForge。
<span style="font-family:Courier New;"> rpm -ivh rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm</span>
3> 安装DKMS(Dynamic Kernel Module)
yum install dkms
4> 安装开发环境和内核:
<span style="font-family:Courier New;"> yum groupinstall "Development Tools" yum install kernel-devel</span>
5> 安装qt和qt-
yum install qt qt-x11
我是先在官网下载下来的,版本是VirtualBox-4.3-4.3.26_98988_el7-1.x86_64.rpm, https://www.virtualbox.org/wiki/Downloads
yum install VirtualBox-4.3-4.3.26_98988_el7-1.x86_64.rpm
7> 安装扩展:
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.3.16-95972.vbox-extpack
这个地方就出问题了。
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ExtPackFile, interface IExtPackFile, callee nsISupports
VBoxManage: error: Context: "Install(fReplace, NULL, ptrProgress.asOutParam())" at line 1140 of file VBoxManageMisc.cpp
但此时系统中已有virtualbox了,所以说这个问题可以忽略,继续接下来的。
8> /etc/init.d/vboxdrv setup
这里又出现了错误:
Building the VirtualBox Guest Additions kernel modules [FAILED]
Your system does not seem to be set up to build kernel modules.
Look at /var/log/vboxadd-install.log to find out what went wrong.
Once you have corrected it, you can run /etc/init.d/vboxadd setup to build them.
查看错误日志:
/tmp/vbox.o/Makefile.include.header:97: ***
Error: unable to find the source of your current Linux kernel.Specify KERN_DIR=<directory> and run make again. Stop.
解决办法:
yum install kernel-headers yum install kernel-devel yum install gcc* yum install make reboot
重启
/etc/init.d/vboxdrv setup
大功告成
标签:virtualbox centos yum
原文地址:http://blog.csdn.net/zhang1990214/article/details/45646479