How to run OSM on Vagrant: Difference between revisions

From OSM Public Wiki
Jump to: navigation, search
No edit summary
(additional instructions)
Line 1: Line 1:
Pre-built OSM vagrant images are available here: https://app.vagrantup.com/osm
Pre-built OSM vagrant images are available here: https://app.vagrantup.com/osm


1) Install vagrant (https://www.vagrantup.com) and virtualbox (https://www.virtualbox.org/).
1) Install vagrant (https://www.vagrantup.com) and virtualbox (https://www.virtualbox.org/), then create a working directory which will be dedicated to the OSM Vagrant VM.


2) Create the initial the Vagrantfile:
2) From specified directory, create the initial the Vagrantfile:


   vagrant init osm/releasefour --box-version 4.0.1
   vagrant init osm/releasefour --box-version 4.0.1


3) If you would like to access the OSM Web client externally from the virtualbox VM, you can open up port 80 by editing the generated Vagrantfile, i.e. uncommenting this line:
3) Edit the generated Vagrantfile if you need to customize, for example, opened ports and assigned memory
 
If you would like to access the OSM Web client externally from the virtualbox VM, you can open up port 80 by uncommenting this line:
   # config.vm.network "forwarded_port", guest: 80, host: 8080
   # config.vm.network "forwarded_port", guest: 80, host: 8080
By default the VM takes 6GB RAM, you can lower it down to 4GB (will work for minimal OSM installation), by uncommenting the corresponding section:
config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
end


4) Start OSM:
4) Start OSM:
Line 18: Line 26:
   vagrant ssh
   vagrant ssh


6) Add the relevant environment variables for OSM client, either exporting them every time you access the shell, or copying the export lines to your .bashrc file:
export OSM_HOSTNAME=127.0.0.1
export OSM_SOL005=True
Additional notes:
* If at any time you need to change something from the Vagrantfile, you can apply the changes by reloading the VM:
vagrant reload


The vagrant box file can also be downloaded manually:
* If you need to copy a file to your vagrant machine, just run 'vagrant ssh-config' and copy the private key path, then:
scp -P 2222 -i /path/to/private_key someFileName.txt vagrant@127.0.0.1:


* The vagrant box file can also be downloaded manually:
   wget https://vagrantcloud.com/osm/boxes/releasefour/versions/4.0.1/providers/virtualbox.box
   wget https://vagrantcloud.com/osm/boxes/releasefour/versions/4.0.1/providers/virtualbox.box

Revision as of 16:26, 13 June 2018

Pre-built OSM vagrant images are available here: https://app.vagrantup.com/osm

1) Install vagrant (https://www.vagrantup.com) and virtualbox (https://www.virtualbox.org/), then create a working directory which will be dedicated to the OSM Vagrant VM.

2) From specified directory, create the initial the Vagrantfile:

 vagrant init osm/releasefour --box-version 4.0.1

3) Edit the generated Vagrantfile if you need to customize, for example, opened ports and assigned memory

If you would like to access the OSM Web client externally from the virtualbox VM, you can open up port 80 by uncommenting this line:

 # config.vm.network "forwarded_port", guest: 80, host: 8080

By default the VM takes 6GB RAM, you can lower it down to 4GB (will work for minimal OSM installation), by uncommenting the corresponding section:

config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
end

4) Start OSM:

 vagrant up

5) ssh to OSM:

 vagrant ssh

6) Add the relevant environment variables for OSM client, either exporting them every time you access the shell, or copying the export lines to your .bashrc file:

export OSM_HOSTNAME=127.0.0.1
export OSM_SOL005=True

Additional notes:

  • If at any time you need to change something from the Vagrantfile, you can apply the changes by reloading the VM:
vagrant reload
  • If you need to copy a file to your vagrant machine, just run 'vagrant ssh-config' and copy the private key path, then:
scp -P 2222 -i /path/to/private_key someFileName.txt vagrant@127.0.0.1:
  • The vagrant box file can also be downloaded manually:
 wget https://vagrantcloud.com/osm/boxes/releasefour/versions/4.0.1/providers/virtualbox.box