Can't access bahmni on Ubuntu server from another machine

I have bahmni virtualbox installed on an Ubuntu 18.04 server. If I plug in a monitor and keyboard to the server and navigate to 192.168.33.10/home, I can see bahmni. But if I try to navigate to 192.168.33.10/home from my personal computer, nothing ever loads. Below is my vagrantfile. I have no idea what to do. I’ve tried several different things in my vagrantfile and nothing has worked so far. Do I need to change anything with virtualbox?

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
  config.vm.box = "bahmni-team/bahmni"
  config.vm.box_check_update = true
  config.ssh.insert_key = false
  config.vm.network "public_network", ip: "192.168.33.10"

  config.vm.synced_folder "..", "/bahmni", :owner => "vagrant"
  config.vm.provider "virtualbox" do |v|
     v.customize ["modifyvm", :id, "--memory", 4092, "--cpus", 2, "--name", "Bahmni-RPM"]
  end
end

I have read the following sites (plus a lot of others), and I have not been able to figure it out. I don’t know much about networking, but I’ve done my best to follow the various instructions. Maybe someone can help me here?

EDIT: The server and my personal computer are all on the same network, and the hospital will also be accessing the server on the same network. Does that mean I should be able to use private_network instead of public_network? Because I do not want anyone getting access to our bahmni instance if they aren’t on our network.

You probably have to do port forwarding on the host server to the running vagrant instance. (thats what I do). You can do that easily enough if you have Virtualbox. check the network interface options (bridge or NAT etc) in the vagrant documentation.

I finally figured it out, thanks to @amol. Below is my Vagrantfile. I had to use config.vm.network :public_network instead of the default config.vm.network "private_network", ip: "192.168.33.10". Then I restarted vagrant using vagrant reload, chose the first option of the 4 available bridged network interfaces (I’m not sure if I chose the correct one by luck, or if any would have worked, I’ll experiment), then sshed into the vagrant box with vagrant ssh, did ifconfig, chose one of the 3 ip addresses that it output, pasted that into my browser, and it worked!!

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
  config.vm.box = "bahmni-team/bahmni"
  config.vm.box_check_update = true
  config.ssh.insert_key = false
  config.vm.network :public_network

  config.vm.synced_folder "..", "/bahmni", :owner => "vagrant"
  config.vm.provider "virtualbox" do |v|
     v.customize ["modifyvm", :id, "--memory", 4092, "--cpus", 2, "--name", "Bahmni-RPM"]
  end
end
1 Like