Install Oracle VirtualBox 6.1 on CentOS 8 - CentLinux


Monday, 4 May 2020

Install Oracle VirtualBox 6.1 on CentOS 8

Install Oracle VirtualBox 6.1 on CentOS 8

In this article, you will learn how to install Oracle VirtualBox 6.1 on CentOS 8 server. However, the same method can be used to install previous versions of VirtualBox on CentOS 8.


This Article Provides:


What is VirtualBox? :

VirtualBox is free and open source virtualization software for enterprises as well as home users. VirtualBox is distributed under the GNU GPL v2 license by Oracle Corporation. Oracle VirtualBox can be installed on Windows, Mac, Linux, Solaris, FreeBSD, etc.

Nonetheless, Oracle VirtualBox is a complete virtualization platform, it is the preferred provisioning tool used by famous Server Orchestration software like Vagrant and Ansible.

Vagrant uses VirtualBox to provision required virtual machines by importing the Vagrant boxes in VirtualBox.

Whereas, Ansible uses their playbooks to create and configure the required virtual machines by using VirtualBox.


Environment Specification:

We are using a minimal CentOS 8 server with following specification.

  • CPU - 3.4 Ghz (2 cores)
  • Memory - 4 GB
  • Storage - 40 GB
  • Operating System - CentOS 8.1
  • Hostname –
  • IP Address - /24


Update CentOS 8 Software Packages:

Connect to as root user by using a SSH tool.

As a best practice, update the existing software packages in your Linux server before installing anything new.

To update installed software packages on Linux server, you can use dnf command.

[root@virtualbox-01 ~]# dnf update -y ... Installed: kernel-4.18.0-147.8.1.el8_1.x86_64 kernel-core-4.18.0-147.8.1.el8_1.x86_64 kernel-modules-4.18.0-147.8.1.el8_1.x86_64 Removed: kernel-4.18.0-80.el8.x86_64 kernel-core-4.18.0-80.el8.x86_64 kernel-modules-4.18.0-80.el8.x86_64 Complete!

Your Linux server has been updated now.

Since, you now have an updated Linux Kernel, therefore, it is a necessary to reboot the operating system with the newly installed Linux Kernel.

[root@virtualbox-01 ~]# systemctl reboot


Install EPEL yum repository on CentOS 8:

VirtualBox requires some prerequisite software packages that are not available in standard yum repositories. Therefore, you have to add EPEL (Extra Packages for Enterprise Linux) yum repository in our Linux server.

You can add EPEL yum repository as follows.

[root@virtualbox-01 ~]# dnf install -y epel-release Last metadata expiration check: 0:22:11 ago on Sun 03 May 2020 01:57:55 PM PKT. Dependencies resolved. ================================================================================ Package Architecture Version Repository Size ================================================================================ Installing: epel-release noarch 8-8.el8 extras 23 k Transaction Summary ================================================================================ Install 1 Package Total download size: 23 k Installed size: 32 k Downloading Packages: epel-release-8-8.el8.noarch.rpm 66 kB/s | 23 kB 00:00 -------------------------------------------------------------------------------- Total 19 kB/s | 23 kB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : epel-release-8-8.el8.noarch 1/1 Running scriptlet: epel-release-8-8.el8.noarch 1/1 Verifying : epel-release-8-8.el8.noarch 1/1 Installed: epel-release-8-8.el8.noarch Complete!


Install VirtualBox Yum Repository on CentOS 8:

However, you can download VirtualBox RPM package from their official website and install it using dnf or rpm commands.


But we prefer to do it by using the VirtualBox yum repository. For this purpose, you have to add the VirtualBox yum repository in your Linux server.

Download and install VirtualBox repo file as follows.

[root@virtualbox-01 ~]# wget -O /etc/yum.repos.d/virtualbox.repo --2020-05-03 14:25:35-- Resolving ( Connecting to (||:443... connected. HTTP request sent, awaiting response... 200 OK Length: 259 [text/plain] Saving to: â/etc/yum.repos.d/virtualbox.repoâ /etc/yum.repos.d/vi 100%[===================>] 259 --.-KB/s in 0s 2020-05-03 14:25:37 (5.52 MB/s) - â/etc/yum.repos.d/virtualbox.repoâ saved [259/259]

Build cache for newly added yum repositories.

