Accessing rails sever on a virtual machine from host machine - ruby-on-rails

I've got Ubuntu (the newest version) running as a virtual machine on Windows 7 Pro, using VMware.
My question is, can I make the rails sever acessible to windows while the virtual machine is running?
So, for example, if I type on my Windows browser http://localhost:3000 I would get the rails sever?
Also, can I make it acessible to computers from the outside, so if someone would type
myipaddress:3000 he would be able to acess the sever as a client?
I hope this is clear.

There are a lot of "ifs" here, but it should "just work".
In Linux, find the IP address of your virtual machine.
$ /sbin/ifconfig
You're looking for a section that is probably labelled "eth0" and in that "inet addr".
Using that address with port 3000 from your Windows host should work fine. If not, post the specific problem that you're seeing, including any logs you can find or info on any firewalls you have running on your Linux client.

Related

Crate.io: Can't connect remotely

I've installed a Crate DB on a Virtual Machine Ubuntu (xenial).
Since I want to connect to it from both my VM and my Windows host, I've tried to set the VM's IP on both params in crate.yml:
network.host
network.publish_host
The rest of the parameters I can see in crate.yml
But that won't do the trick (I get ERR_CONNECTION_TIMED_OUT error when I try to connect to "my_VMs_ip:4200" from my Windows host PC) and I can't find any way around it on crate.io nor on Google.
Would any of you have an idea?
Thanks a lot
NB: I'm running Crate 2.0.7

How to run Grails application so that other computers on network can access it?

I've developed a Grails application and I want my coworkers to be able to test it. They are on my network so I figure they can access it by using my IP address and the port number (8080). I've tried running it according to the steps laid out here and here to no avail.
I noticed that whenever I run the program, even when I follow those instructions, it says:
Grails application running at http://localhost:8080 in environment: development
Basic networking stuff here.
When something starts on interface 127.0.0.1 port something
Usually that port is then available for all the interfaces on the machine
if you run netstat -plant you will see running ports open on the machine.
Basically what ever ipconfig or ifconfig tells under Linux as your internal interface something like 192.168.1.x
The app is then available on http://192.168.1.x:8080
If you can't access it from other machines on network start by trying to ping {your machine ip}
It sounds like network security stopping local access from 1 machine accessing another.
Or even better still your good old MS firewall try stopping your security stuff on your desktop
It's not clear if you can access the app yourself on your own machine? It should be available at:
http://localhost:8080/appname
Your co-workers should be able to access the app by changing localhost to your computer name:
http://mycomputername:8080/appname

Access Rails App Subdomains Through VirtualBox

I'm running a Windows 7 VirtualBox on my Ubuntu 13.10 machine where I have my rails app. I access my rails app through subdomains (i.e. subdomain1.lvh.me:3000) and I'm trying to access these same subdomains through my VB. I've read to change the host file but I haven't been able to make it work. Would I be using the Gateway IP or the IPv4 address?
The reason for me trying to accomplish this is to develop on my Ubuntu machine and test for IE issues on my VB without using paid third party websites to render my changes.
I think that if, for example, your ubuntu machine's ip address is 192.168.0.123, then it should suffice to have this line in your windows hosts file
192.168.0.123 subdomain1.lvh.me subdomain2.lvh.me subdomain3.lvh.me
Then on your windows vb you would access subdomain1.lvh.me:3000 like you say.
Have you done this? I don't know what you mean by " I've read to change the host file but I haven't been able to make it work. " What isn't working?

Is there a way I can access my Rails Application of my Ubuntu VM from my Windows 7?

I got a Rails application (running on Thin server) running on my Ubuntu VM, how can I be able to access it from my Windows 7 OS? I already have the VM bridge option enable.
I tried using the IP address from my Ubuntu VM directly to my windows 7 browser, but nothing happens, is there a way to do that?
Yes, you can:
You need a Bridged adapter for your Virtual Machine
You need to know your VM's IP address (ifconfig | grep inet on Ubuntu)
Your VM needs to be turned on AND running the server
Then in your Windows 7 (or other computer in your local network, your smartphone for instance) you can open a browser and go to your VM's IP address + port (usually 3000).
So, the address to put in your browser might look like this:
http://192.168.1.5:3000/

How do I access my web application from a non-local machine?

I have a Ruby on Rails application that I'm developing on my computer, which runs Ubuntu 10.04 LTS. I'd like to be able to access it from a remote computer for testing purposes. I've no idea how to proceed. Do I need to set up port forwarding? Virtual hosts? Can anyone point me to an article/tutorial/whatever that has information about how to do this?
Thanks!
If you want to run it using the server script, you can have it listen to a specific IP address like:
script/server -b 192.168.1.5
Substitute your machine's IP address that is accessible over your network. Then other hosts can get to the Rails app via e.g. http://192.168.1.5:3000.
If you mean you're behind a firewall or NAT gateway, then the question of how people outside of your firewall/NAT can get to your machine is another question entirely... something that probably belongs on superuser.com.
The best way I've found is to use http://www.tunnlr.com.

Resources