Vagrant box most similar to Amazon EC2 instances

Solution 1:

NOTE: This answer is not about finding a vagrant box for "Amazon Linux". This answer is about helping the original poster solve the goal of using the same system in production as in dev, which happens to be Ubuntu. As you can see in the comments below, OP agreed this would solve his problem.


Canonical provides official Ubuntu AMIs on EC2 and corresponding official Vagrant boxes for download.

For Ubuntu 12.04 Precise, the AMIs are listed at

http://cloud-images.ubuntu.com/precise/current/

and the Vagrant boxes are listed at

http://cloud-images.ubuntu.com/vagrant/precise/current/

You can use this to start with the same base config on EC2 as you are using locally in dev.

Solution 2:

No, there is no way to use Amazon Linux outside of EC2. If you want to use a Red Hat Enterprise Linux derivative (which Amazon Linux is), I recommend using CentOS 6 both in Vagrant and on EC2. You will find many CentOS base boxes here, and the official AMIs are listed here.


Solution 3:

On 13-Dec-2017, Amazon released Amazon Linux 2. With this Amazon now provides downloadable images that will run in VirtualBox, VMWare, MS Hyper-V.

Prior to this, you did have the option to use the Amazon ECS Docker image. That continues to be available for both v1 and v2.

Have a look at Running Amazon Linux 2 as a Virtual Machine On-Premises.

I suspect someone will publish a vagrant box soon. In the interrim, it is fairly easy to build a base box yourself.


Solution 4:

Also worth taking a look at http://www.packer.io it can be used to give you exactly the same ami image for your external vagrant


Solution 5:

Amazon Linux is based on Redhat/CentOS, so the names will match more closely if you run one of those locally.

Debian/Ubuntu based Linux OSes change up the package names, e.g. "dev" instead of "devel" as a suffix for development packages.

Btw, you might want to check out the output of "rpm -qa" on an Amazon Linux instance, munge it to match CentOS/Redhat package names, and then think creating your own OS version that closely matches Amazon's.