I've got a little bit lost, trying to to install VirtualBox Guest Additions on my freshly installed and upgraded CentOS 7 virtual machine. I have tried all the tricks I found and still Virtual Box installer wont able to find my kernel headers. The secret is erasy. Don't forget to reboot your system after setup and upgrade. Otherwise you will have new headers and configruation with the old kernel in flight.
So the right order is:
- Install your target system using ISO, thumbdrive or netwrok loader
- Update your packgage manager and system to the actual state
- Reboot to pickup new kernel
- Install virtuallBox Guast Addtions and the rest of your software.