Skip to content

Instantly share code, notes, and snippets.

@pinekta
Created August 3, 2015 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pinekta/c66d73fc37215c9f554a to your computer and use it in GitHub Desktop.
Save pinekta/c66d73fc37215c9f554a to your computer and use it in GitHub Desktop.

LinuxMintでVagrantを使用する。

2015年初めに調査した内容なので、情報が古い可能性があります。

外出時に使用するラップトップのOSにLinuxMintを使用しています。 このマシンでもVagrantを使用できるようにします。

VirtualBoxのインストール

$ sudo apt-get install -y virtualbox virtualbox-dkms virtualbox-guest-additions-iso virtualbox-qt

Vagrantのインストール

$ sudo apt-get install -y vagrant

boxの追加

CentOSを使用したいのでCentOSのboxを追加する

$ mkdir ~/vagrant
$ cd ~/vagrant
$ vagrant box add centos64-32 http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-i386-v20131103.box

仮想マシンの立ち上げ

$ vagrant init centos64-32
$ vagrant up

これで使用可能になったと思いきや下記のエラーが出た。

[default] The guest additions on this VM do not match the installed version of
VirtualBox! In most cases this is fine, but in rare cases it can
cause things such as shared folders to not work properly. If you see
shared folder errors, please update the guest additions within the
virtual machine and reload your VM.

Guest Additions Version: 4.3.2
VirtualBox Version: 4.2

しかしvagrant statusで確認するとステータスはrunningになっている。

$ vagrant ssh

でログインすることもできた。

気持ち悪いけどログインできたしよしとする。 どうせ使い捨ての環境だし。

Vagrantプラグイン「sahara」のインストール

Vagrantを使用するにあたってsaharaは絶対入れときたいのでインストール

$ vagrant plugin install sahara

あとはすでに以前作ったVagrantfileをインポートして再度vagrant upすればOK。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment