I've just spent some time setting up a bare Centos 7 image to support development stripping out as much as possible. While CoreOS is probably a better choice, we run redhat in production at this point and centos is a better fit for the time being. The problem I've found is that many of the instructions available via google were written against prerelease versions or espouse manually installing random rpms instead of just using yum. While I get this "works", I'm not a huge fan of this approach and would rather do everything with the package manager. After a LOT of scouring and trial and error, I finally found the "magic" combination.
The winner is courtesy of http://www.pc-freak.net/. I've taken these instructions and tweaked them slightly for my purposes.
The original poster did this on a more "full fledged" version of centos with a windows host and my instructions are for a minimal install using and OSX host (though I'm certain the OP's instructions will work too. First, mount the guest additions cd from the virtualbox gui (original link has a photo, but it's under devices->Insert Guest Additions CD Image. Then log into the console as root. Once you've done this, enter the following commands:
yum -y update kernel* reboot -r now
After this step, you'll have to log in again. Then run the following:
yum install -y gcc kernel-devel kernel-headers dkms make bzip2 perl export KERN_DIR=/usr/src/kernels/`uname -r` mkdir /media/cdrom mount /dev/cdrom /media/cdrom cd /media/cdrom ./VBoxLinuxAdditions.run
Additionally, there are some instructions that I believe will work, but installed more than I really wanted to or I didn't discover until after. Additionally (pun intended) a key point I missed originally is that the minimal iso is missing default packages (perl I think was the culprit) that you need to properly build the guest additions so instructions for the "full blown" image will fail for mysterious reasons (i.e. the "build" symlink is broken)
- This seems like it would work too, but installs more than I really wanted to over my cell phone connection
- I found this after I wrote my post and it is virtually (pun intended) identical to my instructions.
Examples I tried that did NOT work or were too convoluted:
- centos.org forum had all sorts of crazy "wget" hackery suggested...While it may work, I like the epel approach better
- this version on stackexchange CAN get you there, but you have to read all the comments to figure out what is really required for a minimal install
I realize my post is a bit of a duplicate, but as there's no good way to get rid of historical anachronisms on the internet, this is an attempt to boost the ranking of the better approaches