How I installed virtualbox 4.3 on CentOS 6.5 x86_64

Step 1: Install the EPEL repository
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ yum repolist

Step 2: Create /etc/yum.repos.d/virtualbox.repo
[virtualbox]
name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox
baseurl=http://download.virtualbox.org/virtualbox/rpm/el/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc

Step 3: Install the necessary system packages
yum groupinstall -y 'Development Tools'
yum install -y kernel-devel
yum install -y dkms

Step 4: Install VirtualBox
yum list | grep -i virtualbox  # list the available choices
yum install VirtualBox-4.3  # choose the most recent one
service vboxdrv setup

Step 5: Add users to the vboxusers group
usermod -a -G vboxusers <your_user_name>

Step 6: Run VirtualBox
VirtualBox

ที่มา: http://joelinoff.com/blog/?p=1444


cant launch virtual box Trying to register the VirtualBox k


DKMS: add completed.
Failed to install using DKMS, attempting to install without
Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.


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.32-431.el6.x86_64 cannot be found at
/lib/modules/2.6.32-431.el6.x86_64/build or /lib/modules/2.6.32-431.el6.x86_64/source.
[FAILED]
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules [FAILED]
(Look at /var/log/vbox-install.log to find out what went wrong)



My solution to this problem was to do the following:
1) Go to the followning folder to find out the environment name:
[root@localhost ~]$ ls /usr/src/kernels
2.6.32-431.5.1.el6.x86_64

2) Open the root “.bashrc” file for editing with Nano.
[root@localhost ~]$ nano .bashrc

3) The output from the command for the 1st step was used to insert a line in the “.bashrc” file. Inside of the file I added the following line:
export KERN_DIR=/usr/src/kernels/2.6.32-431.5.1.el6.x86_64

4) After saving the file I executed the “.bashrc” lines.
[root@localhost ~]$ source .bashrc

5) Finally I ran the VirtualBox rebuilding script:
[root@localhost ~]$ /etc/init.d/vboxdrv setup






0 ความคิดเห็น:

แสดงความคิดเห็น