Getting VirtualBox up and running was a little tricky, mainly because Fedora 22 didn’t properly install the kernel headers. Using the explicit header version fixed this, but here is the full set of steps.
To install Virtualbox, I used Fedy – super easy and has lots of great software you can’t get from the official repo. However, you can also install from the command line.
sudo wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo
First, make sure you have the necessary packages to build the virtualbox modules:
sudo dnf install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms
Next, install the specific kernel headers for your kernel version – something like this:
sudo dnf install kernel-devel-4.0.4-301.fc22.x86_64
Now you should be able to build the virtualbox module like so
sudo /etc/init.d/vboxdrv setup