Skip to content

Initial Vagrant Setup

Mark Bussey edited this page Oct 10, 2018 · 20 revisions

This guide walks you through the steps to set a VM with all the necessary Hyrax prerequisites so that you can get going quickly with the tutorials in this WIKI. The application was built following the main outline of the instructions on the Hyrax github page, and we have added the steps to make using a Vagrant based virtual machine easier and to minimize the number of downloads you'll need to do while in class.

Goals:

  • Start a vagrant based virtual machine
  • Log into the VM
  • Confirm the versions of software installed

Prerequisites

  • At least 4GB of available RAM in your host system
  • A Recent version of VirtualBox Installed
  • A Recent version of Vagrant Installed
  • Windows Users only - we recommend you install GitHub Desktop app which provides a number of useful tools

Set up the VM from a thumb-drive

  • Install Vagrant & VirtualBox if you haven’t already (use the installers on the thumbdrive to save WIFI bandwidth)
  • Copy the /tutorial folder from the thumbdrive to your laptop
  • Once the copy process is complete, eject the thumbdrive and keep it to use at home
  • Open a terminal window and change to the tutorial directory
  • Start the VM by typing
    vagrant up

[ALTERNATE] Set up the VM from the web

  • Install Vagrant & VirtualBox if you haven’t already
  • Open a terminal window and create a directory named vagrant
    mkdir vagrant
  • Change your working directory to the new directory
    cd vagrant
  • Get a copy of the Vagrantfile configured specifically for the tutorials
    wget http://camp.curationexperts.com/Vagrantfile
  • Start the VM by typing
    vagrant up

Connect to the VM

  • Verify that you have the correct version of the VM running
    vagrant box list

    This should show camper (virtualbox, 7.1). If you don't see this version listed, try vagrant destroy && vagrant box remove camper --all, then run vagrant up again.

  • Connect to the VM by typing
    vagrant ssh

    Ask for help if you don’t end up with a prompt like vagrant@camper:~$ ← when you see this, you’re ready for the tutorial exercises.

Check the installed versions

  • From the vagrant@camper:~$ prompt in your VM, check the installed versions by typing each of the following commands:
    • Ruby: ruby --version --> 2.5.1p57
    • Rails: rails --version --> 5.1.6
    • RVM: rvm --version --> 1.29.4

If you don't see these versions, go back and check you completed each step above. If you're in class, don't hesitate to ask for help.

Add your git identity in the VM

  • From the vagrant@camper:~$ prompt in your VM, set your git identity
    • Add your git display name
      git config --global user.name "Camper, Happy"
    • Add the e-mail associated with your GitHub account
      git config --global user.email "snacks@curationexperts.com"

[OPTIONAL] Adjust the memory allocation for your Virtual machine

The current Vagrantfile allocates 4.0Gb RAM to your VM. If you system has more or less available RAM, you may want to increase or decrease this allocation

  • If you're at a prompt like vagrant@camper:~$, exit to your host system
    exit
  • Stop your VM by running
    vagrant halt
  • Edit your Vagrantfile and edit the line that says
    vb.customize ["modifyvm", :id, "--memory", "4096"]
    Change this to 8192, 2048 or another allocation appropriate to your laptop.
  • Re-start the VM by typing
    vagrant up