Bahmni Virtual Box
VivekV
Gurpreet Luthra
Pankaj Kanchankar
Introduction
Whether you use Windows, Linux or Mac, you can use this process to have Bahmni running on your machine for Testing or Development. Note that it is NOT recommended to use this in production. The idea is to download the Bahmni Virtual (Vagrant) Box which is pre-installed with CentOS, and all softwares. To make the vagrant box run on your machine you will need Virtual Box, Vagrant and GIT installed (See steps below). Once you have this Vagrant box running, you can then make changes to file in the box, and see them reflect immediately. If you 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, and run them inside the Vagrant box after recompilation.
Understanding Vagrant
For development purposes we use Vagrant and Virtual Box. The vagrant box for v0.92 Bahmni should be Centos 7.6. To understand Vagrant better, you can read the following links:
Deployment Architecture
Please read the document: High Level Deployment Architecture of Bahmni, to understand the major components that are present in the Virtual Box for Bahmni
The latest version of Bahmni is v0.93
Apple M1 Chips
Vagrant/Virtual box are NOT supported on Apple M1 Silicon processors. See this discussion for options: https://talk.openmrs.org/t/running-bahmni-on-apple-silicon-m1-macs/37189
On this page
Perform the following steps to get Bahmni VM setup on your computer
Video Screencast for Windows Installation
You can watch a video on how to setup Bahmni with Virtual Box / Vagrant here: (Youtube Video). This video is created for Windows, but the steps are similar for Linux and Mac systems too.
Copying from another Bahmni Vagrant Box
If you have another Bahmni Vagrant box (in your team or another location on network) then you can save time by not downloading the vagrant. See steps given in the section Transferring your Vagrant box to another machine
FOSS development on Un*x platforms
You may encounter issues while setting up VirtualBox on Windows and we encourage you to do your Bahmni related FOSS development on Un*x platforms.
Virtualbox set up on Ubuntu
You may encounter issues while setting up Virtualbox on Ubuntu 16.04 with a dual boot Windows 10. Please read this article https://stegard.net/2016/10/virtualbox-secure-boot-ubuntu-fail/ and discussion on https://askubuntu.com/questions/900118/vboxdrv-sh-failed-modprobe-vboxdrv-failed-please-use-dmesg-to-find-out-why/9736621 before installing virtualbox.
Step 1: Install Git, Virtual Box and Vagrant on your computer
There is a known issue with Vagrant on Windows10. Please read this discussion to understand what you need to do: https://talk.openmrs.org/t/unable-to-download-vagrant-box-cannot-find-box-error-windows-10/6734/2 before installing vagrant.
For users running Windows 7/8, you may be
- Git: http://git-scm.com/book/en/v2/Getting-Started-Installing-Git
VirtualBox:https://www.virtualbox.org/wiki/Downloads
Vagrant: https://www.vagrantup.com/downloads.html (Please install Vagrant version 1.7 or newer, 2.0.2 is the recommended version)
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
Step 4: From within directory bahmni-vagrant execute "vagrant up" command
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 # Make sure that the command prompt is running "As Administrator" otherwise the next command vagrant up will hang on 'Clearing any previously set network interfaces'. #This command will download the Vagrant box from Atlas first time. Next time onwards, the already downloaded vagrant box will be used. # The download box size is about 2.5 GB. Please ensure you have a good and stable internet connection to download the box. Usually vagrant will continue download from where it got disconnected. vagrant up
Vagrant Errors
If the vagrant up command throws some error, please refer to the following page for possible error resolution: Vagrant and VirtualBox tips
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. For details on all services in Bahmni, please refer to this document: Install Bahmni on CentOS (Services)
Configure Valid SSL Certificates
When you first access the web application your browser may show a warning about an invalid security certificate, and that your connection is not secure / private. If you are testing or evaluating Bahmni you may get around this by using a self-signed certificate or adding a security exception/choosing to proceed to the site (this varies across web browsers). Otherwise please read the following document for recommended guidelines on generating SSL certificates for securing Bahmni access over HTTPS connections: Configure Valid SSL Certificates. In Firefox browser, the Advanced link will allow you to continue forward. In Chrome you may need to run the browser with temporarily disable warning (