Last active
February 8, 2018 18:34
-
-
Save hans/f036afa454eb59f0a62ce8fb6bafbe2b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export VAGRANT_HOME=/om2/user/$USER/vagrant | |
dir=/om2/user/$USER/vms/ibex | |
mkdir -p $VAGRANT_HOME || exit 1 | |
mkdir -p $dir || exit 1 | |
cd $dir | |
# Set up an Ubuntu 16 VM managed by Vagrant. | |
vagrant init ubuntu/xenial64 | |
# Here: edit `Vagrantfile` and uncomment the first line with the term `"forwarded_port"`. | |
# Change the host port to some random number in the 1000s. | |
# This forwards the port 80 on the VM to a port on the host (oms.mit.edu). | |
# Provision and launch the VM. | |
vagrant up | |
# Test run: install lighttpd | |
vagrant ssh -c "sudo apt-get update && sudo apt-get install -y lighttpd && sudo service lighttpd start" | |
# You should be able to see the lighttpd test page at http://oms.mit.edu:PORT ! | |
# Get an interactive shell with this command: | |
vagrant ssh | |
# Disable the server with | |
vagrant ssh -c "sudo service lighttpd stop" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment