Building a RightImage from a running AMI Instance ------------------------------------------------- Author: Chris Fordham 1. Launch a fresh instance with your chosen AMI from the RightScale dashboard: Clouds -> AWS US-West -> EC2 Instances | New 2. Launch the SSH console of the instance from the dashboard. Note: for Ubuntu Karmic, the system uses the ubuntu user by default. Save the SSH key from the dashboard and login via a local shell, e.g.: ; chmod 700 ~/.ssh/my.key && ssh -i ~/.ssh/my.key ubuntu@ You can then re-enable the root account login: sudo sed -i 's/disable_root=1/disable_root=0/g' /etc/ec2-init/ec2-config.cfg && sudo cp -v /home/ubuntu/.ssh/authorized_keys /root/.ssh/ 3. Add any additional repositories to your the system's package manager (e.g. multiverse is required for SUN Java with Debian/Ubuntu). Note: For Ubuntu [karmic], you will need to remove the '.ec2' from servers from the sources.list if the AMI is in the US-West region. Ubuntu Multiverse repos (add to /etc/apt/sources.list): deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ hardy multiverse deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-updates multiverse Update your package list with your package manager (and optionally upgrade the system) Update packages list: sudo apt-get update or, Update packages list and upgrade software (recommended): sudo apt-get update && sudo apt-get -y upgrade or, Update packages list and upgrade release (note, may upgrade kernel, not recommended for karmic): sudo apt-get update && sudo apt-get -y dist-upgrade 4. Optionally, install a Java JRE (required for some AWS tools), e.g.: sudo apt-get install -y sun-java6-jre sun-java6-bin (multiverse repos must be enabled in Ubuntu; requires acceptance of EULA) or, sudo apt-get install -y java-gcj-compat (open JRE) 5. Run the build scripts: Note: For Ubuntu karmic, it is recommended to change to a root shell first: sudo -i mkdir -p /tmp/rs-build && cd /tmp/rs-build && wget https://rightscale-services.s3.amazonaws.com:443/rightimage-build-toolkit/build_rightimage.bash && chmod +x ./build_rightimage.bash && sudo ./build_rightimage.bash && cd /tmp && rm -Rf /tmp/rs-build 6. On success, you are ready to bundle your instance into a RightImage! This can be done from the RightScale dashbaord 'Bundle' button.