Skip to content

Instantly share code, notes, and snippets.

@hanksudo
Last active October 13, 2015 12:05
Show Gist options
  • Save hanksudo/eeeb65768299c1d87c48 to your computer and use it in GitHub Desktop.
Save hanksudo/eeeb65768299c1d87c48 to your computer and use it in GitHub Desktop.
Repackage Vagrant box
# Update Installed Packages
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install tmux htop git vim wget curl -y

# change default editor
sudo update-alternatives --config editor

# install vimrc
rm -rf ~/.vim
wget -O - https://raw.github.com/hanksudo/vimrc/master/install.sh | sh

# install latest chef
curl -L https://www.opscode.com/chef/install.sh | sudo bash

# Install Vagrant Public Keys
mkdir -p /home/vagrant/.ssh
wget --no-check-certificate https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -O /home/vagrant/.ssh/authorized_keys

# Ensure correct permissions set
chmod 0700 /home/vagrant/.ssh
chmod 0600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant /home/vagrant/.ssh

repackage vagrant box

set config.ssh.insert_key=false to Vagrantfile before repacking.

vboxmanage list vms
vagrant package --base vm_name --output precise32-plus.box
vagrant package --base vm_name --output trusty64-plus.box

add box to box list

vagrant box add trusty64-plus trusty64-plus.box
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment