LoginSignup
2
2

More than 5 years have passed since last update.

Vagrant Memo

Posted at

box作ったりしてるけど、その都度、どうやるか忘れるからメモ

後から追加していく。

VagrantBox の作り方

基本ここに全部書いてはるのでそれを http://qiita.com/t_oginogin/items/e9d2efff211b4ae064df

個人的には、セクション単位?でVirtualBoxでスナップショットを取りまくる方法でやっている。
かなり便利で、ごついソフトインストールして要らなくなって消しても、インストールした状態まで戻せる。

パッケージ生成

> vagrant package --base Centos56 --output centos56.box
  1. --base の引数 Centos56 はVirtualboxのイメージパスを指すけど、何故かvbox拡張子まで入れるとうまくいかないみたいなので、拡張子外した形で指定

パッケージの追加方法

> vagrant box add centos56 centos56.box

Chef を書き換えたので、再度動かす

> vagrant reload
> vagrant provition

Vagrant Error

なんかハマる例なのを。

mount に失敗して、Chefなどが動いていない

Failed to mount folders in Linux guest. This is usually beacuse
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group apache | cut -d: -f3`,dmode=777,fmode=777 /vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g apache`,dmode=777,fmode=777 /vagrant /vagrant

参考: vagrantでmountエラーの解決方法

解決法

> vagrant ssh
[vagrant@localhost ~]$ sudo /etc/init.d/vboxadd setup

CentOS の調節

参考: RedHat系のOSで、不要になったパッケージを削除

大体は標準で入っているが念のためなコマンド

# yum install yum-utils

不要なソフトウェアの検索と削除

# package-cleanup --leaves
Setting up yum
libyaml-0.1.4-1.el5.rf.i386
# yum remove libyaml-0.1.4-1.el5.rf.i386
2
2
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
2
2