" Cannot find a valid baseurl for repo: base/7/x86_64" on "yum update all"
It was a DNS issue. I kept the NAT setting and removed the BRIDGE settings. This ensured that my internet connectivity works. Yum also didn't have any problem. In order to connect from host to the guest, I used Port Forwarding in the network setting. I got this knowledge from this URL http://teaching.idallen.com/cst8207/14f/notes/000_centos_virtualbox_install.html