This page explains how to install OpenHatch into a virtual machine. Thanks to Vagrant and puppet, there are very few steps necessary.
It also explains how to maintain your virtual machine, and what to do if something goes wrong.
First, you will need to download VirtualBox. If you're running Windows, Mac, or Linux, I suggest you visit the VirtualBox downloads page and get the version you need.
(If you're on Debian squeeze higher, or Ubuntu Maverick or higher, you can install virtualbox-ose from the package manager. You must make sure to get version 4.0 or higher of VirtualBox. If in doubt, use the official installer.
Vagrant is a tool that makes it quite easy to manage virtual machines. Here we install it using the gem tool.
First, make sure you have the gem command. If you are unsure, type this into a terminal:
If you get an error saying "command not found", then you'll need to install it. On Ubuntu/Debian, you can do that with:
$ sudo apt-get install rubygems build-essential ruby-dev
Now, we install Vagrant:
$ sudo gem install vagrant
Get the OpenHatch code
From a terminal, type these commands to download the most recent version from OpenHatch git:
$ git clone git://github.com/openhatch/oh-mainline.git $ cd oh-mainline
Tell vagrant to bring up the machine
This should be as easy as:
$ vagrant up
If you get a command not found error, try:
$ /var/lib/gems/1.8/bin/vagrant up
This may take 30 minutes! This is a good time to go get a sandwich.
SSH into the machine, and start the web server
$ vagrant ssh $ cd /vagrant $ ./bin/mysite runserver 0.0.0.0:8000
Now, on your real computer, visit http://127.0.0.1:8000/. Ta-da! Your own editable copy of the OpenHatch site.
Things to understand
There are a few things that you really should understand:
- On the virtual machine /vagrant maps to your git clone.
- You should use a text editor on your own machine to edit the code and templates.
- The same goes for git commands: do them on your own machine.
Virtual machine maintenance
Stopping the VM
From your own machine, you can do:
$ vagrant suspend
to turn the machine off. When you do "vagrant up" the next time, everything will be restored to the way it was when you did suspend.
Starting the VM again
$ vagrant up
will bring the virtual machine online. That should work properly no matter why the VM is not on (for example: it will work if the machine has never been booted; it will work if you suspend it; it will work if you halted it).
Destroying the VM
If you want to throw away the virtual machine entirely, reclaiming disk space:
$ vagrant destroy
How to get help with this
Sign on to our IRC channel (#openhatch on irc.freenode.net) and ask us. paulproteus there is likely to be able to help.