Can I install EC2 Amazon Linux OS locally on virtual machine?

Can I download and run any Amazon Linux os on my local machine?

  • If yes:

    • Then from where I can download this?
    • And can I get image ready for VirtualBox?
  • If no:

    • What is the equivalent OS that matches the following version of EC2 Amazon AMI: 3.4.57-48.42.amzn1.x86_64 (I think it’sAmazon Linux AMI 2013.03)

I’m running Ubuntu 14.04 currently and I want to setup either the EC2 Amazon instance or any similar flavor of Linux OS.

I’ve an got an application from client that runs of above given machine, it runs on Ubuntu but with millions of tweaks and every time when new developer needs to start work on this application they need to either switch the system or spend thousand of hours to setup the PHP application.

I like to setup it to virtual machine and for any new developer we can clone and share the image so we can save the time to setup the project.


Yes, you can!

While on May 13, 2016 you can't do it... actually, as of today, December 13 2017, the answer is yes, you can install Amazon Linux 2 on your own machines and in his Amazon AMI image!

https://aws.amazon.com/amazon-linux-2/

It is also available as virtual machine images for VMware, Oracle VM VirtualBox, and Microsoft Hyper-V virtualization solutions for on-premises development and testing.

This is from the announcement:

https://aws.amazon.com/about-aws/whats-new/2017/12/introducing-amazon-linux-2/

Virtual machine images and docker images:

  • https://cdn.amazonlinux.com/os-images/latest/
  • https://hub.docker.com/_/amazonlinux/

Yahoo! From the FAQ you're supposed to generate a config.iso with user-data and meta-data:

  • http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-ami-basics.html
  • http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-2-virtual-machine.html

... but it looks like this example of a cloud-init is a little more on point at explaining the different ways that you can set up the auth:

https://cdn.amazonlinux.com/os-images/latest/README.cloud-init

As a MacOS user rather than Linux desktop user, I also needed to know that the cdrtools homebrew package provides mkisofs which is apparently near identical to the genisoimage tool that is mentioned throughout the Amazon Linux cloud-init documentation.

mkisofs -output seed.iso -volid cidata -joliet -rock user-data meta-data

It may also help to know that if the seed.iso file generated above is not connected on first boot, it will be ineffectual. (This took me too many login attempts to figure out on my own, and I didn't see it mentioned anywhere in the documentation that I skimmed.)

If you just want an ec2-user account with password set to password, attaching this init.iso file on first boot will do that.

d3fbbe38530f6c49964e6829e86d1133b4dfe2b7 /Users/kingdonb/Downloads/init.iso

The contents of that file are in this gist, for posterity in case the init.iso link becomes bad.

Hope this helps!


EDIT late in 2017 AWS released Amazon Linux 2, which can be installed on a local machine.

ORIGINAL ANSWER, for Amazon Linux v1 I believe the answer is no, and that the closest OS would be CentOS, which is not close enough to avoid your "millions of tweaks" problem.

Amazon says "The Amazon Linux AMI is only available for use inside of Amazon EC2." (http://aws.amazon.com/amazon-linux-ami/faqs/). You can only export an AMI which you created by import (https://aws.amazon.com/ec2/vm-import/). And the list of images you can import/export does not include Amazon Linux (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/VMImportPrerequisites.html#vmimport-operating-systems).

CentOS is probably the closest OS (Amazon Linux was based on RedHat/CentOS many years ago), but Amazon Linux has diverged a long way, is updated more often and includes a set of tools and repositories you can't easily include in your system build. I haven't found a way of duplicating Amazon Linux and keeping it up to date.

OPINION: By providing a free, very up-to-date OS complete with all AWS tools, Amazon has made it pretty compelling to use their OS over any others. But it's not open source, it locks you into their platform much more than any other linux, and you'll probably end up paying Amazon for lots of dev environments which you otherwise would not have chosen to use. Good commercial decision for them, but if you choose another more open distribution you have a more portable platform and less errors between dev and production.