Error running Bahmni via vagrant

I was setting up a dev environment according to these instructions, and I set up Bahmni via vagrant according to these instructions. This was successful at first glance (e.g. I could see the Bahmni EMR home screen). I then linked my local folders to the vagrant machine, but started to see some errors (e.g. going to the registration app I got an error message, and I was seeing 500 responses from the visitLocation web service. So I decided to do a vagrant destroy and reinstall.

However I can’t get a new vagrant install to work anymore.

(I first cleared everything out with vagrant destroy and rm -rf .vagrant and I removed the bahmni and bahmni-team/bahmni boxes with vagrant box remove.)

Then I do vagrant up and I get this output:

MacBook-Pro-3:bahmni-vagrant djazayer$ vagrant up
Ignoring ffi-1.9.10 because its extensions are not built.  Try: gem pristine ffi --version 1.9.10
Ignoring nokogiri- because its extensions are not built.  Try: gem pristine nokogiri --version
Ignoring unf_ext- because its extensions are not built.  Try: gem pristine unf_ext --version
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'bahmni-team/bahmni' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'bahmni-team/bahmni'
    default: URL:
==> default: Adding box 'bahmni-team/bahmni' (v0.86) for provider: virtualbox
    default: Downloading:
==> default: Successfully added box 'bahmni-team/bahmni' (v0.86) for 'virtualbox'!
==> default: Importing base box 'bahmni-team/bahmni'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bahmni-team/bahmni' is up to date...
==> default: Setting the name of the VM: bahmni-vagrant_default_1481761656480_51026
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address:
    default: SSH username: vagrant
    default: SSH auth method: private key
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

Doing vagrant status shows the machine is running, but when I do vagrant ssh I get

ssh_exchange_identification: Connection closed by remote host

If I peek in the virtualbox UI I do see a login screen. I can log in as vagrant/vagrant, and I see that openssh-daemon is running.

Any suggestions for what might be going wrong here?

(OSX Sierra, Vagrant 1.9.1, Virtualbox 5.0.30, and I have a clean checkout of bahmni-vagrant.)

Hmm, I fiddled around a bit more and got this working:

  • in the network settings for this VM, Adapter 1 (NAT) had the Cable Connected box unchecked. I checked this box
  • from inside the VM I did sudo /etc/init.d/network restart (that fixed the vagrant ssh command, but I still couldn’t see the Bahmni services)
  • vagrant halt and then vagrant up

I don’t know if all those steps were necessary, or if there was a better order. And I don’t know if I myself accidentally disconnected the networking (no idea how I would have done that…)

If anyone has any insight into what the issue could have been, please let me know.


From the warnings regarding extensions, looks like vagrant is not correctly installed. That might be the cause. Not sure though.