*coding: utf-8*
Download net install iso. Find a mirror close to you at http://isoredirect.centos.org/centos/6/isos/x86_64/
- Name: vagrant-centos
- Operating System: Linux
- Version: Red Hat 64bit
- Base Memory Size: 768 Mb
- Dynamically expanding hard disk: 40Gb
- Disable Audio
- Disable USB
- Make sure network is set to NAT
- Attach the net install ISO to the CDROM so it can boot
- Install system
- Skip verification
- Installation Method: HTTP
- Disable IPv6, leave IPv4 enabled with DHCP
- HTTP Setup:
– URL: http://mirror.centos.org/centos/6/os/x86_64/
- Initialize drive and erase data: yes
- Configure network: yes
– Set hostname to vagrant-centos
- Root password: vagrant
- Select minimal setup (click continue, this will take a while)
- Remove CDRom media
- Reboot
- Disable firewall
- yum install curl ftp rsync sudo time wget which git-core
- yum install gcc bzip2 make kernel-devel-`uname -r`
- From the menu: Devices → Install Guest Additions…
- sudo mount -o ro -t iso9660 /dev/cdrom /mnt
- sudo sh /mnt/VBoxLinuxAdditions.run
- Will complain about X related drivers we didn’t install. Should be fine.
- If you need to recompile, run this within the VM /etc/init.d/vboxadd setup and then vagrant reload
- yum install nfs-utils
- chkconfig rpcbind on
- chkconfig nfslock on
- yum install gcc-c++ zlib-devel openssl-devel readline-devel sqlite3-devel
- groupadd admin
- useradd -G admin vagrant
- passwd vagrant # choose “vagrant” as the password
- Add the following lines at the bottom:
- Vagrant user should be able to sudo
%admin ALL=NOPASSWD: ALL
- Comment out the following line:
- Defaults requiretty # (otherwise ssh doesn’t work)
- Add the variable “PATH” to the “Defaults env_keep” list, otherwise sudo cleans the path, and loses ruby, which ohai needs
- Add the /usr/sbin and /sbin to the path
echo ‘export PATH=$PATH:/usr/sbin:/sbin’ >> ~vagrant/.bashrc
…
- curl -L https://get.rvm.io | bash -s stable —ruby
- source .bash_profile
- rvm install 1.9.2-p290
- rvm default 1.9.2
- rvm use 1.9.2
- gem install chef —no-ri —no-doc
mkdir .ssh
chmod 755 .ssh
curl https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub > .ssh/authorized_keys
chmod 644 .ssh/authorized_keys
- sudo yum clean headers packages dbcache expire-cache
- halt
Follow instructions on http://vagrantup.com/docs/base_boxes.html