标签:
根据公司需求,要安装virtualBox进行服务器的搭建。我这个版本安装选用4.1版本。
为什么呢?我这边的服务器,试过4.2/3、5.0版本,安装成功,以后都是不能正常使用。最后实验4.1版本成功!
su - ## OR ##sudo -i
cd /etc/yum.repos.d/
## CentOS 6.1/6/5.7 and Red Hat (RHEL) 6.1/6/5.7 users
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
Update packages
yum update
Check that that you are running latest installed kernel version
Output of following commands version numbers should match:
rpm -qa kernel |sort |tail -n 1
uname -r
//两个命令下的kernel的版本应该是一致的
Note: If you got kernel update or run older kernel than newest installed then reboot:
reboot
CentOS 5 and Red Hat (RHEL) 5 needs EPEL repository, install it with following command:
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms ## PAE kernel users install ##
yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-PAE-devel dkms
yum install VirtualBox-4.1
Note:
This command create automatically vboxusers group and VirtualBox user must be member of that group.
This command also build needed kernel modules.
Rebuild kernel modules with following command:
/etc/init.d/vboxdrv setup
## OR ##
service vboxdrv setup
Replace user_name with your own user name or some another real user name.
usermod -a -G vboxusers user_name
Use launcher from menu or simply run:
VirtualBox
If you have problems with KERN_DIR parameter or your kernel directory is not automatically detected then set KERN_DIR environment variable manually, using following method:
## Current running kernel on Fedora ##
KERN_DIR=/usr/src/kernels/`uname -r`
## Current running kernel on CentOS and Red Hat (RHEL) ##
KERN_DIR=/usr/src/kernels/`uname -r`-`uname -m`
## Fedora example ##
KERN_DIR=/usr/src/kernels/2.6.33.5-124.fc13.i686 ## CentOS and Red Hat (RHEL) example ##
KERN_DIR=/usr/src/kernels/2.6.18-194.11.1.el5-x86_64 //环境变量的配置要根据实际情况去配置
## Export KERN_DIR
##export KERN_DIR
1.安装的时发现没有出现图形化界面,是因为virtualBox默认安装内存大小是512M,而centOS默然要求是528M,所以安装的时候加大内存就可以了。
Centos官网的一些解释
https://wiki.centos.org/HowTos/I_need_the_Kernel_Source
https://ask.fedoraproject.org/en/question/40926/trying-to-install-virtualbox-or-vmware-fedora-20/
CentOS 6.5 VirtualBox 安装和常见问题解答
标签:
原文地址:http://www.cnblogs.com/hardy-test/p/5284916.html