The latest virtualbox can be installed from the Oracle repository. First of all we need to install oracle repository:
cd /etc/yum.repos.d/
sudo wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo
Install dependencies:
sudo dnf install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-PAE-devel dkms
Install virtualbox. Note: pointing 5.1 is important as at the moment that is how it is called in the oracle's repository:
sudo dnf install VirtualBox-5.1
You might need to rebuild kernel modules with command:
sudo /usr/lib/virtualbox/vboxdrv.sh setup
And add current user to the xboxusers group:
sudo usermod -a -G vboxusers user_name
I had a problem reconfiguring kernel modules on my laptop. The error wasn't indicating anything specific. The problem was in the BIOS settings. Secure Boot should be disabled to allow module reconfiguration.