If you installed a very minimal version of CentOS (no GUI install on a 512MB VirtualBox Guest), you may find out that there is no network for you to install other programs. Here are steps to fix it.
1. Run dhclient eth0. This should turn on your network on eth0.
2. install network config: yum -y install system-config-network
3. Run system-config-network-tui and select Device Configuration
4. Select eth0 and make sure the settings are configured as below:
5. Save and exit.
6. Install nano: yum -y install nano (you may skip this if you are comfortable with vi)
7. Edit ifcfg-eth0: nano /etc/sysconfig/network-scripts/ifcfg-eth0 (or you may use vi)
Edit it to look something like this:
8. Run: service network restart
You now have a working minimal CentOS install with a functioning network.