LoginSignup
18
17

More than 5 years have passed since last update.

vagrantの標準設定はどこに由来するのか?

Last updated at Posted at 2013-06-14

ちょっとさがすのに手間取ったので記録しておきます。

vagrantの標準のネットワーク設定(ssh 22 -> 2222に転送とか)は、どこで設定されているのか
不明だったので調査してみました。

どうやら(vagrant@1.0.7)では、

/var/lib/gems/1.9.1/gems/vagrant-1.0.7/config/defaulst.rb

にいろいろ標準の設定が書かれている模様です。
中身としては以下のような物となっています。

config.rb
Vagrant::Config.run do |config|
  # default config goes here
  config.vagrant.dotfile_name = ".vagrant"
  config.vagrant.host = :detect

  config.ssh.username = "vagrant"
  config.ssh.host = "127.0.0.1"
  config.ssh.guest_port = 22
  config.ssh.max_tries = 100
  config.ssh.timeout = 10
  config.ssh.forward_agent = false
  config.ssh.forward_x11 = false
  config.ssh.shell = "bash"

  config.vm.auto_port_range = (2200..2250)
  config.vm.box_url = nil
  config.vm.base_mac = nil
  config.vm.forward_port 22, 2222, :name => "ssh", :auto => true
  config.vm.boot_mode = "headless"
  config.vm.guest = :linux

  # Share the root folder. This can then be overridden by
  # other Vagrantfiles, if they wish.
  config.vm.share_folder("v-root", "/vagrant", ".")

  config.nfs.map_uid = :auto
  config.nfs.map_gid = :auto

  config.package.name = 'package.box'
end

いろいろ他にもデフォルトで設定されているようですね。
ちょっとまだ意味がわかってないですが...。

以上です。

18
17
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
17