Skip to content

Instantly share code, notes, and snippets.

@alireza-a
Created May 20, 2016 21:11
Show Gist options
  • Save alireza-a/f223a1b1f30ba72e830965a73e760b65 to your computer and use it in GitHub Desktop.
Save alireza-a/f223a1b1f30ba72e830965a73e760b65 to your computer and use it in GitHub Desktop.
How to install AWS CLI on Chrome OS

How to install AWS CLI on Chrome OS

Why

All my projects are in docker containers in an AWS EC2 instance. To keep the cost down I stop the instance every time I finish coding.

Being a student and taking classes forces me to take breaks and restart my instance multiple times a day. Going to AWS console, restarting the instance then copying the public DNS to SSH into the instance quickly becomes tedious.

Enable developer mode

To continue you first need to enable the developer mode. lifehacker has a fantastic article on how to install Ubuntu on Chromebook. Here we only need the first step "Enable Developer Mode". In short :

  1. Hold down "ESC" and "Refresh" keys and press the power button to reboot into recovery mode

  2. Press "Ctrl+D" when the yellow exclamation mark appears

  3. Press enter to continue (this will take a while) warning! this will erase your local information

  4. Press "Ctrl+D" when the red exclamation mark appears (on every reboot)

You can find detailed instructions for your specific device on Chromium site

Press "Ctrl"+"Alt"+"t" to open up crush. Then type "shell" and enter

With chroot

Install Crouton

Crouton is a chroot generator for Chrome OS. We will use Crouton to install the command line tools.

  1. Donwload the latest release from their page

  2. Run (this might take a while)

$ sudo sh ~/Downloads/crouton -t core

Now enter chroot sudo enter-chroot

Install pip

Download get-pip.py script

$ wget https://bootstrap.pypa.io/get-pip.py

Run python get-pip.py

Install AWS CLI

Install AWS CLI using pip

$ sudo pip install awscli

Now to configure aws

$ aws configure

Without chroot

Note

  • Intel Chromebooks only. Below we are going to use Chromebrew. As of this writing Chromebrew does not support ARM chipsets.

  • The following steps have been tested on an Acer cb3 131 series

$ uname -a

Linux localhost 3.10.18 #1 SMP Thu May 12 00:16:32 PDT 2016 x86_64 Intel(R) Celeron(R) CPU N2840 @ 2.16GHz GenuineIntel GNU/Linux

Install Chromebrew

Chromebrew is a package manager for Chrome OS. We will use this to install Python.

You can find more details on the installation on their github page. In short run :

$ wget -q -O - https://raw.github.com/skycocker/chromebrew/master/install.sh | bash

Install pip

Download get-pip.py script

Run python /path_to_script/get-pip.py

Install AWS CLI

AWS has amazing documentation on how to get started. In short run :

$ sudo pip install awscli

If you try to run any aws commands at this point, it fails. The problem is permissions on the aws executables under "/usr/local/bin/"

My friend Bapi noticed this problem proposed the following to fix it

$ sudo chmod +x /usr/local/bin/aws

Now to configure aws

$ aws configure

Some of the dependencies might be missing (i.e. "groff"). This will cause the help command to fail

Control your EC2 instances

To start your instance

$ aws ec2 start-instances --instance-ids your_instance_id

To get public DNS records

$ aws ec2 describe-instances --instance-id your_instance_id | grep PublicDnsName

To ssh into your instance

$ ssh -i path_to_.pem_file username@PublicDnsName

To stop your instance

$ sudo shutdown -P now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment