Skip to content

Instantly share code, notes, and snippets.

@murachi1208
Last active August 29, 2015 14:02
Show Gist options
  • Save murachi1208/b41ad381ed65ee65eb97 to your computer and use it in GitHub Desktop.
Save murachi1208/b41ad381ed65ee65eb97 to your computer and use it in GitHub Desktop.
Chocolatey + VirtualBox + Vagrant の簡単セットアップ (Windows) ref: http://qiita.com/murachi1208/items/5b429cb7cedf76164e67
C:\> cinst virtualbox
C:\> cinst vagrant
$ vagrant box add {title} {url}
$ vagrant init {title}
$ vagrant up
$ git config --global user.name "自分のユーザー名"
$ git config --global user.email "自分のメールアドレス"
C:\> cd C:\Users\<user名>
C:\> mkdir vagrant
C:\> cd vagrant
C:\> vagrant box add centos6.5 https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box
C:\> vagrant init centos6.5
C:\> vagrant up
Host: 127.0.0.1
Port: 2222
Username: vagrant
Private key: C:/Users/<user名>/.vagrant.d/insecure_private_key
Host: 127.0.0.1
Port: 2222
id:vagrand ← pw も同じ
Host: 127.0.0.1
Port: 2222
id:vagrand ← pw も同じ
web1 Host: 127.0.0.1, Port: 2222
web2 Host: 127.0.0.1, Port: 2223
web1.vm.network :private_network, ip: "192.168.1.11"
web2.vm.network :private_network, ip: "192.168.1.12"
The default install location has been changed to 'C:\ProgramData\chocolatey'.
This install will be updated to that location in the next version. It
is strongly suggested you move this installation to the new location
as soon as possible to limit write access from all users. Do not forget
to update PATH & ChocolateyInstall environment variables.
$ ssh-keygen -t rsa -C "your_email@example.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/vagrant/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
Vagrant.configure("2") do |config|
config.vm.box = "CentOS6.5"
config.vm.box_url = "https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box"
config.vm.define :web1 do |web1|
web1.vm.network :forwarded_port, guest: 22, host: 2222, host_ip: "127.0.0.1", id: "ssh", auto_correct: true
end
config.vm.define :web2 do |web2|
web2.vm.network :forwarded_port, guest: 22, host: 2223, host_ip: "127.0.0.1", id: "ssh", auto_correct: true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment