Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Virtualization»How to Install Oracle VirtualBox 6.0 on CentOS/RHEL 7/6

    How to Install Oracle VirtualBox 6.0 on CentOS/RHEL 7/6

    By RahulFebruary 4, 20192 Mins Read

    Oracle VirtualBox is a cross-platform virtualization application. It installs on your existing Intel or AMD-based computers, whether they are running Windows, Mac, Linux or Solaris operating systems. It extends the capabilities of your existing computer so that it can run multiple operating systems at the same time. Click here to read more about VirtualBox

    Advertisement

    Oracle has released its new major version VirtualBox 6.0.4 . In this release VirtualBox has improves stability and fixes regressions. To read more about this release read changelog. This article will help you to install Oracle VirtualBox 6.0 on CentOS and Redhat systems using Yum.

    Step 1 – Add Required Yum Repositories

    Firstly you are required to add VirtualBox yum repository in your system. Download repository file from its official site and place it under at /etc/yum.repos.d/virtualbox.repo .First navigate to /etc/yum.repos.d/ directory and use one of below commands as per your operating system.

    cd /etc/yum.repos.d/
    wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
    

    The CentOS and RedHat users also required to add EPEL yum repository using one of the following commands.

    ### On CentOS/RHEL 7 ### 
    rpm -Uvh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    
    ### On CentOS/RHEL 6 ### 
    rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    

    Step 2 – Install Required Packages

    Before installing VirtualBox make sure to install all required packages to run VirtualBox like kernel-headers, kernel-devels etc. Use the following command to install the required packages.

    yum install gcc make patch  dkms qt libgomp
    yum install kernel-headers kernel-devel fontforge binutils glibc-headers glibc-devel
    

    After installing latest kernel and kernel headers, let’s reboot your system and start with Latest kernel.

    reboot
    

    Step 3 – Setup Environment Variable

    VirtualBox installation required kernel source code to install required modules, So we need to configure environment variable KERN_DIR to which VirtualBox get kernel source code. In my case latest kernel source is available in 2.6.32-504.3.3.el6.x86_64 directory under /usr/src/kernels/ . Make sure you are using correct source path.

    export KERN_DIR=/usr/src/kernels/`uname -r`
    

    Step 4 – Install Oracle VirtualBox and Setup

    Use the following command to install VirtualBox using the yum command line tool. It will install the latest version of VirtualBox 5.2 on your system.

    yum install VirtualBox-6.0
    

    After installation, we need to rebuild kernel modules using the following command.

    service vboxdrv setup
    

    Step 5 – Launch VirtualBox

    Use following command to start VirtualBox from X windows. You can switch to GUI mode using init 5 or startx commands from terminal.

    virtualbox
    

    Install Oracle VirtualBox

    Install Oracle VirtualBox virtualization VMs
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Install VirtualBox on macOS

    How to Install VirtualBox on MacOS

    How to Install VirtualBox on Ubuntu 22.04

    How to Install VirtualBox 7.0 on Ubuntu 22.04

    How to Install VirtualBox on Debian 11

    How To Install VirtualBox 7.0 on Debian 11

    View 58 Comments

    58 Comments

    1. Hreinn Juliusson on May 13, 2019 9:17 am

      This seems to work for me, where all other guides have failed.

      Many thanks,
      Hreinn!

      Reply
    2. DeanM on January 25, 2019 5:54 pm

      Centos 7.6 (kernel 3.10.0-957.1.3.el7.x86_64)
      VirtualBox-5.2-5.2.24_128163_el7-1.x86_64

      Rather than
      sudo service vboxdrv setup
      which others have pointed out fails, use:
      sudo /usr/lib/virtualbox/vboxdrv.sh setup

      Reply
    3. Monojit on February 22, 2018 11:02 am

      ]# vboxmanage -v
      WARNING: The vboxdrv kernel module is not loaded. Either there is no module
      available for the current kernel (3.10.0-693.11.6.el7.x86_64) or it failed to
      load. Please recompile the kernel module and install it by

      sudo /sbin/vboxconfig

      You will not be able to start VMs until this problem is fixed.
      5.2.6r120293
      Getting this error while installing on centos7. Any idea to fix this?

      Reply
    4. alberto on November 26, 2017 3:31 pm

      hi i have a quetion for you:

      There were problems setting up VirtualBox. To re-start the set-up process, run
      /sbin/vboxconfig

      how to resolve this problem???

      Reply
    5. Nibs Niven on November 21, 2017 11:56 pm

      Your title is misleading. There is no Virtualbox release for Fedora 27.

      Reply
      • Rahul K. on November 22, 2017 4:40 am

        Hi Nibs, Thanks for your comments, I have updated the title.

        Actually below page was opening but its opening 26 page.

        http://download.virtualbox.org/virtualbox/rpm/fedora/27/

        Reply
    6. colebras on February 22, 2017 11:41 am

      Thank you, just what I needed. Worked perfect with CentOS 7.

      I had to use:
      /sbin/vboxconfig
      instead:
      service vboxdrv setup

      Reply
    7. Antonio Augusto on January 25, 2017 4:10 pm

      I have instaled at Cents 7 and found the message:
      Running transaction
      Instalando : VirtualBox-5.1-5.1.14_112924_el7-1.x86_64 1/1
      Creating group ‘vboxusers’. VM users must be member of that group!
      vboxdrv.sh: failed: Look at /var/log/vbox-install.log to find out what went wrong.
      There were problems setting up VirtualBox. To re-start the set-up process, run
      /sbin/vboxconfig as root.
      Verifying : VirtualBox-5.1-5.1.14_112924_el7-1.x86_64 1/1

      Instalados:
      VirtualBox-5.1.x86_64 0:5.1.14_112924_el7-1
      ConcluĂ­do!

      Seeing the logs:
      Makefile:194: *** Error: KERN_DIR does not point to a directory. Pare.

      Reply
    8. erick on December 3, 2016 8:25 am

      fedora server 23
      please help me,
      # service vboxdrv setup
      The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

      #/usr/lib/virtualbox/vboxdrv.sh setup
      vboxdrv.sh: Building virtualbox kernel modules.
      vboxdrv.sh: Building virtualbox kernel services.
      vboxdrv.sh: Building virtualbox kernel modules.
      vboxdrv.sh: failed: modprobe vboxdrv failed. please use ‘dmesg’ to find out why

      (cann you help please ) how find the errors ..

      Reply
    9. scott on November 25, 2016 1:10 am

      sweet instructions, worked great on CentOS 7

      Reply
    10. Siraj Jamdar on September 27, 2016 8:08 am

      In step 4, I got the error reported by others:
      # service vboxdrv setup
      The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

      Solution found in this link: http://unix.stackexchange.com/questions/233583/service-vboxdrv-setup-throwing-error-when-installing-virtualbox-on-centos-7

      # /usr/lib/virtualbox/vboxdrv.sh setup
      vboxdrv.sh: Building VirtualBox kernel modules.
      vboxdrv.sh: Starting VirtualBox services.

      # systemctl status vboxdrv
      â—Ź vboxdrv.service – VirtualBox Linux kernel module
      Loaded: loaded (/usr/lib/virtualbox/vboxdrv.sh; enabled; vendor preset: disabled)
      Active: active (exited) since Tue 2016-09-27 17:19:16 AEST; 37min ago
      Process: 22375 ExecStart=/usr/lib/virtualbox/vboxdrv.sh start (code=exited, status=0/SUCCESS)

      Sep 27 17:19:15 hostname systemd[1]: Starting VirtualBox Linux kernel module…
      Sep 27 17:19:16 hostname vboxdrv.sh[22375]: vboxdrv.sh: Starting VirtualBox services.
      Sep 27 17:19:16 hostname systemd[1]: Started VirtualBox Linux kernel module.

      Reply
    11. Moksud on September 20, 2016 3:35 pm

      Hi,
      epel repo has changed.
      existing link is not working
      Please use this instead:
      wget

      Reply
      • Rahul K. on September 22, 2016 7:42 am

        Thanks Moksud,

        I have updated urls.

        Reply
    12. Koen on August 5, 2016 10:55 am

      Why isn’t anyone mentioning that you should definitely add your user to the vboxusers group. Otherwise you cant use USB devices etc

      Reply
    13. Daniel Gomes on June 27, 2016 2:23 pm

      Hi bro, please fix epel-release-7-7.noarch.rpm or people will get 404.
      I love your post, btw!
      Thanks!

      Reply
      • myadmin on June 28, 2016 3:50 am

        Thanks Daniel,
        Tutorial has been updated.

        Reply
    14. Zimo on May 1, 2016 1:25 pm

      Thank you very much.

      I had an issue with Virtual Box on Fedora 23:

      ” The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing

      ‘/etc/init.d/vboxdrv setup’ ”

      I did not follow exactly all you steps to fix it. I just installed the required packages (and setup the environment variable just to be sure). I installed after that the AMD64 version of Virtual Box available on the website and it is working now! 🙂

      Reply
    15. vishal singh on April 10, 2016 7:35 am

      i got error kernel driver not installed (rc=1908)
      can you plz help me out.

      Reply
    16. Joe on April 9, 2016 3:53 pm

      Yes very helpful except the ‘#service vboxdrv setup’ failed to run on my CentOS 7… any help? but I think the Virtualbox installation should still work right?

      Reply
    17. Surekha Anantharaman on April 8, 2016 12:02 am

      Thanks much. Was so helpful!

      Reply
    18. dar on February 14, 2016 5:22 pm

      Very helpful, thank you.

      Reply
    19. Ari on February 2, 2016 1:22 pm

      Hello, I have the following error in the installation:
      /usr/lib/virtualbox/vboxdrv.sh setup
      Stopping VirtualBox kernel modules [ OK ]
      Uninstalling old VirtualBox DKMS kernel modules [ OK ]
      Trying to register the VirtualBox kernel modules using DKMS[ OK ]
      Starting VirtualBox kernel modules [FALHOU]
      (modprobe vboxdrv failed. Please use ‘dmesg’ to find out why)

      Reply
    20. Scott on January 3, 2016 10:26 am

      Worked great in Cent OS 7! Thanks so much!

      Reply
    21. Arun D on December 4, 2015 11:38 pm

      You are my savior, was planning to wipe-out OEL before I stumbled on this site. I spent a day to find a resolution to fix Vbox installation issue, mainly due to following errors.
      1) vboxdrv: disagrees about version of symbol module_layout
      2) virtualbox kernel driver not installed (rc=-1908)
      3) For Vmware : C header files matching your running kernel were not found. Refer to your distribution’s documentation for installation instructions.

      I had bad a setting for KERN_DIR grrrrrrr

      Solution:
      So, correct KERN_DIR settings in .bashrc and install right “kernel-devel” and kernel-headers”

      Reply
    22. ROCCITYSCUBA on December 4, 2015 8:24 am

      Searched for awhile before I stumbled on this gem of a post – exactly what I needed to get VB up and running – Thanks!

      The only thing I needed to do was to enable AMD-V Support in my BIOS to install a x64 version of windows, and after that, all is good!

      Reply
    23. Marty on November 18, 2015 12:00 pm

      Thanks for this!

      Reply
    24. simon on November 3, 2015 4:52 pm

      Hi, your post was almost perfect ! Unfortunately at step 4, i get this :

      [[email protected] VirtualBoxVMS]# service vboxdrv setup
      The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

      And

      [[email protected] VirtualBoxVMS]# /etc/init.d/vboxdrv setup
      -bash: /etc/init.d/vboxdrv: Aucun fichier ou dossier de ce type

      Some hints ?

      Reply
    25. Joe on October 15, 2015 8:20 pm

      When I try to pull up Virtual box I get the below error

      [[email protected] init.d]# virtualbox &
      [1] 20252
      [[email protected] init.d]# VirtualBox: supR3HardenedMainGetTrustedMain: dlopen(“/usr/lib/virtualbox/VirtualBox.so”,) failed: libGL.so.1: cannot open shared object file: No such file or directory

      Reply
    26. zamaan on September 12, 2015 2:46 pm

      Thank you, really helped.

      Reply
    27. Tifanix on August 13, 2015 8:19 pm

      Thanks for this tutorial man!, its the only one I could find that actually works! 🙂

      Reply
    28. Tushar on July 30, 2015 10:29 pm

      hi folks,

      I was setting up virtual box and vagrant in an openstack instance .After working on Centos and RHEL 7 i found the same error and stuck in same point. Need your guide on further work out.
      Do you think I need to fall back to old version of Centos/Rhel ( like 6 or 5) or I need to try to setup in version 7. The below error is the point i was stuck whiling configuring kernel for virtual box.
      There is discrepancies in output of “uname –r” and # cat /usr/src/kernels/

      [[email protected] kernels]$ ls -lrth
      total 8.0K
      drwxr-xr-x. 22 root root 4.0K Jul 30 21:28 3.10.0-123.20.1.el7.x86_64.debug
      drwxr-xr-x. 22 root root 4.0K Jul 30 21:29 3.10.0-123.20.1.el7.x86_64
      [[email protected] kernels]$ uname -r
      3.10.0-229.4.2.el7.x86_64
      [[email protected] kernels]$

      Error is as follows.

      [[email protected] ~]# /etc/init.d/vboxdrv setup
      libkmod: kmod_config_parse: /etc/modprobe.d/ccatg-ipv6.conf line 1: ignoring bad line starting with ‘option’
      Stopping VirtualBox kernel modules [ OK ]
      Uninstalling old VirtualBox DKMS kernel modules [ OK ]
      Removing old VirtualBox pci kernel module [ OK ]
      Removing old VirtualBox netadp kernel module [ OK ]
      Removing old VirtualBox netflt kernel module [ OK ]
      Removing old VirtualBox kernel module [ OK ]
      Trying to register the VirtualBox kernel modules using DKMSError! echo
      Your kernel headers for kernel 3.10.0-229.4.2.el7.x86_64 cannot be found at
      /lib/modules/3.10.0-229.4.2.el7.x86_64/build or /lib/modules/3.10.0-229.4.2.el7.x86_64/source.
      [FAILED]
      (Failed, trying without DKMS)
      Recompiling VirtualBox kernel modules [ OK ]
      Starting VirtualBox kernel modules [FAILED]
      (modprobe vboxpci failed. Please use ‘dmesg’ to find out why)
      [[email protected] ~]#
      [[email protected] ~]# rpm -qa | grep kernel
      kernel-debug-devel-3.10.0-123.20.1.el7.x86_64
      kernel-tools-libs-3.10.0-229.4.2.el7.x86_64
      kernel-tools-3.10.0-229.4.2.el7.x86_64
      kernel-headers-3.10.0-123.20.1.el7.x86_64
      kernel-devel-3.10.0-123.20.1.el7.x86_64
      kernel-3.10.0-229.4.2.el7.x86_64

      Reply
    29. Tushar on July 29, 2015 10:08 pm

      I follow the process and getting modprobe error

      [[email protected] ~]# pwd
      /root
      [[email protected] ~]# /etc/init.d/vboxdrv setup
      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 3.10.0-123.el7.x86_64 cannot be found at
      /lib/modules/3.10.0-123.el7.x86_64/build or /lib/modules/3.10.0-123.el7.x86_64/source.
      [FAILED]
      (Failed, trying without DKMS)
      Recompiling VirtualBox kernel modules [ OK ]
      Starting VirtualBox kernel modules [FAILED]
      (modprobe vboxpci failed. Please use ‘dmesg’ to find out why)

      Reply
    30. Akiyama on June 24, 2015 8:56 am

      These instructions were very helpful and I followed this line by line, however I still fail to build:

      # service vboxdrv setup
      Stopping VirtualBox kernel modules [ OK ]
      Uninstalling old VirtualBox DKMS kernel modulesldconfig: Can’t create temporary cache file /etc/ld.so.cache~: Permission denied
      ldconfig exited ungracefully
      ldconfig: Can’t create temporary cache file /etc/ld.so.cache~: Permission denied
      ldconfig exited ungracefully
      Error! There are no instances of module: vboxhost
      4.3.28 located in the DKMS tree.
      [ OK ]
      Trying to register the VirtualBox kernel modules using DKMSldconfig: Can’t create temporary cache file /etc/ld.so.cache~: Permission denied
      ldconfig exited ungracefully
      ldconfig: Can’t create temporary cache file /etc/ld.so.cache~: Permission denied
      ldconfig exited ungracefully
      [ OK ]
      Starting VirtualBox kernel modules [FAILED]
      (modprobe vboxdrv failed. Please use ‘dmesg’ to find out why)

      Any ideas anyone?

      Reply
    31. David Bradbury on January 8, 2015 10:15 am

      Hi Rahul
      Very helpful. The only other thing that I needed to do (and this took ages to find – this ticket https://www.virtualbox.org/ticket/12229 helped ) was to install a dependency needed but not automatically installed as we are using Oracle Unbreakable Linux (release 6.6)
      Yum install kernel-uek-devel
      the kernel source code environment variable on our server was then configured
      export KERN_DIR=/usr/src/kernels/3.8.13-55.1.2.el6uek.x86_64

      regards

      Reply
    32. jony on September 1, 2014 5:48 am

      Downloading Packages:
      http://download.virtualbox.org/virtualbox/rpm/el/6/x86_64/VirtualBox-4.3-4.3.14_95030_el6-1.x86_64.rpm: [Errno 12] Timeout on http://download.virtualbox.org/virtualbox/rpm/el/6/x86_64/VirtualBox-4.3-4.3.14_95030_el6-1.x86_64.rpm: (28, ‘Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds’)
      Trying other mirror.

      Error Downloading Packages:
      VirtualBox-4.3-4.3.14_95030_el6-1.x86_64: failure: VirtualBox-4.3-4.3.14_95030_el6-1.x86_64.rpm from virtualbox: [Errno 256] No more mirrors to try.

      Reply
    33. Andrew on August 24, 2014 5:09 pm

      Hello.

      Can you please tell how to setup virtual machine (with one HDD for example) and tell it to start automatically with system startup from command line (I don’t have a X windows)

      Reply
    34. tony on August 22, 2014 5:50 pm

      thanks for this really great tutorial which has helped me set up multiple vm’s inside centos

      Reply
    35. Dilip rathod on August 9, 2014 9:09 am

      [[email protected] student]# ls /usr/src/kernels3.14.15-100.fc19.i686

      Reply
    36. Dilip rathod on August 9, 2014 9:07 am

      Please help to setup oracle Virtual Box 4.3
      I have installed of fedora 19 using yum Virtual-Box-4.3 using instruction given at if-not-true-then-false.com

      when i try to set up vm i get following error
      [[email protected] student]# service vboxdrv setup
      Stopping VirtualBox kernel modules [ OK ]
      Recompiling VirtualBox kernel modules [FAILED]
      (Look at /var/log/vbox-install.log to find out what went wrong)
      [[email protected] student]# cat /var/log/vbox-install.log
      Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR= and run Make again. Stop.
      [[email protected] student]#

      Reply
    37. Kaushik on July 8, 2014 3:40 pm

      Yep I did that already. and my whole CentOS 6.5 is uptodate

      Reply
    38. David Bradbury on July 1, 2014 11:23 am

      Exactly what I needed after assuming that just the virtualbox rpm file would install everything authomatically!
      Search term “oracle virtualbox installation steps centos”
      Only had to add –skip-broken to the end of the line “yum install kernel-headers …… ” as autotrace, fontforge and xdg-utils complained about dependancy problems.

      Virtual box runs well and imported the virtual server from one of our other hosts, no problems.

      Many thanks
      David

      Reply
      • Kaushik on July 7, 2014 9:27 pm

        Hi,

        I tried to install the VirtualBox and I get this

        [[email protected] ~]# service vboxdrv setup
        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-042stab090.4 cannot be found at
        /lib/modules/2.6.32-042stab090.4/build or /lib/modules/2.6.32-042stab090.4/source.
        [FAILED]
        (Failed, trying without DKMS)
        Recompiling VirtualBox kernel modules [FAILED]
        (Look at /var/log/vbox-install.log to find out what went wrong)

        In var/log/vbox-install.log
        Uninstalling modules from DKMS
        removing old DKMS module vboxhost version 4.3.12

        ——————————
        Deleting module version: 4.3.12
        completely from the DKMS tree.
        ——————————
        Done.
        Attempting to install using DKMS

        Creating symlink /var/lib/dkms/vboxhost/4.3.12/source ->
        /usr/src/vboxhost-4.3.12

        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= and run Make again. Stop.

        Output of rpm -qa | grep kernel
        [[email protected] ~]# rpm -qa | grep kernel
        dracut-kernel-004-336.el6_5.2.noarch
        kernel-2.6.32-431.20.3.el6.x86_64
        kernel-firmware-2.6.32-431.20.3.el6.noarch
        kernel-devel-2.6.32-431.20.3.el6.x86_64
        kernel-headers-2.6.32-431.20.3.el6.x86_64

        Please help me with this how I can fix the error.

        Reply
        • Rahul on July 8, 2014 4:00 am

          Hello Kaushik

          I fixed same issue sometimes by updating kernel of our system. You may also try to update kernel of your system..

          # yum update kernel

          But be careful with it…

          Reply
          • Kaushik on July 10, 2014 1:54 pm

            Any help with this ??

            Reply
    39. Umesh on April 18, 2014 5:53 am

      # /etc/init.d/vboxdrv setup always failed for me.

      However this worked
      # service vboxdrv setup

      Reply
      • Rahul on April 18, 2014 7:29 am

        Thanks Umesh

        Reply
    40. Andrew on April 18, 2014 2:59 am

      Thanks for the tutorial! When I launch Virtualbox, it flashes on the screen and then disappears. Any ideas?

      Reply
    41. Deemango on March 26, 2014 4:23 pm

      Hie Rahul
      I am getting this error, any idea of a fix
      =============================================
      http://download.virtualbox.org/virtualbox/rpm/el/6/i386/VirtualBox-4.3-4.3.10_92957_el6-1.i686.rpm: [Errno 14] PYCURL ERROR 22 – “The requested URL returned error: 404 Not found”
      Trying other mirror.

      Reply
      • Rahul on March 27, 2014 3:30 am

        Hi Deemango,

        It looks you added repository few days back. Virtualbox has updated its packages revision. Try to clean yum cache and install it again.
        # yum clean all
        # yum install VirtualBox-4.3

        Reply
    42. DrupalFever on March 13, 2014 7:42 pm

      On step 4 you could replace the line:
      # export KERN_DIR=/usr/src/kernels/`uname -r`

      With the line:
      # export KERN_DIR=/usr/src/kernels/`ls /usr/src/kernels`

      This would prevent the error experienced by “bijay”.

      Reply
    43. Dishanka on February 1, 2014 10:22 am

      This work fine for CentOS 6.5. thanks

      Reply
    44. Dishanka on February 1, 2014 10:20 am

      This work fine. thanks.

      Reply
    45. bijay on July 30, 2013 5:09 am

      After running the following command I am getting error, Anyhelp will be highly apreciated.
      # /etc/init.d/vboxdrv setup
      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-358.6.2.el6.x86_64 cannot be found at
      /lib/modules/2.6.32-358.6.2.el6.x86_64/build or /lib/modules/2.6.32-358.6.2.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)

      Reply
      • Rahul on July 30, 2013 5:16 am

        Hi Bijay,

        Can you please paste the content of /var/log/vbox-install.log file.

        Also make sure you have installed kernel-headers, kernel-devel packages and configured KERN_DIR variable.

        Reply
        • bijay on July 30, 2013 2:54 pm

          I have installed all the required packages and configured KERN_DIR variable also.

          Uninstalling modules from DKMS
          removing old DKMS module vboxhost version 4.2.16

          ——————————
          Deleting module version: 4.2.16
          completely from the DKMS tree.
          ——————————
          Done.
          Attempting to install using DKMS

          Creating symlink /var/lib/dkms/vboxhost/4.2.16/source ->
          /usr/src/vboxhost-4.2.16

          DKMS: add completed.
          Failed to install using DKMS, attempting to install without
          Makefile:190: *** Error: KERN_DIR does not point to a directory. Stop.
          ~

          And when I removed the ‘uname -r’ from the KERN_DIR variable and included another variable
          export KERN_INCL=/usr/src/kernels/
          I get the following errors in log file

          Uninstalling modules from DKMS
          removing old DKMS module vboxhost version 4.2.16

          ——————————
          Deleting module version: 4.2.16
          completely from the DKMS tree.
          ——————————
          Done.
          Attempting to install using DKMS

          Creating symlink /var/lib/dkms/vboxhost/4.2.16/source ->
          /usr/src/vboxhost-4.2.16

          DKMS: add completed.
          Failed to install using DKMS, attempting to install without
          make KBUILD_VERBOSE=1 SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 CONFIG_MODULE_SIG= -C /usr/src/kernels/ modules
          make[1]: *** No rule to make target `modules’. Stop.
          make: *** [vboxdrv] Error 2
          ~
          ~
          ~

          Reply
          • Rahul on July 30, 2013 3:11 pm

            Hi bijay,

            Please send me output of following command

            # rpm -qa | grep kernel

            Also have a look at this forum thread. It may fix your issue
            https://forums.virtualbox.org/viewtopic.php?f=6&t=1505

            Reply
          • DrupalFever on March 13, 2014 7:30 pm

            I made a mistake on my previous reply.
            Here is the correnct set of steps:

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

            2) Open the root “.bashrc” file for editing with Nano.
            [[email protected] ~]$ 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.
            [[email protected] ~]$ source .bashrc

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

            Reply
      • pEpe on April 21, 2016 6:25 am

        Try this:
        yum install kernel-devel-2.6.32-573.18.1.el6.x86_64 (use your current version, $KERN_DIR)

        Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • 20 Basic Linux Commands for the Beginners (Recommended)
    • tail Command in Linux with Examples
    • What is a Orphan Process in Unix/Linux
    • How To Display Warning Message to Unauthorized SSH Access
    • How to Set a Custom SSH Login Banner and MOTD
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.