Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
net/wiki/display/BAH/Bahmni+Virtual+Box
Created by Vivek Singh, last modified by Himabindu Thungathurty on Dec 02, 2016
On this page
Introduction
This page has been recently updated to mention the new Bahmni Vagrant Perform the following
box setup, which uses the new Bahmni rpm based installation structure. steps to get Bahmni
VM setup on your
computer
Whether you use Windows, Linux or Mac, you can use this process to have Bahmni Step 1: Install
running on your machine for Testing or Development. The idea is to download the Git, Virtual
Bahmni Virtual (Vagrant) Box which is pre-installed with CentOS, and all softwares. Box and
To make the vagrant box run on your machine you will need Virtual Box, Vagrant
Vagrant on
and GIT installed (See steps below). Once you have this Vagrant box running, you
your computer
can then make changes to file in the box, and see them reflect immediately. If you
Step 2: Create
still wish to go ahead, and make code changes, and deploy them - then
development setup will be needed, so that you can modify files in your base OS, a folder
and run them inside the Vagrant box after recompilation. bahmni where
you would like
all project
Understanding Vagrant
related files to
For development purposes we use Vagrant and Virtual Box. The vagrant
be present
box can have Centos 6.3 - 6.5. To understand Vagrant better, you can read
the following links: Step 3: Clone
the
1. Why Vagrant? following proje
2. Difference between Vagrant boxes/VMs. cts from
3. Understanding the Vagrantfile Github inside
4. (Online Short Video Course) Understanding Vagrant the newly
created folder
bahmni
Deployment Architecture Step 4: From
Please read the document: High Level Deployment Architecture of Bahmni, within
to understand the major components that are present in the Virtual Box for directory
Bahmni bahmni-
vagrant
execute
The latest version of Bahmni is v0.86. "vagrant up"
command
Step 5: You
should have
Bahmni up
and running,
and
accessible on
the below
mentioned
links
Step 6: To halt
the VM, you
can use the
"vagrant halt"
command
Working Inside the
Bahmni Vagrant Box
Starting / Stopping
your Vagrant Box
Updating your
Vagrant Box to the
Latest Version
1 av 7 2016-12-26 23:26
Bahmni Virtual Box - Bahmni Wiki - Bahmni Documentation Wiki https://bahmni.atlassian.net/wiki/display/BAH/Bahmni+Virtual+Box
Transferring your
Vagrant box to
another machine
Related Links
Step 2: Create a folder bahmni where you would like all project related
files to be present
cd /Projects
mkdir bahmni
Step 3: Clone the following projects from Github inside the newly
created folder bahmni
cd bahmni
git clone https://github.com/Bahmni/bahmni‐vagrant.git
This command will download a CentOS Vagrant Box from the internet, and install it
on your machine ('vagrant box list' command shows a list of locally installed
boxes).
cd bahmni‐vagrant
# This command will download the Vagrant box from Atlas first
# The download box size is about 1.5 ‐ 2 GB. Please ensure you
vagrant up
2 av 7 2016-12-26 23:26
Bahmni Virtual Box - Bahmni Wiki - Bahmni Documentation Wiki https://bahmni.atlassian.net/wiki/display/BAH/Bahmni+Virtual+Box
Vagrant Errors
If the vagrant up command throws some error, please refer to the following
If download of the box fails in the step above, and you wish to directly
download the box using a downloader utility, then you can try the steps
documented here: Direct Download of Vagrant Box.
Step 5: You should have Bahmni up and running, and accessible on the
below mentioned links
If any service isn't running, then maybe you won't see the login screen.
Please start that service, and then check. To start a service (say OpenERP)
execute the following command: "sudo service openerp start" from inside
the vagrant box. For details on all services in Bahmni, please refer to this
document: Install Bahmni on CentOS (Services)
3 av 7 2016-12-26 23:26
Bahmni Virtual Box - Bahmni Wiki - Bahmni Documentation Wiki https://bahmni.atlassian.net/wiki/display/BAH/Bahmni+Virtual+Box
Step 6: To halt the VM, you can use the "vagrant halt" command
cd bahmni‐vagrant
vagrant halt
# Use 'vagrant up' next time, to restart the box.
Once you have vagrant running successfully, you can ssh into it, and browse
the following directories.
Please refer to this document, to understand the various folders in a
typical Bahmni installation on CentOS.
4 av 7 2016-12-26 23:26
Bahmni Virtual Box - Bahmni Wiki - Bahmni Documentation Wiki https://bahmni.atlassian.net/wiki/display/BAH/Bahmni+Virtual+Box
#ssh into the box
t h
cd /bahmni
# For httpd server (where the EMR UI runs from):
cd /var/www/
cd bahmni‐vagrant
# Stops your vagrant box (and remembers all file system change
vagrant halt
# Brings your vagrant back on (if you did 'vagrant halt' earli
vagrant up
# Destroy and free up space ‐ Any changes you made inside the
vagrant destroy
# Creates and starts a fresh box (won't download anything) fro
vagrant up
If you already have a Bahmni vagrant box on your machine, but would like to
update to the latest published box, please perform the following steps.
cd bahmni‐vagrant
vagrant halt
# See which versions of Bahmni vagrant box are installed on th
vagrant box list
# Warning!! This will destroy any changes you made in the vagr
vagrant destroy
# (Optional Step) Delete the box template of a specific versio
vagrant box remove bahmni‐team/bahmni ‐‐box‐version="0.81"
# Will search and download the latest Bahmni vagrant box (abou
vagrant box update
5 av 7 2016-12-26 23:26
Bahmni Virtual Box - Bahmni Wiki - Bahmni Documentation Wiki https://bahmni.atlassian.net/wiki/display/BAH/Bahmni+Virtual+Box
# You new box should come up now
If you wish to transfer the same vagrant box from your machine to another
machine, you can also do that. This has the following advantages:
1. Any data you setup in your vagrant box will also be available to the other
box/machine.
2. If the other machine doesn't have fast internet access, then also you can
perform this machine to machine box transfer, and save on bandwidth.
3. Its quicker than downloading the whole box!
Steps to perform:
Reference document: https://www.dev-metal.com/copy-duplicate-vagrant-box/
1. Create Reference Box: Create a new vagrant box that has everything from
your box packaged into it using the following commands:
# Execute these commands from the same folder where your
# Halt vagrant
vagrant halt
# Create a new .box. This will create a package.box file
vagrant package
2. Use Box on Target Machine: On the new machine, perform the following
steps:
a. Create a new folder, say: "D:/my-bahmni-vagrant"
b. Copy over the "package.box" file and "Vagrantfile" from your machine
into the above folder.
c. Edit the Vagrantfile and do the following:
# Change this value as below
config.vm.box = "my‐bahmni‐box"
# Add this line to point the url to the package.box
config.vm.box_url = "file:///d:/my‐bahmni‐vagrant/pa
Now the vagrant box on the new machine should be up. You can repeat step 2 on
other machines, now that you have a package.box as reference for others.
6 av 7 2016-12-26 23:26
Bahmni Virtual Box - Bahmni Wiki - Bahmni Documentation Wiki https://bahmni.atlassian.net/wiki/display/BAH/Bahmni+Virtual+Box
If bl d l d h b i h " " d
v 0.86: https://atlas.hashicorp.com/bahmni-team/boxes/bahmni/versions
/0.86/providers/virtualbox.box
v 0.85: https://atlas.hashicorp.com/bahmni-team/boxes/bahmni/versions
/0.85/providers/virtualbox.box
v 0.83: https://atlas.hashicorp.com/bahmni-team/boxes/bahmni/versions
/0.83/providers/virtualbox.box
After download, rename the box to "package.box". Place the box in your "bahmni-
vagrant" folder, and edit the Vagrant file as below:
Vagrantfile changes
# Change this value as below
config.vm.box = "my‐bahmni‐box"
# Add this line to point the url to the package.box
config.vm.box_url = "file:///d:/my‐bahmni‐vagrant/package.box"
Now save the Vagrantfile. And then execute the "vagrant up" command.
Charlie Brooking
In case it helps anyone, I got these errors running vagrant-up: "Warning: Authentication failure... Timed out
while waiting for the machine to boot." As a quick fix - assuming you are happy using Vagrant's insecure SSH
key - you can add this line to bahmni-vagrant/Vagrantfile:
config.ssh.insert_key = false
Sravanthi Naraharisetti
fixed this issue in v0.84. Thanks for raising the issue.
7 av 7 2016-12-26 23:26