[root@virtualbox-01 ~]# dnf makecache CentOS-8 - AppStream 7.3 kB/s | 4.3 kB 00:00 CentOS-8 - Base 11 kB/s | 3.9 kB 00:00 CentOS-8 - Extras 2.2 kB/s | 1.5 kB 00:00 Extra Packages for Enterprise Linux Modular 8 - 7.7 kB/s | 8.7 kB 00:01 Extra Packages for Enterprise Linux 8 - x86_64 19 kB/s | 7.2 kB 00:00 Oracle Linux / RHEL / CentOS-8 / x86_64 - Virtu 260 B/s | 181 B 00:00 Oracle Linux / RHEL / CentOS-8 / x86_64 - Virtu 846 B/s | 1.7 kB 00:02 Importing GPG key 0x98AB5139: Userid : "Oracle Corporation (VirtualBox archive signing key) <>" Fingerprint: 7B0F AB3A 13B9 0743 5925 D9C9 5442 2A4B 98AB 5139 From : Is this ok [y/N]: y Oracle Linux / RHEL / CentOS-8 / x86_64 - Virtu 45 kB/s | 85 kB 00:01 Metadata cache created.


Install VirtualBox Prerequisites Packages on Linux Server:

Before installing VirtualBox on Linux server, it is necessary to install the prerequisites software packages. Therefore, we have identified the required software packages and installing them by using following dnf command.

[root@virtualbox-01 ~]# dnf install -y kernel-devel kernel-headers glibc-headers glibc-devel binutils libgomp make patch gcc dkms ... Installed: gcc-8.3.1-4.5.el8.x86_64 binutils-2.30-58.el8_1.2.x86_64 glibc-devel-2.28-72.el8_1.1.x86_64 glibc-headers-2.28-72.el8_1.1.x86_64 kernel-devel-4.18.0-147.8.1.el8_1.x86_64 kernel-headers-4.18.0-147.8.1.el8_1.x86_64 make-1:4.2.1-9.el8.x86_64 patch-2.7.6-9.el8_0.x86_64 dkms-2.8.1-4.20200214git5ca628c.el8.noarch cpp-8.3.1-4.5.el8.x86_64 isl-0.16.1-6.el8.x86_64 libmpc-1.0.2-9.el8.x86_64 elfutils-libelf-devel-0.176-5.el8.x86_64 libxcrypt-devel-4.1.1-4.el8.x86_64 perl-Carp-1.42-396.el8.noarch perl-Errno-1.28-416.el8.x86_64 perl-Exporter-5.72-396.el8.noarch perl-File-Path-2.15-2.el8.noarch perl-IO-1.38-416.el8.x86_64 perl-PathTools-3.74-1.el8.x86_64 perl-Scalar-List-Utils-3:1.49-2.el8.x86_64 perl-Socket-4:2.027-3.el8.x86_64 perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch perl-Unicode-Normalize-1.25-396.el8.x86_64 perl-constant-1.33-396.el8.noarch perl-interpreter-4:5.26.3-416.el8.x86_64 perl-libs-4:5.26.3-416.el8.x86_64 perl-macros-4:5.26.3-416.el8.x86_64 perl-parent-1:0.237-1.el8.noarch perl-threads-1:2.21-2.el8.x86_64 perl-threads-shared-1.58-2.el8.x86_64 zlib-devel-1.2.11-10.el8.x86_64 Complete!


Install Oracle VirtualBox 6.1 on CentOS 8:

Since, you have already added the VirtualBox yum repository, therefore, you can now easily install your required version of VirtualBox by using dnf command.

Search for available versions of VirtualBox.

[root@virtualbox-01 ~]# dnf search VirtualBox Last metadata expiration check: 0:06:35 ago on Sun 03 May 2020 02:27:51 PM PKT. ====================== Name & Summary Matched: VirtualBox ====================== VirtualBox-5.2.x86_64 : Oracle VM VirtualBox VirtualBox-6.0.x86_64 : Oracle VM VirtualBox VirtualBox-6.1.x86_64 : Oracle VM VirtualBox

Install the latest version (VirtualBox 6.1) by using the dnf command.

