Install VirtualBox 4.3 on CentOS 7 / RHEL 7

ADVERTISEMENT

Oracle VirtualBox

Using VirtualBox you can create and run guest operating systems (“virtual machines”) such as Linux and Windows under a host operating system. There are two ways of installing VirtualBox: from pre-compiled binaries and from the sources code. This tutorial shows you how to set up VirtualBox 4.3 from the pre-compiled binaries.

ADVERTISEMENT
Article will continue after the ad

From the version 2.0 VirtualBox supports 32 and 64bit host and guest operating systems (if you want to install 64bit guests your processor must support hardware virtualization and, of course, the host operating system must be 64bit as well).

This tutorial shows how to install VirtualBox 4.3 on CentOS 7 / RHEL 7  via yum repository.

Step 1: Please setup EPEL repository for RHEL 7 / CentOS 7.

[root@itzgeek ~# rpm -Uvh https://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

Step 2: Install header and development tools.

[root@itzgeek~/# yum install kernel-devel kernel-headers dkms 
[root@itzgeek~/# yum groupinstall "Development Tools"
[root@itzgeek~/# yum update

Step 3: Download Oracle public key.

[root@itzgeek~/# wget http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc

Step 4: Import Oracle public key.

[root@itzgeek~/# rpm --import oracle_vbox.asc

Step 5: Download VirtualBox repo file for CentOS 7 / RHEL 7  and move it into /etc/yum.repos.d directory.

[root@itzgeek~/]# wget http://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo -O /etc/yum.repos.d/virtualbox.repo

OR

If you face any issue in repo file, add the following in .repo.

[virtualbox]
name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox
baseurl=http://download.virtualbox.org/virtualbox/rpm/el/7/x86_64/
enabled=1
gpgcheck=1
gpgkey=https://www.virtualbox.org/download/oracle_vbox.asc

Step 6: Install VirtualBox 4.3.

[root@itzgeek~/]# yum install VirtualBox-4.3

Step 7: Rebuild the kernel.

[root@localhost ~]# service vboxdrv setup

Step 7: Add your user name in to vboxuser group.

 [root@itzgeek~/]# usermod -a -G vboxusers raj

Step 8: Start VirtualBox using following command.

 [root@itzgeek~/]# virtualbox

Now you can start adding VM’s on VirtualBox.

CentOS 7 - VirtualBox 4.3
CentOS 7 – VirtualBox 4.3

That’s All!, you have successfully installed VirtualBox on CentOS 7

ADVERTISEMENT

POSTS YOU MAY LIKE -:)

Share This Post

  • Mr P

    I have problem with VirtualBox on CentOS7 running 3.10.0-123.6.3.el7.x86_64 kernel.

    # 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.16 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?

    • Raj

      Dear P,

      Disable SELinux, that will solve your problems

      • Peter

        Dear Sir, how, In the World, can you tell the guy to disable the WHOLE!! SELinux system. Do you think it’s there for fun?

        • watzmann

          What you can do is to follow the suggestions of the SELinux message browser… all you have to do is to follow the steps described in the Details section… (i extended by the sudo command because this has to be done as root)

          Step 1
          sudo grep ldconfig /var/log/audit/audit.log | audit2allow -M mypol
          Step 2
          sudo semodule -i mypol.pp

          • B

            Or do:

            setenforce Permissive
            service vboxdrv setup
            setenforce Enforcing

  • Johnny

    Hi

    Thanks for the great tutorial again. Small question, can we install Virtualbox directly without the Gnome desktop ? To maybe get better performance…
    But, be able to have remote access to the virtualbox management.. ?

    Like is xrdp need a desktop to run on ? Or it can run over just a app ?

    Thanks again

  • fourat

    Hi !!

    I’m trying to follow the steps but I get this error :
    http://download.virtualbox.org/virtualbox/rpm/el/7Server/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 – Not Found

    Can you hel me please ?

    • Raj

      Hi Fourat,

      There is some issue in repo file,
      kindly add the following in virtualbox.repo

      [virtualbox]
      name=Oracle Linux / RHEL / CentOS-$releasever / $basearch – VirtualBox
      baseurl=http://download.virtualbox.org/virtualbox/rpm/el/7/x86_64/
      enabled=1
      gpgcheck=1
      gpgkey=https://www.virtualbox.org/download/oracle_vbox.asc

  • George

    thanks a lot for this tutorial good one
    in step 5 its better to add it repo file manually because when i installed it there was a difference in baseurl
    Thanks

  • lucas

    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.

    • Raj

      Dear Lucas,

      Reboot the machine as the yum update contains the latest kernel.
      You must run the
      service vboxdrv setup
      after rebooting.

  • jhon

    Starting VirtualBox kernel modules [FAILED]
    (Running VirtualBox in a Xen environment is not supported)

    HI I received the above error

    • Raj

      Dear John,

      Kindly use non xen kernel and re run setup

  • Eddy de Boer

    Thank you so much, worked like a charm!

  • Cesar Silence

    Thanks, work for me

Shares