
Oracle EM Cloud Controlに監視対象のホストを登録する
駆け出しアラサーSEが、休日にMACと戯れた際の殴り書きメモ。日々勉強。日々進歩。
macを新しくしたので、vagrantも新しくインストールする。
以下リンクより、virtualboxのインストールをしておく。
https://www.virtualbox.org/wiki/Downloads
まずはvagrantを以下ページよりインストールする。
https://www.vagrantup.com/downloads.html
インストールできたかを確認する。無事にバージョン情報が出ればOK。
[yoshi@18-05-03T20:37:50] ~/vagrant_work % vagrant --version Vagrant 2.0.4 [yoshi@18-05-03T20:37:52] ~/vagrant_work %
適当な作業ディレクトリを作成。
[yoshi@18-05-03T20:36:26] ~ % mkdir vagrant_work [yoshi@18-05-03T20:36:48] ~ % cd vagrant_work [yoshi@18-05-03T20:36:50] ~/vagrant_work % ls [yoshi@18-05-03T20:36:50] ~/vagrant_work %
boxという「VMの元」を探す。
今は何も無いことを確認。
[yoshi@18-05-03T20:39:15] ~/vagrant_work % vagrant box list There are no installed boxes! Use `vagrant box add` to add some. [yoshi@18-05-03T20:39:17] ~/vagrant_work %
以下リンクよりインストールしたいboxを探す。
https://app.vagrantup.com/boxes/search
[yoshi@18-05-03T20:40:49] ~/vagrant_work % vagrant init ubuntu/trusty64 A `Vagrantfile` has been placed in this directory. You are now ready to `vagrant up` your first virtual environment! Please read the comments in the Vagrantfile as well as documentation on `vagrantup.com` for more information on using Vagrant.
[yoshi@18-05-03T20:40:52] ~/vagrant_work % vagrant up Bringing machine 'default' up with 'virtualbox' provider... ....... ....... ==> default: Mounting shared folders... default: /vagrant => /Users/yoshi/vagrant_work [yoshi@18-05-03T20:50:52] ~/vagrant_work %
これで晴れて接続できる。
[yoshi@18-05-03T20:51:29] ~/vagrant_work % vagrant ssh Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-145-generic x86_64) ...... ...... vagrant@vagrant-ubuntu-trusty-64:~$
やはりディレクトリの場所が宜しくなかったので、Vagrantfileやらを移動する。
こうだったものを、
vagrant_work └── Vagrantfile
新しく作成したディレクトリ(ubuntu14_test)に移動する。
vagrant_work └── ubuntu14_test └── Vagrantfile
「ubuntu14_test」という名前で移動先ファイルを作成。
[yoshi@18-05-03T20:54:34] ~/vagrant_work % ls Vagrantfile [yoshi@18-05-03T20:54:35] ~/vagrant_work % mkdir ubuntu14_test [yoshi@18-05-03T20:54:56] ~/vagrant_work % ls Vagrantfile ubuntu14_test/
ファイルを移動させる。
[yoshi@18-05-03T20:55:01] ~/vagrant_work % mv .vagrant Vagrantfile ubuntu14_test [yoshi@18-05-03T20:55:28] ~/vagrant_work % cd ubuntu14_test
initはいらないらしい。
[yoshi@18-05-03T20:56:16] ~/vagrant_work/ubuntu14_test % vagrant init `Vagrantfile` already exists in this directory. Remove it before running `vagrant init`.
vagrant upから。
[yoshi@18-05-03T20:56:22] ~/vagrant_work/ubuntu14_test % vagrant up Bringing machine 'default' up with 'virtualbox' provider... ...... ...... ==> default: Mounting shared folders... default: /vagrant => /Users/yoshi/vagrant_work/ubuntu14_test [yoshi@18-05-03T20:56:59] ~/vagrant_work/ubuntu14_test %
これで、ssh接続できる。
[yoshi@18-05-03T20:57:46] ~/vagrant_work/ubuntu14_test % vagrant ssh Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-145-generic x86_64) ...... ...... vagrant@vagrant-ubuntu-trusty-64:~$