[root@virtualbox-01 ~]# dnf install -y VirtualBox-6.1 ... Installed: VirtualBox-6.1-6.1.6_137129_el8-1.x86_64 SDL-1.2.15-36.el8_1.x86_64 alsa-lib-1.1.9-4.el8.x86_64 glx-utils-8.3.0-9.el8.x86_64 graphite2-1.3.10-10.el8.x86_64 harfbuzz-1.7.5-3.el8.x86_64 libICE-1.0.9-15.el8.x86_64 libSM-1.2.3-1.el8.x86_64 libX11-1.6.7-1.el8.x86_64 libX11-common-1.6.7-1.el8.noarch libX11-xcb-1.6.7-1.el8.x86_64 libXau-1.0.8-13.el8.x86_64 libXcursor-1.1.15-3.el8.x86_64 libXdamage-1.1.4-14.el8.x86_64 libXext-1.3.3-9.el8.x86_64 libXfixes-5.0.3-7.el8.x86_64 libXi-1.7.9-7.el8.x86_64 libXrender-0.9.10-7.el8.x86_64 libXt-1.1.5-12.el8.x86_64 libXxf86vm-1.1.4-9.el8.x86_64 libglvnd-1:1.0.1-0.9.git5baa1e5.el8.x86_64 libglvnd-egl-1:1.0.1-0.9.git5baa1e5.el8.x86_64 libglvnd-glx-1:1.0.1-0.9.git5baa1e5.el8.x86_64 libjpeg-turbo-1.5.3-10.el8.x86_64 libvpx-1.7.0-6.el8.x86_64 libwayland-client-1.15.0-1.el8.x86_64 libwayland-server-1.15.0-1.el8.x86_64 libxcb-1.13-5.el8.x86_64 libxshmfence-1.3-2.el8.x86_64 mesa-libEGL-19.1.4-3.el8_1.x86_64 mesa-libGL-19.1.4-3.el8_1.x86_64 mesa-libgbm-19.1.4-3.el8_1.x86_64 mesa-libglapi-19.1.4-3.el8_1.x86_64 opus-1.3-0.4.beta.el8.x86_64 qt5-qtbase-5.11.1-7.el8.x86_64 qt5-qtbase-common-5.11.1-7.el8.noarch qt5-qtbase-gui-5.11.1-7.el8.x86_64 qt5-qtx11extras-5.11.1-2.el8.x86_64 xcb-util-0.4.0-10.el8.x86_64 xcb-util-image-0.4.0-9.el8.x86_64 xcb-util-keysyms-0.4.0-7.el8.x86_64 xcb-util-renderutil-0.3.9-10.el8.x86_64 xcb-util-wm-0.4.1-12.el8.x86_64 avahi-libs-0.7-19.el8.x86_64 cups-libs-1:2.2.6-28.el8.x86_64 dejavu-fonts-common-2.35-6.el8.noarch dejavu-sans-fonts-2.35-6.el8.noarch fontconfig-2.13.1-3.el8.x86_64 fontpackages-filesystem-1.44-22.el8.noarch pcre2-utf16-10.32-1.el8.x86_64 Complete!

The VirtualBox installer creates a systemd service, named as vboxdrv.service, but you must rebuild the VirtualBox kernel modules to start it properly.

VirtualBox provides us a script to rebuild relevant kernel modules, therefore rebuild the VirtualBox kernel modules as follows.

[root@virtualbox-01 ~]# /usr/lib/virtualbox/ setup Stopping VirtualBox services. Starting VirtualBox services. Building VirtualBox kernel modules.

Check the status of vboxdrv.service.

[root@virtualbox-01 ~]# systemctl status vboxdrv.service â vboxdrv.service - VirtualBox Linux kernel module Loaded: loaded (/usr/lib/virtualbox/; enabled; vendor preset: disabled) Active: active (exited) since Sun 2020-05-03 14:39:49 PKT; 6min ago Process: 25841 ExecStart=/usr/lib/virtualbox/ start (code=exited, status=0/SUCCESS) May 03 14:39:49 systemd[1]: Starting VirtualBox Linux kernel module... May 03 14:39:49[25841]: Starting VirtualBox services. May 03 14:39:49 systemd[1]: Started VirtualBox Linux kernel module.

Oracle VirtualBox 6.1 has been installed on CentOS 8 Linux server.


Install VirtualBox 6.1 Extension Pack on CentOS 8:

