icon [vagrant]macにVagrant + VirtualBox + Debian (2017/03/22)

vargrantインストール

https://www.vagrantup.com/

box追加

vagrantbox.esからboxのURLをコピーしターミナル実行

$ vagrant box add ARTACK/debian-jessie https://atlas.hashicorp.com/ARTACK/boxes/debian-jessie
==> box: Loading metadata for box 'https://atlas.hashicorp.com/ARTACK/boxes/debian-jessie'
==> box: Adding box 'ARTACK/debian-jessie' (v8.1.0) for provider: virtualbox
box: Downloading: https://atlas.hashicorp.com/ARTACK/boxes/debian-jessie/versions/8.1.0/providers/virtualbox.box
box: Progress: 31% (Rate: 1768k/s, Estimated time remaining: 0:03:11)



boxの確認

vagrant box listARTACK/debian-jessie (virtualbox, 8.1.0)



初期化/起動

まず名称が長いので変更

cd ~/.vagrant.d/boxesmv ARTACK-VAGRANTSLASH-debian-jessie debian81



mkdir -p ~/vagrant/debian81cd ~/vagrant/debian81
vagrant up debian81
vagrant up

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'debian81'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'debian81' is up to date...
==> default: Setting the name of the VM: debian81_default_1490150594432_4688
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
.....


$vagrant statusCurrent machine states:

default running (virtualbox)



SSH接続

設定したboxホームからssh接続できる。
root初期パスワードは「vagrant」

$vagrant ssh$ su
Password: