在Windows上运行Vagrant Up-gt;> EC2-> Windows

时间:2015-02-16 22:25:08

标签: windows amazon-ec2 vagrant vagrant-plugin

我们在Windows上运行Vagrant,使用EC2插件来启动Windows框。

运行我们的Vagrant文​​件时,系统会提示我们输入SMB共享的用户名/密码。

我们如何编辑Vagrant文​​件或添加命令行开关来抑制此用户交互?

我们的Vagrant命令是vagrant up --provider=aws

我们的流浪档案如下

Vagrant.configure("2") do |config|
  config.vm.box = "dummy"
    config.vm.guest = :windows
    config.vm.network :forwarded_port, guest: 3389, host: 3389
    config.vm.network :forwarded_port, guest: 22, host: 22
    config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true
    config.ssh.username = "user"
    config.ssh.password = "password"
    config.ssh.insert_key = false

  config.vm.provider :aws do |aws, override|
    aws.access_key_id = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
    aws.secret_access_key = "KKKKKKKKKKKKKKKKKKKKKK"
    aws.ami = "ami-i866gft"
  end
end

1 个答案:

答案 0 :(得分:1)

也许你有一种不同的方式与流浪汉合作。这适用于我的情况,没有任何互动:

Vagrant.configure("2") do |config|
config.vm.box = "dummy.box"
config.vm.synced_folder '.', '/vagrant', disabled: true


config.vm.provider :aws do |aws, override|
  aws.access_key_id = "XXXX"
  aws.secret_access_key = "XXXX"
  aws.ami ="ami-f2f5f9ef"
  aws.security_groups = ['instance-name-on-aws']
  aws.keypair_name = "ssh_key_name"

  override.ssh.username = "user"
  override.ssh.private_key_path = "ssh_key_name.pem"
  aws.instance_type = "t2.micro"
  aws.region = "region"
end
end