VirtualBox extension pack extends the VirtualBox support for USB 2.0 and USB 3.0 devices, VirtualBox RDP, disk encryption, NVMe and PXE boot for Intel cards.

You can download VirtualBox 6.1 Extension Pack  for your preferred Linux distribution from their official download page.

[root@virtualbox-01 ~]# wget --2020-05-03 14:53:07-- Resolving ( Connecting to (||:443... connected. HTTP request sent, awaiting response... 200 OK Length: 10999815 (10M) [text/plain] Saving to: âOracle_VM_VirtualBox_Extension_Pack-6.1.6.vbox-extpackâ Oracle_VM_VirtualBo 100%[===================>] 10.49M 1.16MB/s in 9.3s 2020-05-03 14:53:18 (1.13 MB/s) - âOracle_VM_VirtualBox_Extension_Pack-6.1.6.vbox-extpackâ saved [10999815/10999815]

Now, install VirtualBox extension pack by using following Linux command.

[root@virtualbox-01 ~]# VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.1.6.vbox-extpack VirtualBox Extension Pack Personal Use and Evaluation License (PUEL) License version 10, 20 July 2017 PLEASE READ THE FOLLOWING ORACLE VM VIRTUALBOX EXTENSION PACK PERSONAL USE AND EVALUATION LICENSE CAREFULLY BEFORE DOWNLOADING OR USING THE ORACLE SOFTWARE. THESE TERMS AND CONDITIONS CONSTITUTE A LEGAL AGREEMENT BETWEEN YOU AND ORACLE. ORACLE AMERICA, INC. ("ORACLE") IS WILLING TO LICENSE THE PRODUCT DEFINED IN SECTION 1 BELOW ONLY ON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS VIRTUALBOX EXTENSION PACK PERSONAL USE AND EVALUATION LICENSE AGREEMENT ("AGREEMENT"). IF YOU ARE AGREEING TO THIS LICENSE ON BEHALF OF AN ENTITY (RATHER THAN AS AN INDIVIDUAL HUMAN BEING), YOU REPRESENT THAT YOU HAVE THE APPROPRIATE AUTHORITY TO ACCEPT THESE TERMS AND CONDITIONS ON BEHALF OF SUCH ENTITY. 1 SUBJECT OF AGREEMENT. This Agreement governs your use of the binary software package called "Oracle VM VirtualBox Extension Pack" (the "Product"), which contains a set of additional features for "Oracle VM VirtualBox" that enhance the operation of multiple virtual machines ("Guest Computers") on a single physical computer ("Host Computer"). The Product consists of executable files in machine code, script files, data files, and all documentation and updates provided to You by Oracle. 2 GRANT OF LICENSE. Oracle grants you a personal, non-exclusive, non-transferable, limited license without fees to reproduce, install, execute, and use internally the Product on Host Computers for your Personal Use, Educational Use, or Evaluation. "Personal Use" is noncommercial use solely by the person downloading the Product from Oracle on a single Host Computer, provided that no more than one client or remote computer is connected to that Host Computer and that client or remote computer is used solely to remotely view the Guest Computer(s). "Educational Use" is any use by teachers or students in an academic institution (schools, colleges and universities) as part of the institution's educational curriculum. "Evaluation" means testing the Product for up to thirty (30) days; after expiry of that term, you are no longer permitted to use the Product. Personal Use and/or Educational Use expressly exclude any use of the Product for commercial purposes or to operate, run, or act on behalf of or for the benefit of a business, organization, governmental organization, or educational institution. Oracle reserves all rights not expressly granted in this license. 3 RESTRICTIONS AND RESERVATION OF RIGHTS. (1) The Product and copies thereof provided to you under this Agreement are copyrighted and licensed, not sold, to you by Oracle. (2) You may not do any of the following: (a) modify any part of the Product, except to the extent allowed in the documentation accompanying the Product; (b) rent, lease, lend, re-distribute, or encumber the Product; (c) remove or alter any proprietary legends or notices contained in the Product; or (d) decompile, or reverse engineer the Product (except to the extent permitted by applicable law). (3) The Product is not designed, licensed or intended for use in the design, construction, operation or maintenance of any nuclear facility and Oracle and its licensors disclaim any express or implied warranty of fitness for such uses. (4) No right, title or interest in or to any trademark, service mark, logo or trade name of Oracle or its licensors is granted under this Agreement. 4 TERMINATION. The Agreement is effective on the date you receive the Product and remains effective until terminated. Your rights under this Agreement will terminate immediately without notice from Oracle if you materially breach it or take any action in derogation of Oracle's and/or its licensors' rights to the Product. Oracle may terminate this Agreement immediately should any part of the Product become or in Oracle's reasonable opinion likely to become the subject of a claim of intellectual property infringement or trade secret misappropriation. Upon termination, you will cease use of and destroy all copies of the Product under your control and confirm compliance in writing to Oracle. Sections 3-9, inclusive, will survive termination of the Agreement. 5 DISCLAIMER OF WARRANTY. TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, ORACLE PROVIDES THE PRODUCT "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT LIMITING THE FOREGOING, ORACLE SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT. The entire risk as to the quality and performance of the Product is with you. Should it prove defective, you assume the cost of all necessary servicing, repair, or correction. 6 LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, IN NO EVENT WILL ORACLE OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT, DATA, OR DATA USE, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR INABILITY TO USE THE PRODUCT, EVEN IF ORACLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event will Oracle's liability to you, whether in contract, tort (including negligence), or otherwise, exceed the amount paid by you for the Product under this Agreement. 7 SEPARATELY LICENSED THIRD PARTY TECHNOLOGY. The Product may contain or require the use of third party technology that is provided with the Product. Oracle may provide certain notices to you in the Product's documentation, readmes or notice files in connection with such third party technology. Third party technology will be licensed to you either under the terms of this Agreement or, if specified in the documentation, readmes or notice files, under Separate Terms. Your rights to use Separately Licensed Third Party Technology under Separate Terms are not restricted in any way by this Agreement. However, for clarity, notwithstanding the existence of a notice, third party technology that is not Separately Licensed Third Party Technology shall be deemed part of the Product and is licensed to You under the terms of this Agreement. "Separate Terms" refers to separate license terms that are specified in the Product's documentation, readmes or notice files and that apply to Separately Licensed Third Party Technology. "Separately Licensed Third Party Technology" refers to third party technology that is licensed under Separate Terms and not under the terms of this Agreement. 8 EXPORT. Export laws and regulations of the United States and any other relevant local export laws and regulations apply to the Product. You agree that such export laws govern your use of the Product (including technical data) provided under this Agreement, and you agree to comply with all such export laws and regulations (including "deemed export" and "deemed re-export" regulations). You agree that no data, information, and/or Product (or direct product thereof) will be exported, directly or indirectly, in violation of these laws, or will be used for any purpose prohibited by these laws including, without limitation, nuclear, chemical, or biological weapons proliferation, or development of missile technology. 9 U.S. GOVERNMENT END USERS. Oracle programs, including the Product, any operating system, integrated software, any programs installed on hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government. 10 MISCELLANEOUS. This Agreement is the entire agreement between you and Oracle relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification of this Agreement will be binding, unless in writing and signed by an authorized representative of each party. If any provision of this Agreement is held to be unenforceable, this Agreement will remain in effect with the provision omitted, unless omission would frustrate the intent of the parties, in which case this Agreement will immediately terminate. This Agreement is governed by the laws of the State of California, USA, and you and Oracle agree to submit to the exclusive jurisdiction of, and venue in, the courts of San Francisco or Santa Clara counties in California in any dispute arising out of or relating to this Agreement. Do you agree to these license terms and conditions (y/n)? y License accepted. For batch installation add --accept-license=56be48f923303c8cababb0bb4c478284b688ed23f16d775d729b89a2e8e5f9eb to the VBoxManage command line. 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Successfully installed "Oracle VM VirtualBox Extension Pack".

VirtualBox 6.1 Extension Pack has been installed on your CentOS 8 Linux server.

Although, it is quiet convenient to use VirtualBox in a Graphical environment (GUI). But you can also manage your VirtualBox environment and guests machines from Linux command line (CLI). For this purpose, VirtualBox provides a set of commands prefixed with vbox*.



We have successfully installed Oracle VirtualBox 6.1 on CentOS 8 server. If you want to learn more about Oracle VirtualBox, then you should purchase and read VirtualBox Made Easy: Virtualize Your Environment with Ease (Computers Made Easy) by James Bernstein.

No comments:

Post a Comment