Skip to content

Initial Vagrant Setup

maxwellbenjamin edited this page Aug 22, 2019 · 1 revision

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 Building from Scratch, 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.0). 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.6.2p47
    • Rails: rails --version --> 5.1.7
    • RVM: rvm --version --> 1.29.9

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 "[email protected]"

[OPTIONAL] Allocate more memory to your Virtual machine

The current Vagrantfile allocates 2.0Gb RAM to your VM. If you system has more available RAM, you may want to increase 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", "2048"]
    Change this to 4096 or more, but leave at least 2.0Gb for your host system.
  • Re-start the VM by typing
    vagrant up