Running the course VM on AWS EC2

As an alternative to using qemu on a non-x86 computer, you can sign up for a t2.micro instance from AWS EC2, under their AWS Free Tier.

Step 1: Account Creation

Create AWS account. We will be using AWS free tier - so you may need to add a credit card but it will not be charged

Step 2: Security Group Setup Creation

  1. Navigate to EC2, then Security Groups, and create a new security group called "65660 SG"
  2. Add inbound rule: SSH, Anywhere IPv4
  3. Keep the default outbound rule: All traffic, ...

Step 3: Launch EC2 Instance

  1. You may follow the official AWS User Guide if these steps are unclear
  2. Use the AMI - Community AMI: ami-0c81c115368bf2a59. Make sure that you're using the us-east-1 (N. Virginia) region.
  3. Instance type: t2.micro (free tier)
  4. Key pair: Create new, RSA, .pem, keep the resulting file 65660.pem, we’ll use it later
  5. Network settings: 65660 SG (existing security group, created in Step 2)
  6. Storage: EBS Volume 24 GB (free tier)
  7. Launch instance, allow it to start up.

Step 4: Connect to Instance

ssh -i 65660.pem student@<your EC2 instance Public IPv4 DNS here> (Using the key pair from Step 3.4)

It will look like ssh -i "65660.pem" student@ec2-XX-XX-XX-XX.compute-1.amazonaws.com

Before moving on to Step 5, clone and build the lab according to the "Getting Started" instructions in Lab 1. Before attempting to connect to the web server, disconnect from SSH with exit and continue to the next part.

Step 5: Connect to Webserver

  1. Navigate to EC2, then Instance details, and note its public IPv4 address - we will use this IP address to setup SSH Port Forwarding
  2. This is different from the previous step! It will look like XX.XX.XX.XX
  3. (For Lab 1) Connect to the EC2 instance with port forwarding enabled by running ssh -i "65660.pem" -L 8080:localhost:8080 student@<your EC2 instance public IPV4 address here>
  4. Now, for example, in Firefox, you can direct the browser to localhost:8080 while the SSH connection is active
  5. (For Lab 2) The port forwarding command is instead ssh -i "65660.pem" -L 8888:10.1.0.4:8080 student@<your EC2 instance public IPV4 address here>, then you can access the site at http://localhost:8888/zoobar/index.cgi/ while the SSH connection is active

Step 6: End of Semester

  1. Fully terminate EC2 instance
  2. Fully delete EBS storage
  3. Remove credit card/delete AWS account
  4. Now, everything is cleaned up!