How to Install Latest VirtualBox 6.1 in Linux

VirtualBox is an open-source cross-platform virtualization software, it can be installed on any operating system and enable you to install and run multiple guests operating systems on the same computer.

For example, if you install it on your Linux system, you can run Windows XP operating system under it as a Guest OS or run Linux OS on your Windows system and so on. This way, you can install and run as many as guest operating systems as you like, the only limit is disk space and memory.

Recently Oracle has released the latest stable version of Virtualbox 6.1, the newest version of Virtual box comes with so many major changes and new features added to it.

You can see the complete new changelog details about VirtualBox 6.1 on their Official Changelog Page.

This guide explains how to install VirtualBox 6.1 on RHEL, CentOS, and Fedora systems using VirtualBox’s own repository with YUM and DNF tools.

This guide also explains how to install VirtualBox 6.1 on Debian, Ubuntu and Linux Mint systems using VirtualBox’s own repository with APT-GET or APT command.

Installing VirtualBox 6.1 in RHEL/CentOS and Fedora

To install the latest stable version of VirtualBox, you need to first download the virtualbox.repo configuration file using the following wget command and then import the public key using rpm command.

----------------- On CentOS and RHEL ----------------- 
# wget https://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo -P /etc/yum.repos.d/
# rpm --import https://www.virtualbox.org/download/oracle_vbox.asc

----------------- On Fedora -----------------
# wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo -P /etc/yum.repos.d/
# rpm --import https://www.virtualbox.org/download/oracle_vbox.asc

Next, enable the EPEL repository to install build tools and dependencies on the system.

----------------- On CentOS/RHEL 8 ----------------- 
# dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

----------------- On CentOS/RHEL 7 ----------------- 
# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

----------------- On CentOS/RHEL 6 ----------------- 
# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

Install Dependency Packages for VirtualBox

VirtualBox uses vboxdrv kernel module to control and allocate physical memory for the execution of guest operating systems. Without this module, you can still use the VirtualBox to create and configure virtual machines, but they will not work.

So, to make VirtualBox fully functional you will need to update your system first, then install some additional modules like DKMS, kernel-headers, and kernel-devel and some dependency packages.

----------------- On CentOS/RHEL 8 -----------------
# dnf update
# dnf install binutils kernel-devel kernel-headers libgomp make patch gcc glibc-headers glibc-devel dkms -y

----------------- On CentOS/RHEL 7/6 -----------------
# yum update
# yum install binutils kernel-devel kernel-headers libgomp make patch gcc glibc-headers glibc-devel dkms -y

----------------- On Fedora -----------------
# dnf update
# dnf install @development-tools
# dnf install kernel-devel kernel-headers dkms qt5-qtx11extras  elfutils-libelf-devel zlib-devel

Install VirtualBox 6.1

Once you’ve installed all the needed dependency packages, you can install the latest version of VirtualBox using the following command.

# dnf install VirtualBox-6.1
OR
# yum install VirtualBox-6.1

At this point, you are ready to start using VirtualBox by running the following command on the terminal.

# virtualbox

If you get the following error during the Virtualbox installation, it means there is a conflict between the two Kernel versions.

This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel

To resolve the issue, first, check your installed kernel and then update the Linux kernel by running the command:

# uname -r
# dnf update kernel-*
Or
# yum update kernel-*

When the update complete, reboot your system and select the latest kernel from the grub boot menu, this entry usually the first entry as you can see.

# reboot

Once the system is done with booting, log in and once again confirm that the kernel-devel version now matches the version of the Linux kernel.

# rpm -q kernel-devel
# uname -r

Then, re-start the build set-up process and confirm that your VirtualBox installation was successful by running:

# /sbin/vboxconfig
# systemctl status vboxdrv

Troubleshooting

If you get any error message like KERN_DIR or if your kernel source directory not detected automatically by the build process, you can set it by using the following command. Make sure you change the kernel version according to your system as shown in red color.

## RHEL / CentOS / Fedora ##
KERN_DIR=/usr/src/kernels/4.19.0-1.el7.elrepo.x86_64

## Export KERN_DIR ##
export KERN_DIR

Installing VirtualBox 6.1 in Debian, Ubuntu and Linux Mint

To install the latest stable version of VirtualBox, you need to add the official Virtualbox repository using the following command.

$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
$ wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
$ sudo apt install software-properties-common
$ sudo add-apt-repository "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib

Then, update the software package list and install the latest version of VirtualBox.

$ sudo apt-get install virtualbox-6.1

