Drew Sears edited this page Jul 7, 2017 · 4 revisions



Get the status of all running or powered off boxes

vagrant global-status

Halt all running boxes

vagrant global-status | awk '/running/{print $1}' | xargs -r -d '\n' -n 1 -- vagrant halt


CentOS 7 bootstrap script:

Bootstrap a CentOS 7 image for Vagrant:

  • Disable SELinux
  • Install Ansible
  • Install VirtualBox 4 guest additions

Step 1:


echo "Turn off SELinux enforcement"
sed -ie 's/enforcing/permissive/g' /etc/selinux/config

echo "Installing EPEL"
yum -y install epel-release

echo "Full yum update"
yum -y update

echo "Installing extra yum packages for Ansible"
yum install -y \
  dkms \
  gcc \
  kernel-devel \
  openssl-devel \
  python-pip \

echo "Installing development tools"
yum groupinstall -y "Development Tools"

echo "Upgrading pip"
pip install --upgrade pip

echo "Installing ansible"
pip install ansible


Step 2:


echo "Downloading VirtualBox guest additions"
cd /tmp
curl -O

echo "Mounting ISO"
mkdir /mnt/iso
mount -t iso9660 -o loop /tmp/VBoxGuestAdditions_4.3.36.iso /mnt/iso/

echo "Get kernel directory"
KERN_DIR=/usr/src/kernels/`uname -r`
export KERN_DIR

echo "Install VirtualBox guest additions"
cd /mnt/iso