Skip to content

Installation: Virtual Box

Eric Phetteplace edited this page Mar 29, 2016 · 9 revisions

Running Karma in Vagrant

For those users who do not want to build Karma from source code, we have vagrant - Running Karma in a virtual box.

Prerequisites:

  1. Download and Install vagrant - https://www.vagrantup.com/downloads.html Select the download package according to your Operating System and install vagrant.
  2. Download and Install Virtual Box - vagrant can work with a variety of virtual machine providers, for example: Virtual Box. Download and install the Virtual Box version according to your operating system from - https://www.virtualbox.org/wiki/Downloads

Please make sure that vbguest is installed (https://github.com/dotless-de/vagrant-vbguest/). It helps keep the VirtualBoxGuestAdditions up to date, install on the cmd line:

vagrant plugin install vagrant-vbguest

When starting this on Linux, do not use your distribution's Vagrant package to install vagrant. Install from https://www.vagrantup.com to ensure you're using the latest version of Vagrant. Using old versions of Vagrant will result in errors.

Running vagrant and karma:

  1. If you are on a Mac or Linux machine, open a Terminal. For Windows, open Command Prompt.
  2. Navigate to your home directory, lets call it $HOME.The following steps will create a directory called Web-Karma in your home directory.
  3. Type the commands until Step 6 in your Terminal or Command Prompt;
    git clone https://github.com/usc-isi-i2/Web-Karma.git
    This will create a directory called Web-Karma
  4. cd Web-Karma/vagrant
    Navigate to the folder vagrant
  5. vagrant up
    This will boot the Virtual Machine, compile Karma and bring up the web server for Karma. For the first this step takes about 5-10 minutes to set the virtual machine.
  6. After you see a message like
   ==> default: Initialized empty Git repository in /home/vagrant/Web-Karma/.git/
   ==> default: Running provisioner: shell...
   default: Running: /tmp/vagrant-shell20151027-3166-1agb82o.sh

Open http://localhost:8080 in a browser

Stopping karma and vagrant

  1. Halting the virtual machine by calling vagrant halt will gracefully shut down the guest operating system and power down the guest machine. You can use vagrant up when you're ready to boot it again. The benefit of this method is that it will cleanly shut down your machine, preserving the contents of disk, and allowing it to be cleanly started again. The downside is that it'll take some extra time to start from a cold boot, and the guest machine still consumes disk space.
  2. If you want to completely remove karma vagrant from your machine, running vagrant destroy will remove all traces of the guest machine from your system. It'll stop the guest machine, power it down, and remove all of the guest hard disks. Again, when you're ready to work again, just issue a vagrant up. The benefit of this is that no cruft is left on your machine. The disk space and RAM consumed by the guest machine is reclaimed and your host machine is left clean. The downside is that vagrant up to get working again will take some extra time since it has to reimport the machine and re provision it.

You have to call all the vagrant commands from within the $HOME/Web-Karma/vagrant folder

Karma Home

By default, the karma folder in Web-Karma/vagrant is set as KARMA_HOME. To use a custom karma home, copy your karma folder to Web-Karma/vagrant.

Warning: Karma home cannot be changed from the GUI.