Skip to content

Instantly share code, notes, and snippets.

@sdorsett
Created October 7, 2017 03:33
Show Gist options
  • Save sdorsett/576d71160d55dfeb9e6fa851a46e31c2 to your computer and use it in GitHub Desktop.
Save sdorsett/576d71160d55dfeb9e6fa851a46e31c2 to your computer and use it in GitHub Desktop.
install virtualbox and vagrant on a centos 7 virtual machine
# install virtualbox
cd /etc/yum.repos.d/
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
yum update -y
yum -y install epel-release
yum -y install gcc make patch dkms qt libgomp
yum -y install kernel-headers kernel-devel fontforge binutils glibc-headers glibc-devel
reboot # to restart with updated kernel version
yum -y install VirtualBox-5.1
# install vagrant
wget https://releases.hashicorp.com/vagrant/2.0.0/vagrant_2.0.0_x86_64.rpm?_ga=2.37498661.466161745.1507331820-2273825.1491436122
mv vagrant_2.0.0_x86_64.rpm\?_ga\=2.37498661.466161745.1507331820-2273825.1491436122 vagrant_2.0.0_x86_64.rpm
yum -y localinstall vagrant_2.0.0_x86_64.rpm
# test vagant pulling down and running hashicorp/precise64 box
mkdir vagrant-ubuntu
cd vagrant-ubuntu/
vagrant init hashicorp/precise64
vagrant up
vagrant ssh
# install packer
wget https://releases.hashicorp.com/packer/1.1.0/packer_1.1.0_linux_amd64.zip?_ga=2.13750192.648333274.1507334772-255894907.1491664971
mv packer_1.1.0_linux_amd64.zip\?_ga\=2.13750192.648333274.1507334772-255894907.1491664971 packer_1.1.0_linux_amd64.zip
yum install unzip -y
unzip packer_1.1.0_linux_amd64.zip
mv packer /usr/local/bin/
# build a Debian vm using packer using chef/bento repository
git clone https://github.com/chef/bento.git
cd bento/
packer build -var 'headless=true' -only=virtualbox-iso debian-8.9-amd64.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment