jmitchell / vagrant-bootstrap

0 stars 0 forks source link

Write script to install Ubuntu 14.04 Vagrant VM on an Ubuntu 14.04 host #14

Closed jmitchell closed 10 years ago

jmitchell commented 10 years ago

This process was done completely manually in #13. Now it needs to be turned into scripts. Later the scripts will need to be expanded to support other POSIX host OSs.

jmitchell commented 10 years ago

Place these two scripts in the home directory of the host Ubuntu OS and run bootstrap.sh. Aside from the sudo call to run the second script (bootstrap-install.sh) this process is non-interactive.

bootstrap.sh

#!/bin/sh

mkdir $HOME/.vagrant-bootstrap
cd $HOME/.vagrant-bootstrap

# Download latest version of Vagrant (version hardcoded for now)
wget http://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.3_x86_64.deb

# Elevate permissions to install software
sudo $HOME/bootstrap-install.sh

# Download and launch Ubuntu VM
vagrant init ubuntu/trusty64
vagrant up
vagrant ssh -c "echo 'Hello from Ubuntu 14.04 Vagrant VM'"

bootstrap-install.sh

#!/bin/sh

# Install latest version of Vagrant (version hardcoded for now)
dpkg -i $HOME/.vagrant-bootstrap/vagrant_1.6.3_x86_64.deb

# Install VirtualBox
apt-get update
apt-get -y install virtualbox