rubylinuxsinatravirtualboxshotgun

Virtual Box port forwarding misery with Ruby Sinatra:4567 / Shotgun:9292


I've got a VirtualBox CentOS 7.0 Guest OS on a Windows Ten Host for the purposes of development, and the port forwarding simply isn't working.

I have a NAT'd network adapter (I can't use Bridged Adapters on this network) and to be fair I am much more comfortable with Bridged Adapters. But everything else works swimmingly. Except the ports 4567 and 9292 will not forward, while port 22 and port 80 work fine.

I have

all the time I am ssh'd in on port 22 and port 80 works fine

Is this a traffic issue or a firewall issue, is there some sort of network filtering on the VirtualBox interface that's hidden from me?

I'd love some help.


Solution

  • NB: THE CAUSE IS SHOTGUN/RUBY NOT VirtualBox nor Firewalls nor port forwarding

    @Matt fixed this... his link in the comments is correct, the fix to this is one of two things: (it's actually shotgun running ruby in development mode that causes it)

    CAUSE:

    SOLUTION:

    Good news is if you're looking to make localhost:4567 work this is your ticket, add the line set :bind, '0.0.0.0' to your config and you're good to go

    ANNOYINGLY IF YOU RUN SHOTGUN THIS ISN'T GOING TO BE PICKED UP

    Bad news is if you're looking to make localhost:9292 work shotgun does it's own thing here: