Install VirtualBox 5.2 on Fedora 27 / Fedora 26/25
VirtualBox is a widely known open source virtualization software that lets you run multiple guests operating systems on single hardware machine.
This guide shows you how to install VirtualBox 5.2 on Fedora 27 / Fedora 26.
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).
Install VirtualBox 5.2 on Fedora 27
Step 1: Install kernel-headers and DKMS.
# dnf install kernel-devel kernel-headers dkms
Step 2: Download Oracle public key.
# wget https://www.virtualbox.org/download/oracle_vbox.asc
Step 3: Import Oracle public key.
# rpm --import oracle_vbox.asc
Step 4: Download VirtualBox repo file for Fedora and move it into /etc/yum.repos.d directory.
# wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo -O /etc/yum.repos.d/virtualbox.repo
OR
Manually create a repo file.
# vi /etc/yum.repos.d/virtualbox.repo
Add the following content to it.
[virtualbox] name=Fedora $releasever - $basearch - VirtualBox baseurl=http://download.virtualbox.org/virtualbox/rpm/fedora/$releasever/$basearch enabled=1 gpgcheck=1 gpgkey=https://www.virtualbox.org/download/oracle_vbox.asc
Step 5: Install VirtualBox 5.2 using the dnf command.
# dnf install VirtualBox-5.2
Step 6: Rebuild the kernel.
# service vboxdrv start
Step 7: Add your username into the vboxuser group.
# usermod -a -G vboxusers raj
Start VirtualBox:
Graphical:
Go to Activities >> Search >> VirtualBox.

OR
Command Line:
$ virtualbox
Now you can start adding VM’s on VirtualBox.
VirtualBox running on Fedora 27:

VirtualBox running on Fedora 26:

That’s All. You have successfully installed VirtualBox on Fedora 27 / Fedora 26.
Note: If do not have a GUI, then consider using phpVirtualBox for managing virtual machines using web browser or Hyperbox a client application to manage VirtualBox.