fedora-20をvagrantでいれてみた


こんにちは健太です。
なんか、新しいKernelに触れてみたいと思い、fedoraをMacBookAirにぶち込もうかと思います。

ネットワークの勉強が最近あつくて、LVSをおっ立てようかと思っています。
本当はCiscoとかのスイッチ触りたい。置く金も、場所もないので、ソフトウェアを駆使してネットワークの勉強をしていきます！！

単なるメモなので、間違えた手順もそのまま記載してあります。
あしからず、、、

```
kenta_suzuki% vagrant -v                                                                               [~/project/fedora]
Vagrant 1.6.3
```

とりあえず今の最新のvagrantを入れ直してみた。

何個もインスタンスたてたかったのでboxのイメージはローカルに持ってきました。

```:zsh
kenta_suzuki% curl -LO http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_fedora-20_chef-provisionerless.box
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  351M  100  351M    0     0   125k      0  0:47:53  0:47:53 --:--:--  444k
```


```:Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "fedora-20"
  config.vm.box_url = "file:///Users/kenta_suzuki/project/fedora/opscode_fedora-20_chef-provisionerless.box"
  config.vm.box_check_update = false
  config.vm.network "private_network", ip: "192.168.33.10"
  config.ssh.forward_agent = true
  config.vm.synced_folder "../data" "/vagrant_data"
end
```



```:zsh
kenta_suzuki% vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'fedora-20' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Adding box 'fedora-20' (v0) for provider: virtualbox
    default: Downloading: file:///Users/kenta_suzuki/project/fedora/opscode_fedora-20_chef-provisionerless.box
==> default: Successfully added box 'fedora-20' (v0) for 'virtualbox'!
==> default: Importing base box 'fedora-20'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: fedora_default_1403328265947_20975
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => /Users/kenta_suzuki/project/fedora
```

ログインしてみます。
`Vagrantfile`で指定した`192.168.33.10`に`ping`が通ることを確認。sshでログインします。デフォルトだと、`vagrantユーザ`のパスワードは`vagrant`になっています。


```
kenta_suzuki% ssh vagrant@192.168.33.10                                                                               [~]
The authenticity of host '192.168.33.10 (192.168.33.10)' can't be established.
RSA key fingerprint is 2a:79:62:43:a0:6a:f1:cf:e7:90:39:fb:64:0a:56:40.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.33.10' (RSA) to the list of known hosts.
vagrant@192.168.33.10's password:
Last login: Fri Dec 20 18:02:34 2013 from 10.0.2.2
[vagrant@localhost ~]$
[vagrant@localhost ~]$ sudo su -
[root@localhost ~]#
```

VirtualBox内のfedora-20にログインできました。
めでたしめでたし。