My CentOS version is:
#cat/etc/issue:
CentOS Release 6.2 (Final)
1. Install the associated package
Yum install kernel-headers kernel-devel gcc make
2. View the downloaded kernel code version
ls/usr/src/kernels/
2.6.32-279.14.1.el6.i686
3. View the kernel version of this machine
Uname-r
2.6.32-220.2.1.el6.i686
4. The above 2 versions must be consistent, otherwise there will be a problem, yum install kernel-headers installed should be the latest version, use the following command to upgrade the native kernel to the current version:
Yum Upgrade kernel
After kernel upgrade reboot, check the native kernel again:
Uname-r
2.6.32-279.14.1.el6.i686
5. Start the installation of VB
[Root@linux]# cd/etc/yum.repos.d/
[Root@linux]# wget Http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
[Root@linux]# Yum Install VirtualBox-4.2
6. Assigning a user to a VB group
/usr/sbin/usermod-a-G vboxusers Root
7. Start VirtualBox [Root@linux] #virtualbox