Vagrant: Difference between revisions
m (→Usage) |
m (→Usage) |
||
Line 23: | Line 23: | ||
== Usage == | == Usage == | ||
Note: it's good idea to store ssh configuration for virtual machine to the file which we can use for scp and other similar commands: | Note: it's good idea to store ssh configuration for virtual machine to the file which we can use for scp and other similar commands: | ||
Line 30: | Line 28: | ||
$ vagrant ssh-config > ssh-config | $ vagrant ssh-config > ssh-config | ||
First we need to get our GRASS data to the virtual machine, there are several options: | |||
1a) link your grassdata from local to virtual machine: | 1a) link your grassdata from local to virtual machine: |
Revision as of 08:59, 16 February 2016
This page shows how to use Vagrant together with GRASS GIS. The GRASS source code contains customized Vagrantfile. This highly simplifies the vagrant usage.
Dependecies:
apt-get install vagrant virtualbox
Note: '$' shows commands to be entered from local machine, '#' from vagrant's virtual machine
First of all we download GRASS source code from SVN:
$ svn checkout https://svn.osgeo.org/grass/grass/trunk grass_trunk_vagrant $ cd grass_trunk_vagrant
We start new vagrant instance by:
$ vagrant up
The command creates new vagrant virtual machines, downloads all dependecies, and compiles GRASS on this machine. You can connect to this machine by:
$ vagrant ssh
Enjoy!
Usage
Note: it's good idea to store ssh configuration for virtual machine to the file which we can use for scp and other similar commands:
$ vagrant ssh-config > ssh-config
First we need to get our GRASS data to the virtual machine, there are several options:
1a) link your grassdata from local to virtual machine:
$ sshfs -F ssh-config vagrant@grass-gis-vagrant:~/grassdata /opt/grassdata
1b) copy your grassdata from local to virtual machine:
$ scp -r -F ssh-config /opt/grassdata grass-gis-vagrant:
1c) download sample grassdata from Internet
$ vagrant ssh # mkdir grassdata # wget https://grass.osgeo.org/sampledata/north_carolina/nc_spm_08_grass7.tar.gz # tar xzf nc_spm_08_grass7.tar.gz
2) start GRASS from virtual machine
# grass71
3) To halt running virtual machine type:
$ vagrant halt
How to update GRASS installation
First of all, update GRASS source code from SVN:
$ svn up
To update your GRASS installation in vagrant (make && make install):
$ vagrant provision
If you want to re-compile GRASS from scratch (make distclean && configure && make && make install) you need to destroy your virtual machine and create new one:
$ vagrant destroy -f $ vagrant up