Skip to content

Instantly share code, notes, and snippets.

@simbalinux
Last active October 29, 2018 21:02
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 simbalinux/dbd91f1a0f22c135f16bc5cb6a765edc to your computer and use it in GitHub Desktop.
Save simbalinux/dbd91f1a0f22c135f16bc5cb6a765edc to your computer and use it in GitHub Desktop.
Centos7 Vagrant && VirtualBox-5.2
#!/usr/bin/env bash
# enable debug mode
set -x
# 1. deploy new install of Centos 7 minimal
# 2. ensure that "secure boot" is disabled otherwise you get the following error: (see below)
#######
# vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.
# update & upgrade system
yum -y update && yum -y upgrade
# install tools for sys admin
yum -y install curl wget vim tree
# install repo for VB
wget https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo -P /etc/yum.repos.d
# install requirements
yum -y install kernel-devel kernel-headers make patch gcc rsync
# install VirtualBox*
yum -y install VirtualBox-5.2
# download guest additions
wget https://download.virtualbox.org/virtualbox/5.2.20/Oracle_VM_VirtualBox_Extension_Pack-5.2.20.vbox-extpack
# install it
echo "y" | VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-5.2.20.vbox-extpack
# download latest vagrant and "yum -y install vagrant*.rpm"
wget https://releases.hashicorp.com/vagrant/2.2.0/vagrant_2.2.0_x86_64.rpm
yum -y install vagrant*.rpm
# test vagrant this verifies VB and vagrant are both installed.
yum install -y install rsync
vagrant init centos/7
vagrant up
# test
vagrant status
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment