VirtualBox 4.2.12 on Fedora 18/17, CentOS/Red Hat (RHEL) 6.4/5.9

Oracle VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use. VirtualBox is a general-purpose full virtualizer for x86 hardware. Targeted at server, desktop and embedded use, it is now the only professional-quality virtualization solution that is also Open Source Software.

VirtualBox supports a large number of guest operating systems:

  • Windows 3.x
  • Windows NT 4.0
  • Windows 2000
  • Windows XP
  • Windows Server 2003
  • Windows Vista
  • Windows 7
  • DOS
  • Linux (2.4, 2.6, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7)
  • Solaris
  • OpenSolaris
  • OpenBSD

This guide shows howto install VirtualBox 4.2 (currently 4.2.12) on Fedora 18/17/16/15, CentOS 6.4/6.3/5.9, Red Hat (RHEL) 6.4/6.3/6.2/6.1/6/5.9. This guide uses Virtual Box own yum repositories.

Note: Fedora 14 users can install VirtualBox 4.1, Fedora 13 users can install VirtualBox 4.0 and Fedora 12 users can install VirtualBox 3.2.

1. Change to root User

su -
## OR ##
sudo -i

2. Install Fedora or RHEL Repo Files

cd /etc/yum.repos.d/
 
## Fedora 18/17/16/15/14/13/12 users
wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo
 
## CentOS 6.4/6.3/6.2/6.1/6/5.9 and Red Hat (RHEL) 6.4/6.3/6.2/6.1/6/5.9 users
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

3. Update latest packages and check your kernel version

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

Note: If you got kernel update or run older kernel than newest installed then reboot:

reboot

4. Install following dependency packages

CentOS 6/5 and Red Hat (RHEL) 6/5 needs EPEL repository, install it with following command:

## CentOS 6 and RHEL 6 ##
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
 
## CentOS 5 and RHEL 5 ##
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

5. Install VirtualBox Latest Version 4.2 (currently 4.2.12)

yum install VirtualBox-4.2

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

6. Add VirtualBox User(s) to vboxusers Group

Replace user_name with your own user name or some another real user name.

usermod -a -G vboxusers user_name

7. Start VirtualBox

Use launcher from menu or simply run:

VirtualBox

Troubleshooting

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

Check also:

Install VirtualBox Guest Additions on Fedora, CentOS, Red Hat (RHEL)

Follow If Not True Then False Updates!

