Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vagrant keeps trying to use use AWS plugin. How to stop?

Tags:

vagrant

I'm just trying to vagrant up a standard Ubuntu image for the first time. My company has set up Vagrant on my laptop already and installed some plugins for AWS. When I try to run vagrant up on my personal Ubuntu image, with a separate Vagrantfile, I get the following error:

There are errors in the configuration of this machine. Please fix
the following errors and try again:

AWS Provider:
* An access key ID must be specified via "access_key_id"
* A secret access key is required via "secret_access_key"
* An AMI must be configured via "ami" (region: #{region})

I'm not trying to connect to AWS. I'm just trying to set up my first personal image on my laptop.

like image 533
imagineerThat Avatar asked Sep 07 '15 04:09

imagineerThat


2 Answers

  1. Make sure you actually have VirtualBox installed. I witnessed this error message today and it was because I had the vagrant-aws plugin installed but not VirtualBox. Installing VirtualBox was all that was needed to fix the problem.
  2. If for some reason that still fails, then, per the OP's comment above, try using vagrant up's --provider option:

    vagrant up --provider virtualbox
    
like image 195
Mark Amery Avatar answered Nov 08 '22 10:11

Mark Amery


By default Vagrant will go through all of the config.vm.provider and will choose the first usage provider, so you should add virtualbox before aws:

  config.vm.provider "virtualbox" do |v|
    v.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
    v.memory = 4096
    v.cpus = 2
  end

or choose different provider manually either by --provider as already mentioned, or VAGRANT_DEFAULT_PROVIDER variable:

VAGRANT_DEFAULT_PROVIDER=virtualbox vagrant up

or use config.vm.provider with no configuration in order to set the order in your Vagrantfile like:

Vagrant.configure("2") do |config|
  # ... other config up here

  # Prefer VirtualBox Fusion before VirtualBox
  config.vm.provider "virtualbox"
  config.vm.provider "aws"
end

See: Basic provider usage at vagrantup.com


If you need to use AWS provider, these error means you need to set-up the right credentials by using aws configure command, so ~/.aws/credentials can be created with your aws_access_key_id and aws_secret_access_key values. For AMI configuration, check README file of the plugin (basically you need to add aws.ami into your Vagrant file).

like image 25
kenorb Avatar answered Nov 08 '22 10:11

kenorb