Preparing a CentOS 5.5 VirtualBox guest for Chef
This will be the longest post yet. I had enough trouble doing this that I thought someone doing the same thing may find it useful.
I make this VM is for testing out chef scripts.
The OS is CentOS 5.5 32-bit. VirtualBox doesn't include an option for CentOS, so just choose Redhat.
It was pretty much a basic/default install using the Netinstall ISO.
In order to allow SSH from my host OS to this VM, I followed this guide: http://muffinresearch.co.uk/archives/2010/02/08/howto-ssh-into-virtualbox-3-linux-guests/
When you restart the machine after adding the 2nd NIC, you should be prompted to configure it.
The IP static address I chose is 192.168.56.10.
Once this is done, you should be able to do ssh [email protected] from the host machine.
create /root/.ssh/authorized_keys
copy the host machine's public SSH key into there
I wouldn't do this on production (not for the root user anyway)
add this line to /etc/sysconfig/network
your IP maybe different, depending on your virtual box settings.
Run ifconfig to find out what it should be. Basically, look at the IP address and change the last digit to be "1"
remove this line from /etc/sysconfig/network-scripts/ifcfg-eth1
we could do "service network restart" but rebooting ensures that it works after rebooting
ping yahoo.com to test your internet works
(needed for compiling, etc.)
yum -y groupinstall "Development Tools"
zlib and openSSL isn't included by default
yum install zlib zlib-devel
yum install openssl openssl-devel
# this is also useful: Perl-compatible regular expressions
yum install pcre pcre-devel
http://blog.jeffcosta.com/2010/09/10/7-steps-to-rails-on-centos/
http://www.railshostinginfo.com/blog/2007/07/13/how-to-get-ruby-openssl-to-work-on-centos/
http://library.linode.com/development/frameworks/ruby/ruby-on-rails/nginx-centos-5
confirm ruby isn't already installed
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p0.tar.gz
tar zxf ruby-1.9.2-p0.tar.gz
cd /source/ruby-1.9.2-p0/ext/openssl
If doing anything with users, you need a special/hacked version of ruby-shadow because the standard version doesn't work with ruby 1.9.
I have my hacked version here: http://github.com/thoughtless/ruby-shadow-cookbook
Special thanks to Mathias Biilmann (http://workingwithrails.com/person/5686-mathias-biilmann http://mathias-biilmann.net/ http://github.com/biilmann) who did all the hard work in making ruby-shadow work with 1.9.