0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[WIP]Vagrantで開発環境をつくる!

Last updated at Posted at 2018-05-03

1.Officialのboxが置かれているサイトに遷移する

Discover Vagrant Boxes

[https://gyazo.com/b5c43147ebde679c6f93b7288ad0252c]
(https://app.vagrantup.com/boxes/search?provider=virtualbox)

2.上記サイトからboxを作成する

https://gyazo.com/fc78738933d0b76764dffd03d31eb176

boxを追加
vagrant box add { box名: ()ubuntu/trusty64 }

Image from Gyazo

3. 仮想マシンを作成

boxの一覧を表示
vagrant box list

https://gyazo.com/7f658ddc112ad6a30c530d5258863de7

プロジェクトフォルダを作成し、移動
()mkdir ~/private-workSpaces/{ プロジェクトフォルダ }
()cd  ~/private-workSpaces/{ プロジェクトフォルダ }
vagrantファイルを作成(初期化)
vagrant init { box名: ()ubuntu/trusty64}

https://gyazo.com/d67913a18852fcef402d0bcfdef8f996

https://gyazo.com/474e7496fa3c0a3f5f8764c6768d9c84

3. vagrantの実行

vagrantの実行=仮想マシンの実行になります。

vagrant up

コマンドでvagrantを実行します。

vagrant起動
vagrant up
vagrant ssh

コマンドでログインできます。

vagrantログイン
vagrant ssh

ターミナルの表示が

vagrant@vagrant-ubuntu-trusty-64:~$

になっていたらログインできています。


ちなみに、Ubuntuでroot権限になるには

root権限
sudo su -

でできます。

コマンド表示
root@vagrant-ubuntu-trusty-64:~#

参考サイト

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?