Vagrant: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
mNo edit summary
Line 26: Line 26:
The common usage may be:
The common usage may be:


1) create 'grassdata' directory in vagrant's home directory (enter commands from virtual machine):
1) get data to your virtual machine, first we create empty directory for grassdata on virtual machine


  # mkdir grassdata && cd grassdata
  $ vagrant ssh -c "mkdir grassdata"


2) download sample data
You have several options:
   
 
  # wget https://grass.osgeo.org/sampledata/north_carolina/nc_spm_08_grass7.tar.gz
1a) link your grassdata from local to virtual machine:
# tar xzf nc_spm_08_grass7.tar.gz
 
  $ vagrant ssh-config > ssh-config
  $ sshfs -F ssh-config vagrant@grass-gis-vagrant:~/grassdata /opt/grassdata


Note: you can also copy your local data to the virtual machine by 'scp' command (enter commands from your local machine):
1b) copy your grassdata from local to virtual machine:


  $ vagrant ssh-config > ssh-config
  $ vagrant ssh-config > ssh-config
  $ scp -r -F ssh-config /opt/grassdata/gismentors grass-gis-vagrant:grassdata
  $ scp -r -F ssh-config /opt/grassdata/gismentors grass-gis-vagrant:grassdata
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


3) start GRASS from virtual machine
3) start GRASS from virtual machine

Revision as of 19:32, 10 February 2016

This page shows how to use Vagrant_(software) 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

The common usage may be:

1) get data to your virtual machine, first we create empty directory for grassdata on virtual machine

$ vagrant ssh -c "mkdir grassdata"

You have several options:

1a) link your grassdata from local to virtual machine:

$ vagrant ssh-config > ssh-config
$ sshfs -F ssh-config vagrant@grass-gis-vagrant:~/grassdata /opt/grassdata

1b) copy your grassdata from local to virtual machine:

$ vagrant ssh-config > ssh-config
$ scp -r -F ssh-config /opt/grassdata/gismentors grass-gis-vagrant:grassdata

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

3) start GRASS from virtual machine

# grass71

To halt running virtual machine type:

vagrant halt

How to update GRASS installation