Simply execute the following command to start it from the terminal or use launcher from the menu to start.

# VirtualBox
VirtualBox 6.1 Screenshots on CentOS 7
VirtualBox 6.1 Running on CentOS 7
VirtualBox 6.1 Running on CentOS 7
Create Virtalbox New Guest Machine
Create Virtualbox New Guest Machine

Installing VirtualBox Extension Pack in Linux

If you need some additional functionality such as VirtualBox RDP, PXE, ROM with E1000 support and USB 2.0 Host Controller support, etc. You need to download and install the VirtualBox Extension Pack using following wget command.

# wget https://download.virtualbox.org/virtualbox/6.1.10/Oracle_VM_VirtualBox_Extension_Pack-6.1.10.vbox-extpack

To install the extension pack, you must have Virtualbox 6.1 installed, once you downloaded vbox-extpack open with Virtualbox as shown below.

If it doesn’t work out, then open Virtaulbox –> Preferences –> Extensions and browse for the vbox-extpack to install it.

Install Virtualbox Extension Pack
Install Virtualbox Extension Pack

Read Also: How to Enable USB in VirtualBox

Updating VirtualBox

If you want to update the VirtualBox with the latest version in the future, you can simply run the following command to update it.

On RHEL/CentOS/Fedora
# yum update VirtualBox-*
On Ubuntu/Linux Mint
# apt-get install VirtualBox-*

Remove VirtualBox

If in case you want to remove VirtualBox completely, just use the following command to remove it completely from your system.

On RHEL/CentOS/Fedora
# cd /etc/yum.repos.d/
# rm -rf virtualbox.repo
# yum remove VirtualBox-*
On Ubuntu/Linux Mint
# apt-get remove VirtualBox-*

You can also Download VirtualBox 6.1 for other Linux, Windows, and Mac OS X platforms.

If you liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or doubts? do ask for help in the comments section.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

134 thoughts on “How to Install Latest VirtualBox 6.1 in Linux”

    • @lvin,
      VirtualBox has kernel modules that are required for it to work. They have to be built against the kernel that is in use. So, if you are upgrading virtualbox, or upgrading your kernel by doing a yum update, the kernel modules specific to VirtualBox must be rebuilt against the kernel. You can’t use modules that were built against an older kernel or modules from an older version of VirtualBox.

      Reply
  1. I’ve updated virtual box to 5.0 yesterday, my host machine is win 7 prof. after i updated to this i found major changes in my guest machines (centOS 6.6) all the fonts are visible as font and it’s very difficult to look for more time.

    Reply
  2. Hi, good job but with LinuxMint 17.2 the command lsb_release -cs give as answer : rafaela.
    Oracle doesn’t know rafeala dist but knows ubuntu trusty dist or debian wheezy dist.
    When you try apt-get update you get an error not found on oracle servers.
    Regards
    Gilbert

    Reply
  3. Hello ,
    I gone through u r site and good. My concern is I need to install RHEL server on my laptop .In that Rhel i want to install VirtualBOX S/W to run a few windows applications..
    So inside Virtal box -Going to insatll Windows..is it possible to such so?? please let me know..

    2) I have RHEL 5.8 ,wan to install VirtualBOX 4.3 said as like of above by u…
    I have moved to “”/etc/yum.repos.d”” and while executing i got Error …

    Error ::
    [[email protected]NEURAREPO yum.repos.d]# pwd
    /etc/yum.repos.d
    /etc/yum.repos.d
    [[email protected] yum.repos.d]# wget http://download.virtualbox.org/rpm/rhel/virtualbox.repo
    –2015-05-27 12:00:38– http://download.virtualbox.org/rpm/rhel/virtualbox.repo
    Resolving download.virtualbox.org… failed: Temporary failure in name resolution.
    wget: unable to resolve host address `download.virtualbox.org’
    [[email protected] yum.repos.d]#

    So please guide me to resolve this issue and mail me the concern … Thank u …

    Reply
    • @Kalyan,
      Is your machine is connected to network? please check your internet connectivity and then execute the commands as described in the article.

      Reply
  4. I copied libGL.so.1 from /usr/lib64 to /usr/lib/virtualbox , The error information is changed as below.

    VirtualBox: supR3HardenedMainGetTrustedMain: dlopen(“/usr/lib/virtualbox/VirtualBox.so”,) failed: /usr/lib/virtualbox/libGL.so.1: undefined symbol: _XGetRequest

    Reply

Got something to say? Join the discussion.

Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published.