332 Comments

  1. Thanks for the guide!

    FYI,

    I know you don’t talk about installing the extension packs here but I thought it would be relevant to post my issue/solution. I had an issue installing the extension pack on F16x86. Turns out that there is an issue with bash (see: http://fedoraforum.org/forum/showthread.php?t=272450). So when installing the extension pack, VirtualBox gives some cryptic error about no shell something or other.

    The solution is to run:

    yum reinstall bash

    Then try reinstalling the extension pack.

    • I had the same issue (F16 x86_64) and can confirm that this worked for me.. :)

  2. Uninstalling modules from DKMS
    removing old DKMS module vboxhost version 4.1.6

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

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

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

    • Hi acc,

      Did you check this guide troubleshooting section?

  3. Worked great thanks

  4. i’ve follow all tutorial mr.JR …
    btw here

    uname -r
    3.1.0-7.fc16.x86_64
    [root@Dagga bob]# KERN_DIR=/usr/src/kernels/3.1.0-7.fc16.x86_64
    [root@Dagga bob]# 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 3.1.0-7.fc16.x86_64 cannot be found at
    /lib/modules/3.1.0-7.fc16.x86_64/build or /lib/modules/3.1.0-7.fc16.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)
    [root@Dagga bob]# uname -r
    3.1.0-7.fc16.x86_64
    [root@acc]# export KERN_DIRN
    [root@acc]#KERN_DIR=/usr/src/kernels/3.1.0-7.fc16.x86_64
    [root@acc]# 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 3.1.0-7.fc16.x86_64 cannot be found at
    /lib/modules/3.1.0-7.fc16.x86_64/build or /lib/modules/3.1.0-7.fc16.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)

    • Hi acc,

      First make sure that you have latest packages and needed dependencies on your system:

      yum update
      yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms
      reboot

      Then install and setup VirtualBox:

      yum install VirtualBox-4.1
      service vboxdrv setup

      Do you get still some errors?

  5. Great …. Ty for helping me Mr.JR …

    • You are welcome, nice to hear that you get it working! :)

  6. Works great, thanks!

  7. I’m constantly getting the same error again and again. I’m using Fedora 15 and have followed this tutorial 3 times and read all comments yet still not joy.

    Running /etc/init.d/vboxdrv setup give me an output off

    Stopping VirtualBox kernel modules [ OK ]
    Uninstalling old VirtualBox DKMS kernel modules/etc/init.d/vboxdrv: line 304: /var/log/vbox-install.log: Permission denied
    [ 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 DKMS/etc/init.d/vboxdrv: line 327: /var/log/vbox-install.log: Permission denied
    [FAILED]
    (Failed, trying without DKMS)
    Recompiling VirtualBox kernel modules/etc/init.d/vboxdrv: line 331: /var/log/vbox-install.log: Permission denied
    [FAILED]
    (Look at /var/log/vbox-install.log to find out what went wrong)

    My vbox-install.log has over 250 lines, didn’t fancy pasting it here. Anyway I can get it to you to sort this annoying problem?

    • Hi Speedy,

      Are you running /etc/init.d/vboxdrv setup as root or as normal user? You shouldn’t get any Permission denied errors when you run it as root.

  8. thank you

  9. Same problem, followed the instructions several times, using root, everything is up-to-date. vbox-install.log is also with over 200 lines:

    [root@victor yum.repos.d]# /etc/init.d/vboxdrv setup
    Stopping VirtualBox kernel modules [ OK ]
    Uninstalling old VirtualBox DKMS kernel modules [ 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! Bad return status for module build on kernel: 2.6.41.1-1.fc15.i686.PAE (i686)
    Consult /var/lib/dkms/vboxhost/4.1.6/build/make.log for more information.
    [FAILED]
    (Failed, trying without DKMS)
    Recompiling VirtualBox kernel modules [FAILED]
    (Look at /var/log/vbox-install.log to find out what went wrong)

    • Hi Victor,

      Please post output of following command:

      rpm -qa dkms* gcc*

      And you can paste whole /var/lib/dkms/vboxhost/4.1.6/build/make.log and /var/log/vbox-install.log here (I can shorten/remove those later, if needed). :)

  10. output:
    gcc-4.6.1-9.fc15.i686
    dkms-2.2.0.2-1.fc15.noarch

    /var/lib/dkms/vboxhost/4.1.6/build/make.log:

    DKMS make.log for vboxhost-4.1.6 for kernel 2.6.41.1-1.fc15.i686.PAE (i686)
    Thu Dec 1 11:18:05 EET 2011
    make: Entering directory `/usr/src/kernels/2.6.41.1-1.fc15.i686.PAE’
    LD /var/lib/dkms/vboxhost/4.1.6/build/built-in.o
    LD /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/built-in.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/linux/SUPDrv-linux.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/SUPDrv.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/SUPDrvSem.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/r0drv/alloc-r0drv.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/r0drv/initterm-r0drv.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/r0drv/memobj-r0drv.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/r0drv/mpnotification-r0drv.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/r0drv/powernotification-r0drv.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/r0drv/linux/assert-r0drv-linux.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/r0drv/linux/initterm-r0drv-linux.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.o
    /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjNativeLockKernel’:
    /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:910:12: warning: comparison between pointer and
    /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:910:58: warning: comparison between pointer and
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/r0drv/linux/mp-r0drv-linux.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/r0drv/linux/mpnotification-r0drv-linux.o

    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/misc/handletable.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/misc/handletablectx.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/misc/thread.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/RTStrCopyP.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/strformat.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/strformatrt.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/strformattype.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/strprintf.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/strtonum.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/misc/handletable.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/misc/handletablectx.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/misc/thread.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/RTStrCopyP.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/strformat.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/strformatrt.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/strformattype.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/strprintf.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/strtonum.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/misc/handletable.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/misc/handletablectx.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/misc/thread.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/RTStrCopyP.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/strformat.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/strformatrt.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/strformattype.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/strprintf.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxdrv/common/string/strtonum.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxnetflt/linux/SUPR0IdcClient-linux.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxnetflt/math/gcc/divdi3.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxnetflt/math/gcc/moddi3.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxnetflt/math/gcc/qdivrem.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxnetflt/math/gcc/udivdi3.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxnetflt/math/gcc/umoddi3.o
    LD [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxnetflt/vboxnetflt.o
    LD /var/lib/dkms/vboxhost/4.1.6/build/vboxpci/built-in.o
    CC [M] /var/lib/dkms/vboxhost/4.1.6/build/vboxpci/linux/VBoxPci-linux.o
    /var/lib/dkms/vboxhost/4.1.6/build/vboxpci/linux/VBoxPci-linux.c:39:28: fatal error: asm/amd_iommu.h: No such file or direct
    compilation terminated.
    make[2]: *** [/var/lib/dkms/vboxhost/4.1.6/build/vboxpci/linux/VBoxPci-linux.o] Error 1
    make[1]: *** [/var/lib/dkms/vboxhost/4.1.6/build/vboxpci] Error 2
    make: *** [_module_/var/lib/dkms/vboxhost/4.1.6/build] Error 2
    make: Leaving directory `/usr/src/kernels/2.6.41.1-1.fc15.i686.PAE’

    /var/log/vbox-install.log:

    ninstalling modules from DKMS
    removing old DKMS module vboxhost version 4.1.6

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

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

    DKMS: add Completed.

    Kernel preparation unnecessary for this kernel. Skipping…

    Building module:
    cleaning build area….
    make KERNELRELEASE=2.6.41.1-1.fc15.i686.PAE -C /lib/modules/2.6.41.1-1.fc15.i686.PAE/build M=/var/lib/dkms/vboxhost/4.1.6/bu
    Failed to install using DKMS, attempting to install without
    Makefile:181: *** Error: KERN_DIR does not point to a directory. Stop.

    i assume this ” KERN_DIR does not point to a directory.” could be an issue, not sure.

    thanks anyway.

    • Hi Victor,

      This actually found on troubleshooting section, but try following (as root):

      KERN_DIR=/usr/src/kernels/`uname -r`
       
      export KERN_DIR
       
      /etc/init.d/vboxdrv setup
      • Hi,Jr

        Nope, same problem :(

        • Strange, but I just checked your make.log error message again and looks like that amd_iommu.h file is missing on kernel sources.

          Please run first following command (as root):

          updatedb

          And then post output of following commands here:

          locate amd_iommu.h
           
          uname -a
           
          rpm -qa kernel*
          • i’m new to linux, so maybe there is a obvious error and i don’t see it. or maybe the path to the right kernel isn’t set.

            locate amd_iommu.h runs well, no error

            host -a

            Linux victor.****-**.*** 2.6.41.1-1.fc15.i686.PAE #1 SMP Fri Nov 11 21:43:42 UTC 2011 i686 i686 i386 GNU/Linux

            rpm -qa kernel*

            kernel-PAE-2.6.41.1-1.fc15.i686
            kernel-devel-2.6.41.1-1.fc15.i686
            kernel-headers-2.6.41.1-1.fc15.i686
            kernel-PAE-2.6.40.6-0.fc15.i686
            kernel-PAE-2.6.40.4-5.fc15.i686
            kernel-2.6.41.1-1.fc15.i686
            kernel-PAE-devel-2.6.41.1-1.fc15.i686

            There :)

            • Thanks and no problems Victor, let’s try to together solve this problem. :)

              So you run first updatedb command as root?
              And then locate amd_iommu.h command doesn’t give any output?

              Let’s check following things also, please post output of following commands also:

              ls -la /usr/src/kernels/*/arch/x86/include/asm/*iommu.h
               
              uname -r
               
              echo $KERN_DIR
              • Yes, i did that, as root :). No output :)

                ls -la /usr/src/kernels/*/arch/x86/include/asm/*iommu.h :

                -rw-r–r–. 1 root root 293 Oct 24 10:10 /usr/src/kernels/2.6.41.1-1.fc15.i686/arch/x86/include/asm/iommu.h
                -rw-r–r–. 1 root root 293 Oct 24 10:10 /usr/src/kernels/2.6.41.1-1.fc15.i686.PAE/arch/x86/include/asm/iommu.h

                uname -r :

                2.6.41.1-1.fc15.i686.PAE

                echo $KERN_DIR :

                /usr/src/kernels/2.6.41.1-1.fc15.i686.PAE

                • Thanks again. :)

                  I just checked that the amd_iommu.h file location is changed on Kernel 2.6.41 and looks like that the VirtualBox try to use old location. One quick / temporary fix for this could be symlinking new amd-iommu.h to old amd_iommu.h location with following command:

                  ln -s /usr/src/kernels/2.6.41.1-1.fc15.i686.PAE/include/linux/amd-iommu.h /usr/src/kernels/2.6.41.1-1.fc15.i686.PAE/arch/x86/include/asm/amd_iommu.h

                  Then following command, should return one row (which is symbolic link to /usr/src/kernels/2.6.41.1-1.fc15.i686.PAE/include/linux/amd-iommu.h):

                  ls -la /usr/src/kernels/2.6.41.1-1.fc15.i686.PAE/arch/x86/include/asm/amd_iommu.h

                  Then you could try to run (as root):

                  /etc/init.d/vboxdrv setup

                  Or if this fail then reboot your system and run again all following commands (as root):

                  KERN_DIR=/usr/src/kernels/`uname -r`
                   
                  export KERN_DIR
                   
                  /etc/init.d/vboxdrv setup

                  Please let me know, is it working? :)

                  • Yeeeeeesssss, it’s working! Thank you very very much, JR!

                    • Excellent! :D You are welcome! :)

                      And if Fedora 15 get kernel update and it breaks your VirtualBox then following might be usefull:
                      1. Reboot with new kernel
                      2. Create new symlink

                      ln -s /usr/src/kernels/`uname -r`/include/linux/amd-iommu.h /usr/src/kernels/`uname -r`/arch/x86/include/asm/amd_iommu.h

                      3. Run vboxdrv setup with KERN_DIR parameter

                      KERN_DIR=/usr/src/kernels/`uname -r`
                       
                      export KERN_DIR
                       
                      /etc/init.d/vboxdrv setup

                      ;D

  11. Hi, I’m getting this error after following the tutorial.

    WARNING: The vboxdrv kernel module is not loaded. Either there is no module
    available for the current kernel (3.1.0-7.fc16.i686) or it failed to load. Please recompile the kernel module and install it by sudo /etc/init.d/vboxdrv setup

    I’ve followed these steps:
    KERN_DIR=/usr/src/kernels/`uname -r`
    export KERN_DIR
    /etc/init.d/vboxdrv setup

    any suggestions? part of the warning msg says it can’t run VMs until this is fixed :(

    • Hi GDora,

      Please post output of following commands:

      rpm -qa kernel* |sort
       
      uname -a
  12. Hi JR,

    The rpm output:
    kernel-3.1.0-7.fc16.i686
    kernel-3.1.2-1.fc16.i686
    kernel-devel-3.1.2-1.fc16.i686
    kernel-headers-3.1.2-1.fc16.i686

    The uname output:
    Linux local.domain 3.1.0-7.fc16.i686 #1 SMP Tue Nov 1 21:00:16 UTC 2011 i686 i686 i386 GNU/Linux

    Thanks for helping, really appreciate it.

    • Your problem looks very simple, you are running 3.1.0-7.fc16.i686 kernel and your installed version of kernel-devel and
      kernel-headers packages is 3.1.2-1.fc16.i686.

      So just reboot your system, with newest kernel 3.1.2-1.fc16.i686 and then run following commands again:

      KERN_DIR=/usr/src/kernels/`uname -r`
       
      export KERN_DIR
       
      /etc/init.d/vboxdrv setup
  13. Ok I’m happy to hear it’s a simple solution (hopefully!) but alas, I’m somewhat a newb… how do I boot with the newest kernel? normal reboot?
    Could I trouble you to explain exactly what info I’ve posted? I mean what does the rpm output tell you? why is the first line different to the second one?

    Thanks again

    • Yes normal reboot, I think that there is 5 second delay on default on grub where you can select kernel, but normally it’s first one. So currently select 3.1.2-1.fc16.i686, because it’s latest now. :)

      Yes I can explain:
      rpm output 2 first rows tells that you have two different kernel versions installed and 2 last rows tells that which version of kernel-devel and kernel-headers packages you have. :)

      Then uname -a command tells info about your currently running system and example kernel version, which differ from installed kernel-devel and kernel-headers packages.

  14. THANKS! will check results when I get home.

  15. Worked like a bomb! Thank you kindly :)

    • Excellent! You are welcome! :)

  16. Hi… me again. One re-install of F16 later (unrelated matter – don’t even ask) and I’m stuck at the same point – failing making kernels.

    The rpm-qa kernel* |sort output now is:
    kernel-3.1.0-7.fc16.i686
    kernel-3.1.2-1.fc16.i686

    The uname -a output is:
    Linux localhost.localdomain 3.1.2-1.fc16.i686 #1 SMP Tue Nov 22 08:56:28 UTC 2011 i686 i686 i386 GNU/Linux

    The logfile error from /var/log/vbox-install.log:
    Makefile:181: *** Error: KERN_DIR does not point to a directory. Stop.

    I’ve tried rebooting… not sure what now?

  17. Oh, found a solution. I found this command in a book: yum install make automake autoconf gcc kernel-devel dkms

    Worked fine after that :)

    • Excellent! :)

  18. Great site. I have same issue : unable to run vboxdrv setup using dkms after upgrading kernel (2.6.41.1-1.fc15.x86_64). I use the symbolik link tip (ln -s /usr/src/kernels/`uname -r`/include/linux/amd-iommu.h /usr/src/kernels/`uname -r`/arch/x86/include/asm/amd_iommu.h) and it’s run.
    A suggestion : is it possible to begin with the most recent comments first ?

    • Hi Berni,

      Nice to hear that you got it working… :)

      Good suggestion, it is possible yes, but I have to also think some other changes too, like “Leave a Comment” form position/redesign and maybe paging for comments… :)

  19. Thank you, worked like a charm on centos 6 x64!

  20. this is the error i get when running /etc/init.d/vboxdrv setup:

    [root@choy-notebook arch]# /etc/init.d/vboxdrv setup
    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.1.5-2.fc16.i686.PAE cannot be found at
    /lib/modules/3.1.5-2.fc16.i686.PAE/build or /lib/modules/3.1.5-2.fc16.i686.PAE/source.
    [FAILED]
    (Failed, trying without DKMS)
    Recompiling VirtualBox kernel modules [ OK ]
    Starting VirtualBox kernel modules [FAILED]
    (modprobe vboxdrv failed. Please use ‘dmesg’ to find out why)

    how do i troubleshoot that? thanks!

  21. i just got it working! thanks for this tutorial! i’m now performing a minimal Fedora 16 install on Virtualbox. sweet! :-D

    • Hi hoychoy,

      Excellent to hear that you got it working! :D

  22. Perfect instructions, i installed it on Fedora 16 and it is running as it should,

    thanks for posting instructions

    Cheers

  23. HI
    I’m not regular user of fedora..
    but now i want to use PuTTY with fedora-16 installed on my virtual box..

    when i type ifconfig it shows me lo and p2p1 connection
    it shows me inet add instead of ip adress

    when i try to insert that address in puTTY
    it gives me Timeout error

    As suggested i tried many ways like disabling firewall..

    But no use..

    Please help me out with this.. M working on big project and this shit happened.. Please suggest.. What to do?

    • Hi chaitanya,

      First check your VirtualBox network card configuration? You should get ip for your interface.

      Next check your Fedora 16 network configuration, is it using DHCP or static network settings?

  24. RTR3Init failed with rc=-1912 (rc=-1912)

    The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Executing

    ‘/etc/init.d/vboxdrv setup’

    may correct this. Make sure that you do not mix the OSE version and the PUEL version of VirtualBox.

    how to remove this error please help.
    thanx

    • Hi Kunal,

      Could you post output of following command:

      rpm -qa gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms VirtualBox-4.1 |sort

      Did you tried to run?

      /etc/init.d/vboxdrv setup
  25. usermod -a -G vboxusers user_name

    returns

    usermod: user ‘user_name’ does not exist

    On a fresh Fedora 16 install. Thanks!

    • Hi James,

      You should use real user name (like your own user name):

      usermod -a -G vboxusers james
  26. I confirm successful installation and it works fine.
    Just aside note that needed packages are kernel-devel(obligatory) and dmks(optional – works without this, but required for recompiling VB modules along side with the linux kernel, other way it should be done manually with ‘service vboxdrv setup’).

    yum install kernel-devel
    yum install dmks

    Salutations!

    • To correct myself : dkms

      yum install dkms

      sorry :)

      • Hi Igor,

        Actually both kernel-devel and dkms are on dependency packages list on step 4. Full list is binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms or PAE kernel users yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-PAE-devel dkms… :)

  27. I am having a problem installing Virtualbox under Fedora 14 (Amahi). I have followed every step in your guide but I cannot manage to rebuild kernel modules. Whenever I try to execute

    /etc/init.d/vboxdrv setup

    I have tried your troubleshooting guide as well but I keep getting the following error message:

    [root@amahi-server ~]# KERN_DIR=/usr/src/kernels/`uname -r`
    [root@amahi-server ~]# export KERN_DIR
    [root@amahi-server ~]# /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 DKMS
    Error! Your kernel source for kernel 2.6.35.6-45.fc14.x86_64 cannot be found at
    /lib/modules/2.6.35.6-45.fc14.x86_64/build or /lib/modules/2.6.35.6-45.fc14.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)

    What can be wrong? Could you give me a hand to figure this out? Cheers!

  28. I don’t know what was wrong. I tried several of the tips listed above, rebooted the system and voila… it worked! I manage to run /etc/init.d/vboxdrv setup without errors. I installed my first virtual machine in Fedora 14/Amahi. I now have an up and running virtual machine with Windows 7 x64 running inside Fedora 14/Amahi. This is amazing stuff! Thank you very much.

  29. The basic install worked for me. I ended up here and realized I had forgotten to do a yum install gcc. All good now!

  30. This has worked perfectly. Many thanks!

  31. Hi, I have installed the virtualbox and it works fine. But I’m trying to create a Fedora VM inside it.

    Fedora Lives start normally (In fallback mode), but when I try to install on disk I get an error at the end and I can’t finish the installation.

    It don’t give me any kind of report, just an error.

    Some one have this issue or know how to fix it?

    Thanks

    • Hi Rafael,

      Could you tell your virtual machine specs (Fedora version, RAM…)?

      So you get error without any error message? Could you even take screenshot of this situation?

      Or you can start anaconda installer from command line with following command:

      /usr/bin/liveinst

      Do you see any error messages then?

      • Hi JR.

        Thansk for your helping.

        My VM specs is the follow:

        [General]
        Name: Fedora 64
        OS Type: Fedora (64 bit)

        [System]
        Base Memory: 2048 MB
        Processor(s): 1
        Execution Cap: 100%
        Boot Order: Floppy, CD/DVD-ROM, Hard Disk
        VT-x/AMD-V: Enabled
        Nested Paging: Enabled

        [Display]
        Video Memory: 12 MB
        3D Acceleration: Disabled
        2D Video Acceleration: Disabled
        Remote Desktop Server: Disabled

        [Storage]
        -Controladora IDE
        IDE Secondary Master (CD/DVD): Fedora-16-x86_64-Live-Desktop.iso (604.00 MB)
        -Controladora SATA
        SATA Port 0: Fedora 64.vdi (Normal, 8.00 GB)

        [Audio]
        Host Driver: ulseAudio
        Controller: ICH AC97

        [Network]
        Adapter 1: Intel PRO/1000 MT Desktop (NAT)

        [Serial Ports]
        Disabled

        [USB]
        Device Filters: 0 (0 active)

        [Shared Folders]
        None

        I did what you ask, but I still get error. This time, I could get an Log, but is too long to put here. You can download it .

        I hope that you can understand my english and help me.

        Thanks again

        • I did a mistake on the link

          download error log

        • I got a long and probably better on. Sorry by my multiples posts

          Download Long Log

          • Your error message is due to too small root partition. This is actually bug and you can find full bug report here. Normally 2330 MB should be enough but some reason it needs over 4016 MB.

            You can try to create over 4016 MB root partition (example 4500 MB) and try to install it again…do you got it working then?

            • Hey JR.

              Really thanks, you have solved my problem. I have never thinked that the root disk size could be the reason for my problem.

              You’re a good expert and a patient guy.

              Thanks again

              • Excellent to hear that you got it working! :)

                Thank you for compliment!

  32. Thanks for this guide. Works perfectly.

  33. [root@localhost ~]# /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 DKMS[FALHOU]
    (Failed, trying without DKMS)
    Recompiling VirtualBox kernel modules [FALHOU]
    (Look at /var/log/vbox-install.log to find out what went wrong)

    I’m using Fedora 16 64x.
    I’ve tried using the tips above but still have the problem.

    Thx.

    • Hi!

      Could you post output of following command:

      rpm -qa binutils gcc make patch libgomp glibc\* kernel\* dkms |sort

      And could you also post your /var/log/vbox-install.log content?

  34. thanks you, for you help, it was very important, until I made your instruccions I can do work with my virtualbox.

  35. Dear JR

    I followed you exactly and got the error as below, I was trying to install VitualBox in CentOS 5.7( (in an openvz vps server).

    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.18-274.7.1.el5.028stab095.1 cannot be found a
    t
    /lib/modules/2.6.18-274.7.1.el5.028stab095.1/build or /lib/modules/2.6.18-274.7.
    1.el5.028stab095.1/source.
    [FAILED]
    (Failed, trying without DKMS)
    Recompiling VirtualBox kernel modules [FAILED]
    (Look at /var/log/vbox-install.log to find out what went wrong)

    vbox-install.log shows
    Uninstalling modules from DKMS
    removing old DKMS module vboxhost version 4.1.8

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

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

    DKMS: add completed.
    Failed to install using DKMS, attempting to install without
    Makefile:201: *** Unable to find the folder to install the support driver to. S
    top.

    ====================
    rpm -qa kernel* // returns
    kernel-devel-2.6.18-274.18.1.el5
    kernel-headers-2.6.18-274.18.1.el5

    locate amd_iommu.h //returns
    /usr/src/kernels/2.6.18-274.18.1.el5-i686/include/asm-x86_64/amd_iommu.h

    And I already tried
    KERN_DIR=/usr/src/kernels/2.6.18-274.18.1.el5-i686
    export KERN_DIR
    /etc/init.d/vboxdrv setup

    Please help, thank you very much in advance.

  36. In addition

    rpm -qa binutils gcc make patch libgomp glibc\* kernel\* dkms |sort //returns

    binutils-2.17.50.0.6-14.el5
    dkms-2.2.0.3-1.el5
    gcc-4.1.2-51.el5
    glibc-2.5-65.el5_7.3
    glibc-common-2.5-65.el5_7.3
    glibc-devel-2.5-65.el5_7.3
    glibc-headers-2.5-65.el5_7.3
    kernel-devel-2.6.18-274.18.1.el5
    kernel-headers-2.6.18-274.18.1.el5
    libgomp-4.4.4-13.el5
    make-3.81-3.el5
    patch-2.5.4-31.el5

    • Hi YoungX,

      Your rpm -qa binutils gcc make patch libgomp glibc\* kernel\* dkms |sort command output looks like you have not any kernels installed?

      Please post output of following commands:

      rpm -qa kernel
       
      uname -a
  37. During the installation of Red hat 6.0 in virtulabox…Error was

    This kernel requires an x86-64 CPU, but only detected an i686 CPU. Unable to boot – please use a kernel appropriate for your CPU

    • Hi prakash,

      Did you create 64-bit virtual machine?

  38. take a look in my install on fedora16…

    http://www.youtube.com/watch?v=hfkkfY6VaYk

    maybe help

    • Hi elaslink,

      So you have problems to boot Linux distros on VirtualBox?

      • no jr.. in this case of my video i install virtualbox inside my fedora 16 vm i dont know if possible run another machine

        • So you run Fedora 16 on virtual machine (as guest system) top of some host OS? And installed VirtualBox on Fedora 16 and try to run some another Linux distro (virtual machine/guest)?

          I think that, even this should be possible, but it’s more efficient if you run that other Linux distro on your host OS…

          • yeah jr u right.. but i trye just for testing.. the host Os win7
            ;)

            • Okay! I think that, it should be possible to test, if you have enough RAM. :)

  39. the following attempt to share a directory between fc15(host) and vBox fails.

    mount -t vboxsf vbClient /zdm_vBox -> mount: unknown filesystem type ‘vboxsf’

    Your install guide worked just fine. Hopefully you can point to the fix for this issue
    Thanks – Don

  40. JR how does one go about doing that plus I was under the opinion that since my VM (client) was the windows mach that was not needed

    • Are you trying to use mount command in Windows guest? Mount command works only in Linux guest, not Windows.

      With Windows you have to use something like following command:

      net use x: \\vboxsvr\<sharename> -p
  41. JR – when i start the vBox i get a config panel with a “settings” option
    if I hit that settings button i get a drop down list and the last entry is “shared folder” clicking on this option i get a “net use x: \\vboxsrv\share” hint screen and above that hint i have the option to create or edit my folder to share entry
    The folder path seems correct “/” as it resides on “root” using a folder name of “zdm_willieServer” which does exist but i can not get it to showUp under the “myCOmputer” option all i see are “local disk C:” and “CD drive D:”

    • Do you try to share your Fedora host entire root? I’m not sure, it is even possible, because then you need root permissions and you have very big chance mess up your whole Linux system.

      This net use x…command is Windows command line command, more info here. Or you can browse your “Network” on Windows and try to find your VBox shared folders.

  42. good point
    here is what i am now trying
    created folder on root as /zdm_vBox with perms set to r-w-ex
    started vBox and went to settings -> shared folders where i entered path -> /zdm_vBox
    and folder as zdm_vBox set autoMount = on and saved the config
    started VM and went to myComputer – nothing so then went to netWorkPlaces nothing then tried to create z:\\zdm_vBox to no avail
    going bald from pulling my hair out

    • Now it sounds much better :)

      Try to create z:\\vboxsvr\zdm_vBox or \\vboxsvr\zdm_vBox instead?

  43. ran “Map Network Drive” from myComputer
    windows response – The network path \\vboxsrv\zdm_vBox could not be found

    • So what happens if you open Windows command line (cmd) and write exactly following command (check spaces):

      net use x: \\vboxsvr\zdm_vBox

      Do you get some error or do you get X: drive?

  44. Got same response – The network path \\vboxsrv\zdm_vBox could not be found

    • I guess that the VirtualBox Guest Additions will solve this problem, but if you are absolutely sure that Guest Additions are not needed and you won’t install it, then I don’t have any other idea howto get it working…

  45. JR – i am removing vBox and will attempt to reinstall again. when is the “Guest Additions” installed and are their any other additions i should be aware of. How do i get the common clipboard working and USB ports as example

    Thanks for your help – Don

  46. thanks a lot, works great!

  47. Excelent!!! Thanks a lot!!

  48. hi,
    i am geting this error

    WARNING: The vboxdrv kernel module is not loaded. Either there is no module
    available for the current kernel (3.1.0-7.fc16.x86_64) or it failed to
    load. Please recompile the kernel module and install it by

    sudo /etc/init.d/vboxdrv setup

    You will not be able to start VMs until this problem is fixed.
    help please!

    • Hi naviga18,

      Could you post output of following commands:

      rpm -qa kernel* |sort
       
      uname -r
  49. Hi JR,

    I have followed almost all tutorials above but still getting this error:

    [root@Tracker-A52F tracker]# /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.2.9-2.fc16.x86_64 cannot be found at
    /lib/modules/3.2.9-2.fc16.x86_64/build or /lib/modules/3.2.9-2.fc16.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)

    then I ran rpm -qa binutils gcc make patch libgomp glibc\* kernel\* dkms |sort
    binutils-2.21.53.0.1-6.fc16.x86_64
    dkms-2.2.0.3-1.fc16.noarch
    gcc-4.6.2-1.fc16.x86_64
    glibc-2.14.90-24.fc16.6.x86_64
    glibc-common-2.14.90-24.fc16.6.x86_64
    glibc-devel-2.14.90-24.fc16.6.x86_64
    glibc-headers-2.14.90-24.fc16.6.x86_64
    kernel-3.2.3-2.fc16.x86_64
    kernel-3.2.5-3.fc16.x86_64
    kernel-3.2.9-2.fc16.x86_64
    kernel-devel-3.2.10-3.fc16.x86_64
    kernel-headers-3.2.10-3.fc16.x86_64
    libgomp-4.6.2-1.fc16.x86_64
    make-3.82-8.fc16.x86_64

    rpm -qa kernel* |sort gives me
    kernel-3.2.3-2.fc16.x86_64
    kernel-3.2.5-3.fc16.x86_64
    kernel-3.2.9-2.fc16.x86_64
    kernel-devel-3.2.10-3.fc16.x86_64
    kernel-headers-3.2.10-3.fc16.x86_64

    Could you help me plz.

    • Hi Tracker,

      Your kernel headers for kernel 3.2.9-2.fc16.x86_64 cannot be found at
      /lib/modules/3.2.9-2.fc16.x86_64/build or /lib/modules/3.2.9-2.fc16.x86_64/source

      So looks like, that you are running currently 3.2.9-2.fc16.x86_64 kernel and you have 3.2.10-3.fc16.x86_64 kernel headers installed, so you need to just boot your machine with 3.2.10-3.fc16.x86_64 kernel and try installation again. It should fix your problem, please let me know do you get it working… :)

  50. Worked like a charm! Bookmarked for future reference.

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackbacks/Pingbacks